Skip to content

Commit

Permalink
PB-1327: changed approach to adapting refactored values in cypress te…
Browse files Browse the repository at this point in the history
…sts.
  • Loading branch information
Sami Nouidri authored and sami-nouidri-swisstopo committed Jan 15, 2025
1 parent 37fbd6c commit 272e962
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/utils/components/DropdownButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function selectItem(item) {
class="dropdown-item"
:class="{ active: currentValue === item.value }"
:data-tippy-content="item.description"
:data-cy="`dropdown-item-${item.title}`"
:data-cy="`dropdown-item-${item.id}`"
@click="selectItem(item)"
>
{{ t(item.title) }}
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/tests-e2e/drawing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ describe('Drawing module tests', () => {
'[data-cy="drawing-toolbox-export-button"] [data-cy="dropdown-toggle-button"]'
).click()
cy.get(
'[data-cy="drawing-toolbox-export-button"] [data-cy="dropdown-item-KML"]'
'[data-cy="drawing-toolbox-export-button"] [data-cy="dropdown-item-kml"]'
).click()
checkFiles('kml', (content) => {
expect(content).to.contains(
Expand All @@ -1265,7 +1265,7 @@ describe('Drawing module tests', () => {
'[data-cy="drawing-toolbox-export-button"] [data-cy="dropdown-toggle-button"]'
).click()
cy.get(
'[data-cy="drawing-toolbox-export-button"] [data-cy="dropdown-item-GPX"]'
'[data-cy="drawing-toolbox-export-button"] [data-cy="dropdown-item-gpx"]'
).click()
checkFiles('gpx', (content) => {
// 1 <rte> (routes), for the single LINEPOLYGON
Expand Down
16 changes: 8 additions & 8 deletions tests/cypress/tests-e2e/reportProblem.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Testing the report problem form', () => {
openForm()
cy.get('[data-cy="dropdown-main-button"').should('contain.text', 'Select a category')
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()
cy.get('[data-cy="text-area-input"]').type(text)
cy.get('[data-cy="email-input"').should('be.empty')
cy.get('[data-cy="submit-button"]').should('be.enabled')
Expand All @@ -69,7 +69,7 @@ describe('Testing the report problem form', () => {
cy.openMenuIfMobile()
openForm()
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()
cy.get('[data-cy="text-area-input"]').type(text)
cy.get('[data-cy="email-input"]').type('this.is.not.a.valid@email')
cy.get('[data-cy="submit-button"]:visible').click()
Expand All @@ -81,7 +81,7 @@ describe('Testing the report problem form', () => {
cy.openMenuIfMobile()
openForm()
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()
cy.get('[data-cy="text-area-input"]').type(text)
cy.get('[data-cy="email-input"').type(validEmail)
cy.get('[data-cy="submit-button"]').should('be.enabled')
Expand All @@ -91,7 +91,7 @@ describe('Testing the report problem form', () => {
cy.openMenuIfMobile()
openForm()
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()
cy.get('[data-cy="text-area-input"]').should('be.empty')
cy.get('[data-cy="email-input"]').type(validEmail)
cy.get('[data-cy="submit-button"]:visible').click()
Expand All @@ -105,7 +105,7 @@ describe('Testing the report problem form', () => {
openForm()
interceptFeedback(true)
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()
cy.get('[data-cy="email-input"]').type(validEmail)
cy.get('[data-cy="text-area-input"]').type(text)
cy.get('[data-cy="submit-button"]').scrollIntoView()
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('Testing the report problem form', () => {
cy.openMenuIfMobile()
openForm()
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()
cy.get('[data-cy="text-area-input"]').type(text)
const localKmlFile = 'import-tool/external-kml-file.kml'
cy.fixture(localKmlFile, null).as('kmlFixture')
Expand Down Expand Up @@ -184,7 +184,7 @@ describe('Testing the report problem form', () => {
openForm()
interceptFeedback(false)
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()
cy.get('[data-cy="text-area-input"]').type(text)
cy.get('[data-cy="email-input"]').type(validEmail)
cy.get('[data-cy="submit-button"]').click()
Expand All @@ -209,7 +209,7 @@ describe('Testing the report problem form', () => {

cy.log('Select category')
cy.get('[data-cy="dropdown-main-button"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-feedback_category_other"]').should('be.visible').click()
cy.get('[data-cy="dropdown-item-other"]').should('be.visible').click()

cy.log('Write description and email')
cy.get('[data-cy="text-area-input"]').type(text)
Expand Down

0 comments on commit 272e962

Please sign in to comment.