Guest User

Untitled

a guest
Apr 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. describe('Home page', () => {
  2. const pageObject = new HomePageObject();
  3.  
  4. it('should navigate to user profile page when profile button is clicked', async () => {
  5. // Expect will still automatically await and resolve promises!
  6. expect(browser.getCurrentUrl()).not.toContain('profile');
  7. await pageObject.clickOnUserProfile();
  8.  
  9. const currentUrl = await browser.getCurrentUrl();
  10.  
  11. // Wait until the navigation is completed
  12. await browser.wait(() => {
  13. return browser.getCurrentUrl().then((newUrl) => {
  14. return newUrl !== currentUrl;
  15. });
  16. });
  17.  
  18. expect(browser.getCurrentUrl()).toContain('profile');
  19. };
  20. });
Add Comment
Please, Sign In to add comment