0

我正在运行带有 19 行值的示例表的 Serenity Jbehave 脚本,但脚本仅执行示例表中存在的 7 行,并在执行第 8 行时给出如下异常

来自控制台的堆栈跟踪是:

Example: {workspaceName=admin, menuName=Admin, menuOption=Parameter Maintenance, portletTitle=Parameter Maintenance}
Given login to CMS as colinw and colinw
Then I Navigate to admin Workspace
When I Select Parameter Maintenance Option from Admin Menu
Then I Verify Portlet Parameter Maintenance is Displayed
Then I Close the Portlet Parameter Maintenance
Then logout from CMS

Example: {workspaceName=admin, menuName=Admin, menuOption=Product Maintenance, portletTitle=Product Type}
Story stories/smoke/ShakeDownScript.story duration of 301 seconds has exceeded timeout of 300 seconds

(AfterStories)
[pool-2-thread-1] INFO net.thucydides.core.webdriver.SystemPropertiesConfiguration - project.build.directory : null
[pool-2-thread-1] INFO net.thucydides.core.webdriver.SystemPropertiesConfiguration - project.reporting.OutputDirectory : null
[pool-2-thread-1] INFO net.thucydides.core.webdriver.SystemPropertiesConfiguration - OutputDirectory : C:\WCG Automation\CMS\CMS_Automation\target\site\serenity
Given login to CMS as colinw and colinw
Then I Navigate to admin Workspace

Generating reports view to 'C:\WCG Automation\CMS\CMS_Automation\target\jbehave' using formats '[stats, console, html, xml, serenityreporter, junitscenarioreporter]' and view properties '{decorateNonHtml=true}'
Reports view generated with 0 stories (of which 0 pending) containing 0 scenarios (of which 0 pending)
Tests run: 47, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 313.246 sec <<< FAILURE! - in wcg.cms.CMSTestSuite
wcg.cms.CMSTestSuite  Time elapsed: 3.651 sec  <<< ERROR!
java.lang.RuntimeException:org.jbehave.core.embedder.Embedder$RunningStoriesFailed: Failures in running stories: 
stories/smoke/ShakeDownScript.story: java.util.concurrent.CancellationException
at org.jbehave.core.embedder.Embedder$ThrowingRunningStoriesFailed.handleFailures(Embedder.java:553)
at org.jbehave.core.embedder.Embedder.handleFailures(Embedder.java:238)
at org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:216)
at net.serenitybdd.jbehave.embedders.ExtendedEmbedder.runStoriesAsPaths(ExtendedEmbedder.java:60)
at net.serenitybdd.jbehave.runners.SerenityReportingRunner.run(SerenityReportingRunner.java:175)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)


Results :

Tests in error: 
  JUnit4Provider.invoke:128->executeTestSet:153->executeWithRerun:173->execute:283 » Runtime

Tests run: 47, Failures: 0, Errors: 1, Skipped: 0

[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! The file encoding for reports output files should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO] 
[INFO] --- serenity-maven-plugin:1.1.36:aggregate (serenity-reports) @ CMS_Automation ---
[INFO] LOADING LOCAL PROPERTIES FROM C:\WCG Automation\CMS\CMS_Automation\serenity.properties 
[INFO] LOADING LOCAL PROPERTIES FROM C:\WCG Automation\CMS\CMS_Automation\serenity.properties 
[INFO] LOADING LOCAL PROPERTIES FROM C:\WCG Automation\CMS\CMS_Automation\serenity.properties 
[INFO] webdriver.base.url=http://nssrvdfsdev01/calms2cms/
[INFO] serenity.project.name=Automation Testing 
[INFO] webdriver.timeouts.implicitlywait=60000
[INFO] project.build.directory : C:\WCG Automation\CMS\CMS_Automation
[INFO] project.reporting.OutputDirectory : null
[INFO] OutputDirectory : C:\WCG Automation\CMS\CMS_Automation\target\site\serenity
[INFO] current_project.base.dir: C:\WCG Automation\CMS\CMS_Automation
Generating HTML Story Reports from C:\WCG     Automation\CMS\CMS_Automation\target\site\serenity
Generating HTML Story Reports to C:\WCG Automation\CMS\CMS_Automation\target\site\serenity
[INFO] project.build.directory : C:\WCG Automation\CMS\CMS_Automation
[INFO] project.reporting.OutputDirectory : null
[INFO] OutputDirectory : C:\WCG Automation\CMS\CMS_Automation\target\site\serenity
Merging requirements = [Requirement{name='Smoke', type='feature' parent = 'null', cardNumber='null'}]
Merging requirements = []
Merged requirements set = [Requirement{name='Smoke', type='feature' parent = 'null', cardNumber='null'}]
[INFO] REPORTS GENERATED IN C:\WCG Automation\CMS\CMS_Automation\target\site\serenity
[INFO] REPORT HOME PAGE: C:\WCG Automation\CMS\CMS_Automation\target\site\serenity\index.html
[INFO] Generating release reports for: []
GENERATE CUSTOM REPORTS
[INFO] 
[INFO] --- maven-failsafe-plugin:2.18.1:verify (default) @ CMS_Automation ---
[INFO] Failsafe report directory: C:\WCG Automation\CMS\CMS_Automation\target\failsafe-reports
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! The file encoding for reports output files   should be provided by the POM property ${project.reporting.outputEncoding}.
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Skipping Sample Serenity project using JBehave and WebDriver
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:25 min
[INFO] Finished at: 2016-08-22T17:26:18+05:30
[INFO] Final Memory: 37M/416M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.18.1:verify (default) on project CMS_Automation: There are test failures.
[ERROR] 
[ERROR] Please refer to C:\WCG Automation\CMS\CMS_Automation\target\failsafe-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

故事执行似乎超过了 300 秒的超时时间。有什么办法可以让我们将框架中的 300 秒重置为 600 秒

4

1 回答 1

0

解决方案非常简单。

我在这里找到了一个相关的问题和答案。

您可以使用额外的参数运行测试,例如:

mvn clean verify -DstoryTimeoutInSecs=600

或者在文件中放置一个属性serenity.properties(如果有的话,应该在项目的根目录中),如下所示:

story.timeout.in.secs=600
于 2016-09-29T14:44:06.147 回答