我正在尝试使用Serenity-Js框架工作自动化[https://www.predix-ui.com/#/home][1]。 My Given包含打开URL的步骤 当part包含要在左侧菜单中单击 px-accordin 组件中的操作项时。
以下是我的功能文件
Scenario: To identify px-accordoin
Given access to predix ui
When i click on px-accordion
Then i shall automate the expand and collapse

以下是我的步骤文件
export =
function identiyPXComponents() {
this.setDefaultTimeout(120 * 1000);
const actor = Actor.named("James").whoCan(BrowseTheWeb.using(protractor.browser));
const stage = serenity.callToStageFor({
actor: (name) => Actor.named(name).whoCan(BrowseTheWeb.using(protractor.browser)),
});
this.Given(/^access to predix ui$/, function () {
return stage.theActorCalled("James").attemptsTo(
Start.openApplication()
);
});
this.When(/^i click on px-accordion$/, function () {
return stage.theActorInTheSpotlight().attemptsTo(PXAccordinComponent.pxAccordinComponent()
);
});
this.Then(/^i shall automate the expand and collapse$/, function () {
return expect(actor.toSee(Text.of(PXComponentsElements.headerText))).to.eventually.equal("Date And Time");
});
};

我看到的错误是: 鉴于它失败了。但我看到URL打开,但随后出现以下错误:
Error: Error while running testForAngular: asynchronous script timeout: result was not received in 110 seconds
(Session info: chrome=60.0.3112.113)
(Driver info: chromedriver=2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 110.85 seconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'C02PQD87G8WP', ip: '3.204.57.13', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061), userDataDir=/var/folders/z8/djc07ncj00v81002xs1wh6sw0000gn/T/.org.chromium.Chromium.IHsjtp}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.113, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
Session ID: 0a67b882a3d3465cc91eb92ef414897d

无法继续进行,因为代码永远不会导航到 部分时。我已经尝试过增加时间。
我能够使用普通的量角器 - 黄瓜 - 打字稿框架自动化同一个网站。但不使用Serenity-Js。 请提供您的见解。