Skip to content

Commit

Permalink
Testing internet access
Browse files Browse the repository at this point in the history
  • Loading branch information
vijetmahabaleshwar-okta committed Apr 30, 2019
1 parent 80d0352 commit f6ae6c1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
52 changes: 29 additions & 23 deletions e2e-tests/okta-hosted-login/specs/okta-hosted-login-flow-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ describe('Okta Hosted Login Flow', () => {
browser.ignoreSynchronization = true;
});

// it('can access internet', async() => {
// browser.get("https://lambdatest.com");
// element(by.css('p.home-btn > a.home-cta')).click();
// expect(browser.getTitle()).toEqual('Sign up for free | Cross Browser Testing Tool | LambdaTest - LambdaTest');
// });

it('can login with Okta as the IDP', async () => {
browser.get(appRoot);
console.log(`Loading home page ${appRoot}...`);
Expand Down Expand Up @@ -63,29 +69,29 @@ describe('Okta Hosted Login Flow', () => {
authenticatedHomePage.waitForPageLoad();
});

it('can access user profile', async () => {
authenticatedHomePage.viewProfile();
profile.waitForPageLoad();
expect(profile.getEmailClaim()).toBe(browser.params.login.email);
});
// xit('can access user profile', async () => {
// authenticatedHomePage.viewProfile();
// profile.waitForPageLoad();
// expect(profile.getEmailClaim()).toBe(browser.params.login.email);
// });

it('can access resource server messages after login', async () => {
// If it's not implicit flow, don't test messages resource server
if (process.env.TEST_TYPE !== 'implicit') {
return;
}
authenticatedHomePage.viewMessages();
messagesPage.waitForPageLoad();
expect(messagesPage.getMessage()).toBeTruthy();
});
// xit('can access resource server messages after login', async () => {
// // If it's not implicit flow, don't test messages resource server
// if (process.env.TEST_TYPE !== 'implicit') {
// return;
// }
// authenticatedHomePage.viewMessages();
// messagesPage.waitForPageLoad();
// expect(messagesPage.getMessage()).toBeTruthy();
// });

it('can log the user out', async () => {
browser.get(appRoot);
console.log('Waiting for home page...');
authenticatedHomePage.waitForPageLoad();
console.log('Loaded authenticated home page...');
authenticatedHomePage.logout();
console.log('After logout click...');
loginHomePage.waitForPageLoad();
});
// xit('can log the user out', async () => {
// browser.get(appRoot);
// console.log('Waiting for home page...');
// authenticatedHomePage.waitForPageLoad();
// console.log('Loaded authenticated home page...');
// authenticatedHomePage.logout();
// console.log('After logout click...');
// loginHomePage.waitForPageLoad();
// });
});
6 changes: 3 additions & 3 deletions e2e-tests/page-objects/shared/login-home-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class LoginHomePage {

waitForPageLoad() {
browser.sleep(1000);
browser.getPageSource().then(function (res) {
console.log('AFTER CLICKING LOGOUT -' + res);
});
// browser.getPageSource().then(function (res) {
// console.log('AFTER CLICKING LOGOUT -' + res);
// });
return util.wait(this.$loginButton);
}

Expand Down

0 comments on commit f6ae6c1

Please sign in to comment.