javascript - Protractor tests inconsistently passing / failing for AngularJS app -


My opponent e2e tests are passing incompatible and are unsuccessful.

It seems that this may be due to asynchronous JavaScript, as discussed here:

However, here it is reported that the protractor test Automatically performs indexed / synchronized:

My test script:

  Description ('login', work () {var ptor ; BeforeEach (function () {browser.get ('https://127.0.0.1:8443'); ptor = protractor.getInstance (); element (by.id ('splash')) Click (); Browser .inersynchronization = true; // & lt; - sp In order to proceed with the flash screen)); ('With correct email and password', function () {first (each function () {element (By.id ('email')) SendKeys ('admin@email.com'); element (by.id ( 'Password')). SendKeys ('adminpassword'); element (by.id ('loginbutton') () () ();)) Click ();}) after (each function () {ptor.findElement (By.id ('logout')). Then (function (elem) {elem.click ();});}); ('Warning does not show', function () {// & lt; - sometimes passes, sometimes fails (browser .implement presentant (CSS by 'alert-danger')). Tobe ( wrong);}) ; This ('Change / Path to Administrator', function () {// & lt; - sometimes passes, sometimes fails (Brother.wser.getCurrentUrl ()) toMatch (/ \ admin /) ;}); }); });   

In the above two tests, either both tests will pass with these messages, or one / both tests will fail

  Failures: 1) login alert with correct email and password does not show warning message: NoSuchElementError: There is no such element ... ==== async function ==== WebDriver.findElement (by ID ("Logout")) ...   

or

  Failures: 1) Log in with correct email and password changes / route messaging for administrator : NoSuchElementError: There is no such element ... ==== async function ==== WebDriver.findElement (By.id ("logout")) ...   

Ideas / Very appreciative help

I was able to solve the problem based on:

  • Change Browser ptor Receive, as here is the answer:

  • Comment about the unseen synchronization here being an example variable, and Chan Ging Browser .ignoreSynchronization = true p Tor .ignoreSynchronization = true:

  • Answer this question about using

    here. Then ():

    As told by the comment on the basic question, I am testing a pure angular app that is I think that the net protractor (no web driver calls) is there. I know that ptor.ignoreSynchronization = true should not be necessary in this case, but for some reason, the button click button is not being processed without this setting.

    My new tip:

      Description ('login', function) (first) (ex (function () {ptor = protractor.getInstance (); ptor.ignoreSynchronization = True; ptor.waitForAngular (); ptor.get ('https: / / 127.0.0.1:8443'); ptor.findElement (by.id ('splash'). Then (function (AMM) {elem.click ();});}); (With 'correct email and password', function () {first (function () {ptor.findElement (by.id ('email')) Then (function (AMM) { Elem.sendKeys ('admin@email.com');}); ptor. (Admin ('password')). Then (function (amm) {elem.sendKeys ('adminpassword');}); ptor.findElement By.id ('loginbutton'). Then (after the function (Elem.click ();});}) (each function () {Ptor.findElement (by.id ('logout')). Then (function (amm) {elem.click ();});}); ('does not show warning', function () {hope (ptor .isElementPresent (by.css) (); Tobey (wrong).}}; (Change for 'path / admin', function () {hopefully (ptor.getCurrentUrl)). ToMatch (/ \ / Admin /);});});});    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -