Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug session #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions e2e-tests/custom-login/specs/custom-login-flow-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,35 @@ describe('Custom Login Flow', () => {
});

it('can login with Okta as the IDP using custom signin page', async () => {
console.log("Loading the app login page");
browser.get(appRoot);
loginHomePage.waitForPageLoad();

console.log("Loaded the app login page");

loginHomePage.clickLoginButton();
customSignInPage.waitForPageLoad();


console.log("Loaded the custom login page");

// Verify that current domain hasn't changed to okta-hosted login, rather a local custom login page
const urlProperties = url.parse(process.env.ISSUER);
expect(browser.getCurrentUrl()).not.toContain(urlProperties.host);
expect(browser.getCurrentUrl()).toContain(appRoot);

console.log("Expectations met");
console.log("Waiting to login");

console.log(browser.params.login.username);
console.log(browser.params.login.password);

await customSignInPage.login(browser.params.login.username, browser.params.login.password);
authenticatedHomePage.waitForPageLoad();
authenticatedHomePage.waitForWelcomeTextToLoad();
expect(authenticatedHomePage.getUIText()).toContain('Welcome');

console.log("Loaded authenticatedHomePage");
// authenticatedHomePage.waitForWelcomeTextToLoad();
// expect(authenticatedHomePage.getUIText()).toContain('Welcome');
});

it('can access user profile', async () => {
Expand All @@ -65,7 +79,7 @@ describe('Custom Login Flow', () => {
expect(profile.getEmailClaim()).toBe(browser.params.login.email);
});

it('can access resource server messages after login', async () => {
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;
Expand All @@ -75,7 +89,7 @@ describe('Custom Login Flow', () => {
expect(messagesPage.getMessage()).toBeTruthy();
});

it('can log the user out', async () => {
xit('can log the user out', async () => {
browser.get(appRoot);
authenticatedHomePage.waitForPageLoad();
authenticatedHomePage.logout();
Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/page-objects/custom-signin-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class CustomSignInPage {
login(username, password) {
this.usernameInput.sendKeys(username);
this.passwordInput.sendKeys(password);
console.log("Clicking submit");
return this.submitButton.click();
console.log("Clicked submit")
}

urlContains(str) {
Expand Down