登录后如何查看url变化
How to check url change after login
登录后如何检查URL是否发生变化才能知道登录成功....
'use strict';
let I;
module.exports = {
_init() {
I = actor();
},
fields: {
email: '[bo-email]',
password: '[bo-password]'
},
submitButton:'button',
sendForm(email, password,utills) {
I.fillField(this.fields.email, email);
I.fillField(this.fields.password, password);
I.click(this.submitButton);
//how to check if navigation was success...
谢谢!
I.seeInCurrentUrl('/register');
I.seeInCurrentUrl("page=2");
此方法是您检查是否有 URL 更改的唯一方法,您无需费心使用 wait
方法,因为此方法只有在 URL 改变。但是,您需要增加方法超时时间,以适应可能由于互联网访问不佳而导致的长时间等待。
登录后如何检查URL是否发生变化才能知道登录成功....
'use strict';
let I;
module.exports = {
_init() {
I = actor();
},
fields: {
email: '[bo-email]',
password: '[bo-password]'
},
submitButton:'button',
sendForm(email, password,utills) {
I.fillField(this.fields.email, email);
I.fillField(this.fields.password, password);
I.click(this.submitButton);
//how to check if navigation was success...
谢谢!
I.seeInCurrentUrl('/register');
I.seeInCurrentUrl("page=2");
此方法是您检查是否有 URL 更改的唯一方法,您无需费心使用 wait
方法,因为此方法只有在 URL 改变。但是,您需要增加方法超时时间,以适应可能由于互联网访问不佳而导致的长时间等待。