You need to do 2 things
- Set
browser.ignoreSynchronization = true; before trying to read the third-party URL, so the browser does not wait (and therefore requires) Angular promises for permission on the page (and set it to false afterwards); - Use
browser.getCurrentUrl() as opposed to browser.getLocationAbsUrl() , since the former simply uses the simple webdriver method to read the URL and not access it through Angular.
The following should work:
it('should go to 3d party service when i click "auth" button' , function() { element(by.id('files-services-icon')).click(); element(by.id('box-vendor-menu-item')).click(); browser.ignoreSynchronization = true; expect(browser.getCurrentUrl()).toContain('https://app.box.com/api/oauth2/authorize'); browser.ignoreSynchronization = false; });
source share