我在我的持续集成服务器(我使用 TeamCity)中运行了一堆单元和集成测试,我想知道为什么我的一个集成测试失败了。
我阅读了这个测试的堆栈跟踪,我发现了以下内容:
Capybara::ElementNotFound: Unable to find css "section.product[data-id=\"484802314\"]"
Stack trace:
test/integration/main_page_test.rb:7:in `pod'
test/integration/main_page_test.rb:99:in `block in <class:MainPageTest>'
test-unit (2.5.0) lib/test/unit/ui/testrunnermediator.rb:44:in `block in run'
test-unit (2.5.0) lib/test/unit/ui/testrunnermediator.rb:89:in `with_listener'
test-unit (2.5.0) lib/test/unit/ui/testrunnermediator.rb:39:in `run'
test-unit (2.5.0) lib/test/unit/autorunner.rb:378:in `block in run'
test-unit (2.5.0) lib/test/unit/autorunner.rb:434:in `change_work_directory'
test-unit (2.5.0) lib/test/unit/autorunner.rb:377:in `run'
test-unit (2.5.0) lib/test/unit/autorunner.rb:58:in `run'
开发人员声称此集成测试在他们的机器上完美运行,那么,我该如何解决这个问题?
更新:
另一个失败的测试是这个,我不确定是否相关或导致另一个测试失败:
MainPageTest.test_Pod_are_created_correctly:
Wrong number of product pods generated.
<false> is not true.
Stack trace:
test/integration/main_page_test.rb:63:in `block in <class:MainPageTest>'
test-unit (2.5.0) lib/test/unit/ui/testrunnermediator.rb:44:in `block in run'
test-unit (2.5.0) lib/test/unit/ui/testrunnermediator.rb:89:in `with_listener'
test-unit (2.5.0) lib/test/unit/ui/testrunnermediator.rb:39:in `run'
test-unit (2.5.0) lib/test/unit/autorunner.rb:378:in `block in run'
test-unit (2.5.0) lib/test/unit/autorunner.rb:434:in `change_work_directory'
test-unit (2.5.0) lib/test/unit/autorunner.rb:377:in `run'
test-unit (2.5.0) lib/test/unit/autorunner.rb:58:in `run'