Reputation: 2186
I use protractor with Browserstack.exe for e2e (UI) testing.
I have to check authorization proccess. It goes in this way:
I read that for testing separate login page we have to use browser.ignoreSynchronization = true;
Sometimes it works, some - not. I don't understand why and what depends on this.
I have this error while run protractor: Expected 'http://localhost:8001/app/#/login' to contain 'domen.auth0.com'.
my code :
describe('[domain.reports]', function () {
beforeAll(function() {
// it makes protractor not wait for Angular promises
// for testing separate login page.
browser.ignoreSynchronization = true;
});
beforeEach(function () {
browser.wait(browser.get('#/login'), 5000);
expect(browser.getCurrentUrl()).toContain('domain.auth0.com');
});
it('should automatically redirect to /samples when location hash/fragment is empty', function () {
var EC = protractor.ExpectedConditions;
var el = element(by.css('.auth0-lock-submit'));
browser.wait(EC.visibilityOf(el), 10000);
protractor.loginHelpers.loginToPage('[email protected]', 'Qazxsw123456');
protractor.waitHelpers.waitForUrlToBeChanged("/samples");
//browser.wait(browser.get('#/samples'), 5000);
expect(browser.getCurrentUrl()).toMatch("/samples");
browser.get('#/api');
expect(browser.getCurrentUrl()).not.toContain("/api");
});
});
It works at another scenarious...
Thank you in advise for any thoughts!
Upvotes: 1
Views: 651