【问题标题】:Need help in setting up UI based testing for Rails application在为 Rails 应用程序设置基于 UI 的测试时需要帮助
【发布时间】:2011-08-16 15:06:36
【问题描述】:

我正在领导一个基于 Ruby on Rails 开发应用程序的团队。由于应用程序很小,因此自动化测试没有得到太多重视。但最近它的规模开始扩大。我正在认真考虑在团队中执行测试纪律。

对于所有提交的新代码,我希望我的开发人员实现 100% 的代码覆盖率。但问题是他们不愿意为与 UI 相关的更改编写测试。我在网上看到 Selenium 是 UI 测试的解决方案之一。

谁能分享我的博客或教程链接,教我如何设置 Selenium 或其他一些针对 Rails 的自动化 UI 测试。我使用的版本是2.3.8。

【问题讨论】:

    标签: ruby-on-rails testing selenium integration


    【解决方案1】:

    查看两个主流的验收测试框架:

    最好的起点(在我看来):Railscasts。试试beginning with cucumber railscast。

    你的“代码”最终会看起来像

    Feature: pay bill on-line
      In order to reduce the time I spend paying bills
      As a bank customer with a checking account
      I want to pay my bills on-line
    
      Scenario: pay a bill
        Given checking account with $50
        And a payee named Acme
        And an Acme bill for $37
        When I pay the Acme bill
        Then I should have $13 remaining in my checking account
        And the payment of $37 to Acme should be listed in Recent Payments
    

    http://iain.nl/2011/01/cucumber-vs-steak/找到的代码

    【讨论】:

    • 跟进 Jesse 的回答,我们使用 Cucumber 和硒,并且非常满意。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-06
    • 2014-06-25
    • 2013-02-15
    • 2011-02-23
    • 2016-10-22
    • 2014-05-27
    相关资源
    最近更新 更多