javascript - How to make sure that the element is not visible and proceed with the next conditions in protractor -


i testing element when user selects radiobutton, loading image appear in middle, , invisible after few seconds. when loading image disappears, should show login screen , other conditions. below protractor code:

it('displays small login screen', function () {     var loadpanel = element(by.id("loadingimage"));     var el = loadpanel;     browser.driver.wait(protractor.until.elementisnotvisible(el));     smalllogin = element(by.id('loginscreen'));     browser.wait(ec.presenceof(smalllogin), 30000);     expect(smalllogin.ispresent()).tobe(true);     element(by.id('dropdown')).click(); 

this doesn't work, passes. want loading image hidden , until visible, small login condition should not executed. happens executes small login condition , dropdown click well, while image still visible. thanks.

the expected condition want use invisibilityof:

var ec = protractor.expectedconditions;  // select radiobutton   var loadpanel = element(by.id("loadingimage")); browser.wait(ec.invisibilityof(loadpanel), 5000);  var smalllogin = element(by.id('loginscreen')); expect(browser.iselementpresent(smalllogin)).tobe(true);  element(by.id('dropdown')).click(); 

also, in similar case , while testing internal angular application, remember having set ignoresynchronization true before test , set false after in order catching "loading" state of app.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -