2

我有以下代码。看起来我的测试通过了,但我的控制台中有大量错误。这是怎么回事?我的测试是否具有不确定性并正在重新运行?如果是这样,我该如何防止错误?

登录功能:

Feature: User authentication

  As a user
  I want to be able to login
  So that I can have all the good stuff that comes with user accounts

  Background:
    Given I am signed out

  Scenario: A user can sign up with valid information
    Given I am on the home page
    When I open the sign up modal
    And I enter my desired authentication information
    Then I should be logged in

step_definitions.js

this.When(/^I open the sign up modal$/, function (callback) {
      // Write code here that turns the phrase above into concrete actions
      helper.world.browser.
        click('[data-ion-modal="signup"]').
        waitForVisible('.#signup-form', 2000).
        call(callback);
    });

    this.When(/^I enter my desired authentication information$/, function (callback) {
      // Write code here that turns the phrase above into concrete actions
      helper.world.browser.
        waitForExist('#signup-form', 2000).
        waitForVisible('#signup-form').
        setValue('#signup-email', 'newuser@test.com').
        setValue('#signup-password', 'password').
        submitForm('#signup-form').
        call(callback);
    });

    this.Then(/^I should be logged in$/, function (callback) {
      // Write code here that turns the phrase above into concrete actions
      helper.world.browser.
        waitForExist('.tabs', 2000).
        waitForVisible('.tabs').
        call(callback);
    });

在此处输入图像描述

4

1 回答 1

0

这看起来像是流星黄瓜回归。我正在重写黄瓜,希望这个问题在下一个版本中消失。

于 2015-04-03T19:39:41.220 回答