Skip to content

Commit

Permalink
resolve merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrpravosudko-okta committed Sep 6, 2022
1 parent 59ad359 commit 53fc7de
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions test/e2e/specs/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,36 +81,28 @@ describe('Basic login redirect', () => {
const path = '//okta.com'
const privatePage = new ProtectedPage(path);
await privatePage.load();

// we're not logged in, so we should redirect
// we’re not logged in, so we should redirect
const signInPage = new OktaSignInPage();
await signInPage.waitUntilVisible();
await signInPage.signIn({
username: constants.USERNAME,
password: constants.PASSWORD
});

// wait for protected page to appear with contents
// NOTE: may see failure here if open redirect occurs (see OKTA-499372)
await privatePage.waitUntilVisible(constants.BASE_URI + path.slice(1)); // leading '/' will be stripped off

expect(privatePage.getBodyText()).toContain('sub');

await privatePage.waitUntilVisible(constants.BASE_URI + path.slice(1)); // leading ‘/’ will be stripped off
expect(await privatePage.getBodyText()).toContain('sub');
// Default response_type of library should contain an accessToken and idToken
expect(privatePage.getBodyText()).toContain('access_token');
expect(privatePage.getBodyText()).toContain('id_token');

expect(await privatePage.getBodyText()).toContain('access_token');
expect(await privatePage.getBodyText()).toContain('id_token');
// navigate to home page
const homePage = new HomePage();
await homePage.load();
await homePage.waitUntilVisible();

expect(homePage.getBodyText()).toContain('Welcome home');

expect(await homePage.getBodyText()).toContain('Welcome home');
// navigate to Okta logout and follow redirects
await homePage.performLogout();
await homePage.waitUntilVisible(); // after all redirects

expect(browser.getPageSource()).not.toContain('Welcome home');
expect(await browser.getPageSource()).not.toContain('Welcome home');
});
});

0 comments on commit 53fc7de

Please sign in to comment.