0

如何在登录后检查 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...

天呐!

4

2 回答 2

3
I.seeInCurrentUrl("page=2");

此方法是您检查 URL 是否更改的唯一方法,并且您无需担心使用wait方法,因为此方法在 URL 更改之前不会执行。但是,您需要增加您的方法超时时间,以适应可能由于互联网访问不畅导致的长时间等待。

于 2017-09-27T09:17:12.143 回答
0
I.seeInCurrentUrl('/register');

http://codecept.io/helpers/WebDriverIO/#seeincurrenturl

于 2017-05-24T10:54:56.790 回答