-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change cypress to use production build
- Loading branch information
Showing
5 changed files
with
90 additions
and
81 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
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
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,10 +1,20 @@ | ||
describe('Signup test', () => { | ||
it('successfully loads', () => { | ||
before(() => { | ||
cy.visit('/signup').wait(3000); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.intercept('/webapi/countries', { | ||
body: { | ||
result: [{ name: 'Country', code: 'CT' }], | ||
}, | ||
}); | ||
}); | ||
|
||
it('show introduction page', () => { | ||
cy.contains('Important Note'); | ||
cy.contains('Important Note').should('be.visible'); | ||
cy.get('[data-cy=next-button]').should('be.visible'); | ||
cy.get('[data-cy=next-button]').should('be.enabled'); | ||
cy.get('[data-cy=next-button]').click(); | ||
}); | ||
|
||
|
@@ -15,17 +25,17 @@ describe('Signup test', () => { | |
cy.get('input#password-confirmation').first().as('confirmPasswordInput'); | ||
cy.get('button[data-cy=next-button]').first().as('nextButton'); | ||
|
||
expect(cy.get('@usernameInput')).to.exist; | ||
expect(cy.get('@emailInput')).to.exist; | ||
expect(cy.get('@passwordInput')).to.exist; | ||
expect(cy.get('@confirmPasswordInput')).to.exist; | ||
expect(cy.get('@nextButton').should('be.disabled')); | ||
cy.get('@usernameInput').should('exist'); | ||
cy.get('@emailInput').should('exist'); | ||
cy.get('@passwordInput').should('exist'); | ||
cy.get('@confirmPasswordInput').should('exist'); | ||
cy.get('@nextButton').should('be.disabled'); | ||
|
||
cy.get('@usernameInput').type('username'); | ||
cy.get('@emailInput').type('[email protected]'); | ||
cy.get('@passwordInput').type('p455w0rD'); | ||
cy.get('@confirmPasswordInput').type('p455w0rD'); | ||
expect(cy.get('@nextButton').should('be.enabled')); | ||
cy.get('@nextButton').should('be.enabled'); | ||
cy.get('@nextButton').click(); | ||
}); | ||
|
||
|
@@ -36,11 +46,11 @@ describe('Signup test', () => { | |
cy.get('input#vat-id').first().as('vatIdInput'); | ||
cy.get('button[data-cy=next-button]').first().as('nextButton'); | ||
|
||
expect(cy.get('@firstNameInput')).to.exist; | ||
expect(cy.get('@lastNameInput')).to.exist; | ||
expect(cy.get('@companyNameInput')).to.exist; | ||
expect(cy.get('@vatIdInput')).to.exist; | ||
expect(cy.get('@nextButton').should('be.disabled')); | ||
cy.get('@firstNameInput').should('exist'); | ||
cy.get('@lastNameInput').should('exist'); | ||
cy.get('@companyNameInput').should('exist'); | ||
cy.get('@vatIdInput').should('exist'); | ||
cy.get('@nextButton').should('be.disabled'); | ||
|
||
cy.get('@firstNameInput').type('First'); | ||
cy.get('@lastNameInput').type('Last'); | ||
|
@@ -52,7 +62,7 @@ describe('Signup test', () => { | |
cy.get('input#address-2').first().as('address2Input'); | ||
cy.get('input#city').first().as('cityInput'); | ||
cy.get('input#postal').first().as('postalInput'); | ||
cy.get('#country input').first().as('countryInput'); | ||
cy.get('input#country').first().as('countryInput'); | ||
cy.get('div#signup-captcha').first().as('captcha'); | ||
cy.get('input#tos').first().as('tosInput'); | ||
cy.get('button') | ||
|
@@ -61,14 +71,14 @@ describe('Signup test', () => { | |
.as('submitButton'); | ||
cy.get('button[data-cy=submit-button]').first().as('submitButton'); | ||
|
||
expect(cy.get('@address1Input')).to.exist; | ||
expect(cy.get('@address2Input')).to.exist; | ||
expect(cy.get('@cityInput')).to.exist; | ||
expect(cy.get('@postalInput')).to.exist; | ||
expect(cy.get('@countryInput')).to.exist; | ||
expect(cy.get('@captcha')).to.exist; | ||
expect(cy.get('@tosInput')).to.exist; | ||
expect(cy.get('@submitButton').should('be.disabled')); | ||
cy.get('@address1Input').should('exist'); | ||
cy.get('@address2Input').should('exist'); | ||
cy.get('@cityInput').should('exist'); | ||
cy.get('@postalInput').should('exist'); | ||
cy.get('@countryInput').should('exist'); | ||
cy.get('@captcha').should('exist'); | ||
cy.get('@tosInput').should('exist'); | ||
cy.get('@submitButton').should('be.disabled'); | ||
|
||
cy.get('@address1Input').type('Address first line'); | ||
cy.get('@address2Input').type('Address second line'); | ||
|
@@ -80,18 +90,19 @@ describe('Signup test', () => { | |
it('checks signup postal input field for valid inputs!', () => { | ||
cy.get('input#postal').first().as('postalInput'); | ||
cy.get('@postalInput').type('12345'); | ||
cy.get('#postal .details .text-rui-error').should('not.exist'); | ||
cy.get('[data-cy=postal] .details .text-rui-error').should('not.exist'); | ||
cy.get('@postalInput').clear().type('ABC-40'); | ||
cy.get('#postal .details .text-rui-error').should('not.exist'); | ||
cy.get('[data-cy=postal] .details .text-rui-error').should('not.exist'); | ||
cy.get('@postalInput').clear().type('ABC-40 224'); | ||
cy.get('#postal .details .text-rui-error').should('not.exist'); | ||
cy.get('[data-cy=postal] .details .text-rui-error').should('not.exist'); | ||
cy.get('@postalInput').clear().type('12@345'); | ||
cy.get('#postal .details .text-rui-error').first().as('postalError'); | ||
expect(cy.get('@postalError')).to.exist; | ||
cy.get('[data-cy=postal] .details .text-rui-error') | ||
.first() | ||
.as('postalError'); | ||
cy.get('@postalInput').clear().type('12#345'); | ||
expect(cy.get('@postalError')).to.exist; | ||
cy.get('@postalError').should('exist'); | ||
cy.get('@postalInput').clear().type('.'); | ||
expect(cy.get('@postalError')).to.exist; | ||
cy.get('@postalError').should('exist'); | ||
cy.get('@postalInput').clear().type('105102'); | ||
cy.get('#postal .details .text-rui-error').should('not.exist'); | ||
}); | ||
|