Skip to content

Commit 096c528

Browse files
committed
Simplify which url should be visited
1 parent a49489c commit 096c528

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

cypress/e2e/a11y.cy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
describe('Cypress Playground', () => {
22
beforeEach(() => {
3-
if (Cypress.env('environment') === 'prod') {
4-
cy.visit('https://cypress-playground.s3.eu-central-1.amazonaws.com/index.html')
5-
} else {
6-
cy.visit('./src/index.html')
7-
}
3+
const url = Cypress.env('environment') === 'prod'
4+
? 'https://cypress-playground.s3.eu-central-1.amazonaws.com/index.html'
5+
: './src/index.html'
6+
7+
cy.visit(url)
88

99
cy.injectAxe()
1010
})

cypress/e2e/playground.cy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ describe('Cypress Playground', () => {
44

55
cy.clock(date)
66

7-
if (Cypress.env('environment') === 'prod') {
8-
cy.visit('https://cypress-playground.s3.eu-central-1.amazonaws.com/index.html')
9-
} else {
10-
cy.visit('./src/index.html')
11-
}
7+
const url = Cypress.env('environment') === 'prod'
8+
? 'https://cypress-playground.s3.eu-central-1.amazonaws.com/index.html'
9+
: './src/index.html'
10+
11+
cy.visit(url)
1212
})
1313

1414
it('shows a promotional banner', () => {

0 commit comments

Comments
 (0)