Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Home page', () => {
- const pageObject = new HomePageObject();
- it('should navigate to user profile page when profile button is clicked', async () => {
- // Expect will still automatically await and resolve promises!
- expect(browser.getCurrentUrl()).not.toContain('profile');
- await pageObject.clickOnUserProfile();
- const currentUrl = await browser.getCurrentUrl();
- // Wait until the navigation is completed
- await browser.wait(() => {
- return browser.getCurrentUrl().then((newUrl) => {
- return newUrl !== currentUrl;
- });
- });
- expect(browser.getCurrentUrl()).toContain('profile');
- };
- });
Add Comment
Please, Sign In to add comment