我是 Serenity 的第一步,我已经被这个问题困住了 2 天。
我有:
- 导航到登录页面
- 写用户名
- 写密码
- 点击登录按钮
然后,在网络从登录页面更改为欢迎页面的步骤中,我想验证是否存在欢迎页面的按钮之一。
在从登录页面到欢迎页面的过渡中,会出现一个加载启动画面,然后在几秒钟后出现欢迎页面。
This is my scenario
Given that Sarah navigates to the access page
When she enters email as xxxx@yyyyy.com
And she enters password as zzzzzz
And she clicks the button Login
Then she should navigates to the Empresa JMM Enterprise welcome page
我在最后一步(然后)中遇到了错误。
这是我单击登录按钮的步骤的代码:
this.When(/^prueba pulsar boton (.*?)$/, function (buttonText: string) {
return this.stage.theActorInTheSpotlight().attemptsTo(
ClickIniciarSesion.click(buttonText)
)
});
这是我验证按钮是否存在的代码
this.Then(/^s?he should navigates to (.*?) Enterprise welcome page$/, function (enterpriseName: string) {
return this.stage.theActorInTheSpotlight().attemptsTo(
See.if(WebElement.of(Header.WelcomeButton), el => expect(el).to.eventually.be.displayed)
)
我看到超时前的执行和秒我看到加载的欢迎页面和按钮。我不知道为什么错误是超时而不是驱动程序找不到元素。