Skip to content

Commit

Permalink
chore: consolidate to single test to avoid reloads
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Aug 23, 2024
1 parent 85b2116 commit fc5ec9d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ build
cypress.env.json
cypress/screenshots
cypress/videos
cypress/downloads
14 changes: 5 additions & 9 deletions cypress/e2e/dashboard_filter.feature
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
Feature: Dashboard filter

Scenario: I add a Period filter
Scenario: I add and remove filters
When I start a new dashboard
And I add items and save
Then the dashboard displays in view mode and visualizations are visible
When I add a "Period" filter
Then the Period filter is applied to the dashboard

Scenario: I add a Organisation unit filter
Given I open an existing dashboard
Then the dashboard displays in view mode and visualizations are visible
When I remove the "Period" filter
Then the filter is removed from the dashboard
When I add a "Organisation unit" filter
Then the Organisation unit filter is applied to the dashboard

Scenario: I add a Facility Type filter
Given I open an existing dashboard
Then the dashboard displays in view mode and visualizations are visible
When I remove the "OrgUnit" filter
Then the filter is removed from the dashboard
When I add a "Facility Type" filter
Then the Facility Type filter is applied to the dashboard

Expand Down
10 changes: 9 additions & 1 deletion cypress/e2e/dashboard_filter/dashboard_filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Then } from '@badeball/cypress-cucumber-preprocessor'
import { Then, When } from '@badeball/cypress-cucumber-preprocessor'
import {
filterBadgeSel,
dimensionsModalSel,
Expand Down Expand Up @@ -126,3 +126,11 @@ Then('the Org unit group filter is applied to the dashboard', () => {
Then('the filter modal is opened', () => {
cy.get(dimensionsModalSel).should('be.visible')
})

When('I remove the {string} filter', () => {
cy.get(filterBadgeSel).find('button').contains('Remove').click()
})

Then('the filter is removed from the dashboard', () => {
cy.get(filterBadgeSel).should('not.exist')
})

0 comments on commit fc5ec9d

Please sign in to comment.