What is the correct way to use Protractor with SystemJS?

This issue should also apply to requirejs.

Features:

  • protractor
  • Download SystemJS ES6 BabelJS Stitched System Modules
  • Cucumber.js
  • Chai, chai-as-promised

The reason I ask is because I only have a couple of basic cucumber tests, and sometimes I get errors (inconsistently) related to timeouts or awaiting synchronization with the page, etc. At the time when my tests pass and no timeout errors are issued, there is no data on these problems. Basically just a bunch of SO and github questions.

What is the correct way to use Protractor with SystemJS?

+8
javascript angularjs protractor cucumber cucumberjs
source share
1 answer

This is not like problems specific to SystemJS.

Rather, in my experience, they are largely the joys of working with the Transporter.

Things you can do to alleviate problems include:

  • Add browser.manage().timeouts().implicitlyWait(5000); before starting any tests. Maybe in your protractor method onPrepare config
  • Try browser.waitForAngular();
    • Theoretically, he is called internally in the Protractor, but something seems necessary to him ..?
  • Wait for the elements to be clickable before clicking on them: browser.wait(protractor.ExpectedConditions.elementToBeClickable(elm), 2000); elm.click();

You may also be interested to know that there is a new project that hopes to avoid all errors using the selenium-based test framework. Not using selenium at all. He claims to be much simpler, faster, and less error prone: https://www.cypress.io/

+1
source share

All Articles