Skip to content

Commit e3f72a0

Browse files
committed
Remove duplications by moving steps to common.js
Inside the `cypress/support/step_definitions/` folder.
1 parent 523303d commit e3f72a0

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

cypress/e2e/engagesphere/greeting/greeting.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
2-
3-
Given('I access the EngageSphare app having already accepted the cookies banner', () => {
4-
cy.setCookie('cookieConsent', 'accepted')
5-
cy.visit('https://engage-sphere.vercel.app/')
6-
})
1+
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
72

83
Then('I see the following greeting: Hi there!', () => {
94
cy.contains('h2', 'Hi there!').should('be.visible')

cypress/e2e/engagesphere/itemsPerPage/itemsPerPage.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
2-
3-
Given('I access the EngageSphare app having already accepted the cookies banner', () => {
4-
cy.setCookie('cookieConsent', 'accepted')
5-
cy.visit('https://engage-sphere.vercel.app/')
6-
})
1+
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
72

83
When('I filter by {string} items per page', numOfItems => {
94
cy.get('[aria-label="Pagination limit"]').select(numOfItems)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Given } from '@badeball/cypress-cucumber-preprocessor'
2+
3+
Given('I access the EngageSphare app having already accepted the cookies banner', () => {
4+
cy.setCookie('cookieConsent', 'accepted')
5+
cy.visit('https://engage-sphere.vercel.app/')
6+
})

0 commit comments

Comments
 (0)