-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
2,896 additions
and
192 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,5 @@ testem.log | |
# System files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
*.env.json |
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,5 @@ | ||
{ | ||
"E2E_DOMAIN": "dev-06bzs1cu.us.auth0.com", | ||
"E2E_USERNAME": "mraible", | ||
"E2E_PASSWORD": "@qaG7x2qqdD8BhVxGmEU" | ||
} |
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 |
---|---|---|
@@ -1,43 +1,16 @@ | ||
// *********************************************** | ||
// This example namespace declaration will help | ||
// with Intellisense and code completion in your | ||
// IDE or Text Editor. | ||
// *********************************************** | ||
// declare namespace Cypress { | ||
// interface Chainable<Subject = any> { | ||
// customCommand(param: any): typeof customCommand; | ||
// } | ||
// } | ||
// | ||
// function customCommand(param: any): void { | ||
// console.warn(param); | ||
// } | ||
// | ||
// NOTE: You can use it like so: | ||
// Cypress.Commands.add('customCommand', customCommand); | ||
// | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add("login", (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) | ||
Cypress.Commands.add('signIn', (username, password) => { | ||
Cypress.log({ | ||
message: [`🔐 Authenticating: ${username}`], | ||
autoEnd: false, | ||
}) | ||
|
||
cy.origin(Cypress.env('E2E_DOMAIN'), {args: {username, password}}, | ||
({username, password}) => { | ||
cy.get('input[name=username]').type(username); | ||
cy.get('input[name=password]').type(password, {log: false}); | ||
cy.get('button[type=submit]').first().click(); | ||
} | ||
) | ||
|
||
cy.url().should('equal', 'http://localhost:4200/home') | ||
}) |
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
// *********************************************************** | ||
// This example support/e2e.ts is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
import './commands'; | ||
|
||
// When a command from ./commands is ready to use, import with `import './commands'` syntax | ||
// import './commands'; | ||
beforeEach(() => { | ||
cy.visit('/') | ||
cy.get('#login').click() | ||
cy.signIn( | ||
Cypress.env('E2E_USERNAME'), | ||
Cypress.env('E2E_PASSWORD') | ||
) | ||
}) | ||
|
||
afterEach(() => { | ||
cy.visit('/') | ||
cy.get('#logout').click() | ||
}) |
Oops, something went wrong.