需要帮助为 Rails 应用程序设置基于 UI 的测试

发布于 2024-11-04 06:34:59 字数 272 浏览 4 评论 0原文

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

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

任何人都可以与我分享博客或教程的链接,教我如何为 Rails 设置 Selenium 或其他一些自动化 UI 测试。我使用的版本是2.3.8。

I am leading a team which develops application based on Ruby on Rails. Since the application was small, automated testing was not given much importance. But lately it has started growing in size. I am seriously thinking of enforcing the testing discipline in the team.

For all the new code that is being committed, I want my developers to do a 100% code coverage. But the problem is that they are resistant to write tests for UI related changes. I read online that Selenium is one of the solutions for UI testing.

Can anyone share me a link to blog or tutorial which teaches me how to set up Selenium or some other automated UI testing for Rails. The version I use is 2.3.8.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不如归去 2024-11-11 06:34:59

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

最好的起点(在我看来):Railscasts。尝试从 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/黄瓜VS牛排/

Checkout the two mainstream Acceptance testing frameworks:

Best place to start (in my opinion): Railscasts. Try the beginning with cucumber railscast.

Your "code" will end up looking like

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

Code found on http://iain.nl/2011/01/cucumber-vs-steak/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文