generated from nimblehq/git-template
-
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.
[#21] Add artifact upload to test workflow for cypress
- Loading branch information
1 parent
34943f6
commit 2e47cf0
Showing
2 changed files
with
40 additions
and
34 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 |
---|---|---|
|
@@ -9,24 +9,24 @@ describe('User Authentication', () => { | |
|
||
// TODO: The below test fail on CI/CD with the use of Intercept | ||
|
||
// context('given valid credentials', () => { | ||
// it('redirects to the home page', () => { | ||
// cy.intercept('POST', '/oauth/token/', { | ||
// statusCode: 200, | ||
// fixture: 'Authentication/valid-credentials.json', | ||
// }); | ||
context('given valid credentials', () => { | ||
it('redirects to the home page', () => { | ||
cy.intercept('POST', '/oauth/token/', { | ||
statusCode: 200, | ||
fixture: 'Authentication/valid-credentials.json', | ||
}); | ||
|
||
// cy.visit('/login'); | ||
cy.visit('/login'); | ||
|
||
// cy.get('input[name=email]').type('[email protected]'); | ||
// cy.get('input[name=password]').type('12345678'); | ||
// cy.get('button[type="submit"]').click(); | ||
cy.get('input[name=email]').type('[email protected]'); | ||
cy.get('input[name=password]').type('12345678'); | ||
cy.get('button[type="submit"]').click(); | ||
|
||
// cy.location().should((location) => { | ||
// expect(location.pathname).to.eq('/'); | ||
// }); | ||
// }); | ||
// }); | ||
cy.location().should((location) => { | ||
expect(location.pathname).to.eq('/'); | ||
}); | ||
}); | ||
}); | ||
|
||
context('given NO credentials entered', () => { | ||
it('shows field validation errors', () => { | ||
|
@@ -45,28 +45,28 @@ describe('User Authentication', () => { | |
|
||
// TODO: The below test fail on CI/CD with the use of Intercept | ||
|
||
// context('given INVALID credentials', () => { | ||
// it('shows login error', () => { | ||
// cy.intercept('POST', '/oauth/token/', { | ||
// statusCode: 400, | ||
// fixture: 'Authentication/invalid-credentials.json', | ||
// }); | ||
context('given INVALID credentials', () => { | ||
it('shows login error', () => { | ||
cy.intercept('POST', '/oauth/token/', { | ||
statusCode: 400, | ||
fixture: 'Authentication/invalid-credentials.json', | ||
}); | ||
|
||
// cy.visit('/login'); | ||
cy.visit('/login'); | ||
|
||
// cy.get('input[name=email]').type('[email protected]'); | ||
// cy.get('input[name=password]').type('password123'); | ||
// cy.get('button[type="submit"]').click(); | ||
cy.get('input[name=email]').type('[email protected]'); | ||
cy.get('input[name=password]').type('password123'); | ||
cy.get('button[type="submit"]').click(); | ||
|
||
// cy.location().should((location) => { | ||
// expect(location.pathname).to.eq('/login'); | ||
// }); | ||
cy.location().should((location) => { | ||
expect(location.pathname).to.eq('/login'); | ||
}); | ||
|
||
// cy.get('.errors').should('be.visible'); | ||
cy.get('.errors').should('be.visible'); | ||
|
||
// cy.get('.errors').within(() => { | ||
// cy.findByText('Your email or password is incorrect. Please try again.').should('exist'); | ||
// }); | ||
// }); | ||
// }); | ||
cy.get('.errors').within(() => { | ||
cy.findByText('Your email or password is incorrect. Please try again.').should('exist'); | ||
}); | ||
}); | ||
}); | ||
}); |