如何使量角器在Chrome上运行

时间:2019-06-03 07:24:15

标签: angular protractor automated-tests

我有一个量角器问题,我在Firefox上运行了一个测试并且运行良好,但是当我更改配置以在chrome上运行时,该测试被冻结。我的测试页正在加载,但是自动测试什么也没做。

这是我的朋友:

exports.config = {
  directConnect: true,
  allScriptsTimeout: 200000000,


  capabilities: {
    //  'browserName': 'firefox'
     'browserName': 'chrome'
  },


  framework: 'jasmine2',
  directConnect: true,

  getPageTimeout: 1000000000,

  specs: [ 

  'testLoginFunc.js'

    ],
}

这是我的测试:

describe('WebApp-Test : test the login component ->', function() {

  //exoired pass: 4904 id: 0QhK2S5f9llF
  // pass: 9211 id: fOTxM7cYcJmk

  beforeEach (function () {
    // browser.restart(); //loads the page
    browser.driver.manage().deleteAllCookies();

    // Set the browser page seize
    browser.driver.manage().window().setSize(widthDesktop, heightDesktop);
    browser.ignoreSynchronization = true;
    browser.waitForAngularEnabled(false);
    browser.driver.get('https://share.tracemytrack.com/webapp');
  });


  it('test the login functionality when the session is expired', function() {
    console.log("\nTEST_LOGIN: test the login functionality when the session is expired");
    var EC = protractor.ExpectedConditions;
    var sessionFieldVisibile = element(by.css('#sessionfield'));
    browser.wait(EC.visibilityOf(sessionFieldVisibile), 11000);
    element(by.css('#sessionfield')).sendKeys('0QhK2S5f9llF');
    var loginButtonSess = element(by.buttonText('Next'));
    browser.wait(EC.visibilityOf(loginButtonSess), 12000);
    loginButtonSess.click();

    element(by.css('#passwordfield')).sendKeys('4904');
    var loginButtonPass = element(by.buttonText('Next'));
    browser.wait(EC.visibilityOf(loginButtonPass), 13000);
    loginButtonPass.click();
    browser.sleep(6000);



    //Check if the message appears.
    expect(element(by.css('strong')).getText()).toBe('Wrong Password!');
    browser.restart();
  });
});

在此测试中,我尝试进行登录,并在Firefox上正常运行,但在chrome中,用户名运行良好,但是在尝试插入密码时,测试冻结了

0 个答案:

没有答案