angularjs - Protractor removes element from the dom -
i'm stucked in test protractor, because of strange (and not cool) behaviour of template using.
on page load, template has on overlay going hidden after 1 second in way:
$(document).ready(function(config){ settimeout(function(){ $('.page-loading-overlay').addclass('loaded'); $('.load_circle_wrapper').addclass('loaded'); },1000); });
*that feel terrible me (don't want comment this)
anyway test broken because of run faster second , throw error:
unknownerror: unknown error: element not clickable @ point (463, 625). other element receive click: <div class="page-loading-overlay loaded">...</div>
because overlay receive click.
i found workaround setting timeout in test, slow down suite , ci/cd process. , make test code messy.
here code:
it('should test something', function(){ settimeout(function(){ // test code }, 1000); });
i wondering if there way remove element dom in beforeeach
statement, remove overlay don't want test , i'm not worried if broke.
any suggestion?
you can use browser.executescript
execute code in context of browser:
beforeeach(function() { browser.executescript("$('.page-loading-overlay').remove();"); });
Comments
Post a Comment