Simple protractor test for isElementPresent failing with unsupported locator strategy

后端 未结 4 2046
深忆病人
深忆病人 2021-02-09 22:30

My test:

it(\'should allow login\', function() {
  browser.get(\'index.html\');

  $(\'#username\').sendKeys(\'administrator\');
  $(\'#password\').sendKeys(\'pa         


        
4条回答
  •  心在旅途
    2021-02-09 23:21

    Using the latest Protractor build, you can shorten the above answer to the following:

    expect(element(by.css('#logout')).isPresent()).toBeTruthy();
    

    This way you do not have to perform the browser.wait and you reduce the number of calls to isElementPresent.

提交回复
热议问题