forked from auth0/auth0-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK-2670] Run playground against Node OIDC Provider and BrowserStack (…
…auth0#265) * Run playground against Node OIDC Provider and BrowserStack * Remove fix cookies
- Loading branch information
1 parent
5d5fc25
commit 199cc27
Showing
10 changed files
with
5,186 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"browsers": [ | ||
{ | ||
"browser": "chrome", | ||
"os": "Windows 10", | ||
"versions": ["latest"] | ||
}, | ||
{ | ||
"browser": "firefox", | ||
"os": "Windows 10", | ||
"versions": ["latest"] | ||
}, | ||
{ | ||
"browser": "edge", | ||
"os": "Windows 10", | ||
"versions": ["latest"] | ||
} | ||
], | ||
"run_settings": { | ||
"cypress_config_file": "./cypress-bs.json", | ||
"cypress-version": "7", | ||
"project_name": "Auth0 React SDK", | ||
"exclude": [], | ||
"parallels": "5", | ||
"npm_dependencies": { | ||
"typescript": "^3.8.3" | ||
}, | ||
"package_config_options": {}, | ||
"headless": true | ||
}, | ||
"connection_settings": { | ||
"local": true, | ||
"local_mode": "always-on" | ||
}, | ||
"disable_usage_reporting": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"baseUrl": "http://127.0.0.1:3000", | ||
"chromeWebSecurity": false, | ||
"viewportWidth": 1000, | ||
"viewportHeight": 1000, | ||
"fixturesFolder": false, | ||
"pluginsFile": false, | ||
"supportFile": false, | ||
"reporter": "junit", | ||
"reporterOptions": { | ||
"mochaFile": "test-results/cypress/junit-[hash].xml" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const EMAIL = 'test'; | ||
const PASSWORD = 'test'; | ||
|
||
if (!EMAIL || !PASSWORD) { | ||
throw new Error( | ||
'You must provide CYPRESS_USER_EMAIL and CYPRESS_USER_PASSWORD environment variables' | ||
); | ||
} | ||
|
||
const loginToNodeOidc = (): void => { | ||
cy.get('input[name=login]').clear().type(EMAIL); | ||
cy.get('input[name=password]').clear().type(PASSWORD); | ||
cy.get('.login-submit').click(); | ||
cy.get('.login-submit').click(); | ||
}; | ||
|
||
const login = (): void => { | ||
return loginToNodeOidc(); | ||
}; | ||
|
||
const fixCookies = () => { | ||
// Temporary fix for https://github.com/cypress-io/cypress/issues/6375 | ||
if (Cypress.isBrowser('firefox')) { | ||
cy.getCookies({ log: false }).then((cookies) => | ||
cookies.forEach((cookie) => cy.clearCookie(cookie.name, { log: false })) | ||
); | ||
cy.log('clearCookies'); | ||
} else { | ||
cy.clearCookies(); | ||
} | ||
}; | ||
|
||
describe('Smoke tests', () => { | ||
afterEach(fixCookies); | ||
|
||
it('do basic login and show user', () => { | ||
cy.visit('/'); | ||
|
||
cy.get('[data-cy=use-node-oidc-provider]').click(); | ||
cy.get('#login').click(); | ||
|
||
login(); | ||
|
||
cy.get('#hello').contains(`Hello, ${EMAIL}!`); | ||
cy.get('#logout').click(); | ||
cy.get('button[name=logout]').click(); | ||
cy.get('#login').should('exist'); | ||
}); | ||
}); |
Oops, something went wrong.