-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build-system-test): Merge web build system tests with canaries (#…
- Loading branch information
Showing
47 changed files
with
3,657 additions
and
206 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DOMAIN= | ||
NEW_PASSWORD= | ||
PHONE_NUMBER= | ||
USERNAME= | ||
VALID_PASSWORD= |
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,7 @@ | ||
# testing | ||
cypress/fixtures/example.json | ||
cypress/screenshots | ||
cypress/videos | ||
|
||
|
||
.env |
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,35 @@ | ||
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'; | ||
import createEsbuildPlugin from '@badeball/cypress-cucumber-preprocessor/esbuild'; | ||
import * as createBundler from '@bahmutov/cypress-esbuild-preprocessor'; | ||
import { defineConfig } from 'cypress'; | ||
import * as dotenv from 'dotenv'; | ||
|
||
dotenv.config(); | ||
|
||
export default defineConfig({ | ||
defaultCommandTimeout: 15000, | ||
e2e: { | ||
baseUrl: 'http://localhost:3000/', | ||
specPattern: 'features/**/*.feature', | ||
|
||
async setupNodeEvents(on, config) { | ||
await addCucumberPreprocessorPlugin(on, config); | ||
|
||
on( | ||
'file:preprocessor', | ||
createBundler({ | ||
define: { global: 'window' }, | ||
plugins: [createEsbuildPlugin(config)], | ||
}) | ||
); | ||
|
||
Object.assign(config.env, process.env); | ||
|
||
return config; | ||
}, | ||
}, | ||
env: { | ||
tags: 'not @skip', | ||
}, | ||
video: false, | ||
}); |
9 changes: 9 additions & 0 deletions
9
build-system-tests/e2e/cypress/fixtures/sign-up-with-email.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"CodeDeliveryDetails": { | ||
"AttributeName": "email", | ||
"DeliveryMedium": "EMAIL", | ||
"Destination": "a***@e***.com" | ||
}, | ||
"UserConfirmed": false, | ||
"UserSub": "••••••-••••-••••-••••-•••••••••••••" | ||
} |
10 changes: 10 additions & 0 deletions
10
build-system-tests/e2e/cypress/integration/common/liveness.ts
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,10 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
When( | ||
'I request {string} and get {string}', | ||
(url: string, statusCode: string) => { | ||
cy.request({ url, followRedirect: true }).then(({ status }) => { | ||
expect(status).to.be.equal(+statusCode); | ||
}); | ||
} | ||
); |
55 changes: 55 additions & 0 deletions
55
build-system-tests/e2e/cypress/integration/common/shared.ts
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,55 @@ | ||
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
import { escapeRegExp } from 'lodash'; | ||
|
||
Given("I'm running the example {string}", (example: string) => { | ||
cy.visit(example, { | ||
// See: https://glebbahmutov.com/blog/cypress-tips-and-tricks/#control-navigatorlanguage | ||
onBeforeLoad(win) { | ||
Object.defineProperty(win.navigator, 'language', { value: 'en-US' }); | ||
}, | ||
}); | ||
}); | ||
|
||
Given( | ||
'I intercept {string} with fixture {string}', | ||
(json: string, fixture: string) => { | ||
let routeMatcher; | ||
|
||
try { | ||
routeMatcher = JSON.parse(json); | ||
} catch (error) { | ||
throw error; | ||
} | ||
|
||
cy.intercept(routeMatcher, { fixture }).as('route'); | ||
} | ||
); | ||
|
||
When('I click the {string} tab', (label: string) => { | ||
cy.findByRole('tab', { | ||
name: new RegExp(`^${escapeRegExp(label)}$`, 'i'), | ||
}).click(); | ||
}); | ||
|
||
When('I click the {string} button', (name: string) => { | ||
cy.findByRole('button', { | ||
name: new RegExp(`^${escapeRegExp(name)}$`, 'i'), | ||
}).click(); | ||
}); | ||
|
||
Then('I see the {string} button', (name: string) => { | ||
cy.findByRole('button', { | ||
name: new RegExp(`^${escapeRegExp(name)}$`, 'i'), | ||
}).should('be.visible'); | ||
}); | ||
|
||
Then('I see {string}', (message: string) => { | ||
cy.findByRole('document') | ||
.contains(new RegExp(escapeRegExp(message), 'i')) | ||
.should('exist'); | ||
}); | ||
|
||
When('I type a new {string}', (field: string) => { | ||
cy.findInputField(field).typeAliasWithStatus(field, `${Date.now()}`); | ||
}); |
15 changes: 15 additions & 0 deletions
15
build-system-tests/e2e/cypress/integration/common/sign-in.ts
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,15 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
When( | ||
'I type my {string} with status {string}', | ||
(loginMechanism: string, status: string) => { | ||
cy.findInputField(loginMechanism).typeAliasWithStatus( | ||
loginMechanism, | ||
status | ||
); | ||
} | ||
); | ||
|
||
When('I type my password', () => { | ||
cy.findInputField('Password').type(Cypress.env('VALID_PASSWORD')); | ||
}); |
12 changes: 12 additions & 0 deletions
12
build-system-tests/e2e/cypress/integration/common/sign-up.ts
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,12 @@ | ||
import { Given, When } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
Given('I click {string}', (text: string) => { | ||
cy.findByText(text).click(); | ||
}); | ||
|
||
When('I confirm my password', () => { | ||
cy.findInputField('Confirm Password') | ||
.type(Cypress.env('VALID_PASSWORD')) | ||
.blur() | ||
.wait(100); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.