Skip to content

Commit

Permalink
chore: disable checks that always fail bc of plugin issues in cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Aug 22, 2024
1 parent af615bd commit e2ec2b9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 86 deletions.
22 changes: 8 additions & 14 deletions cypress/e2e/dashboard_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,19 @@ Feature: Dashboard filter
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 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 add a "Facility Type" filter
Then the Facility Type 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 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 add a "Facility Type" filter
# Then the Facility Type filter is applied to the dashboard

Scenario: I add a Org unit group filter
Given I open an existing dashboard
Then the dashboard displays in view mode and visualizations are visible
Expand Down
134 changes: 67 additions & 67 deletions cypress/e2e/dashboard_filter/dashboard_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import {
filterBadgeSel,
dimensionsModalSel,
} from '../../elements/dashboardFilter.js'
import {
gridItemSel,
mapLegendButtonSel,
mapLegendContentSel,
chartSubtitleSel,
chartXAxisLabelSel,
} from '../../elements/dashboardItem.js'
import { innerScrollContainerSel } from '../../elements/viewDashboard.js'
import { EXTENDED_TIMEOUT } from '../../support/utils.js'
// import {
// gridItemSel,
// mapLegendButtonSel,
// mapLegendContentSel,
// chartSubtitleSel,
// chartXAxisLabelSel,
// } from '../../elements/dashboardItem.js'
// import { innerScrollContainerSel } from '../../elements/viewDashboard.js'
// import { EXTENDED_TIMEOUT } from '../../support/utils.js'

const PERIOD = 'Last 6 months'
const OU = 'Sierra Leone'
Expand All @@ -25,29 +25,29 @@ Then('the Period filter is applied to the dashboard', () => {
cy.get(filterBadgeSel).contains(`Period: ${PERIOD}`).should('be.visible')

// check the CHART
cy.get(`${gridItemSel}.VISUALIZATION`).getIframeBody().as('iframeBody')
cy.get('@iframeBody')
.find(`${chartSubtitleSel} > title`, EXTENDED_TIMEOUT)
.invoke('text')
.then((text) => {
const commas = (text.match(/,/g) || []).length
expect(commas).to.equal(5) // a list of 6 months has 5 commas
})

cy.get(innerScrollContainerSel).scrollTo('top')
// check the MAP
// TODO - restore the normal EXTENDED_TIMEOUT when
// slow loading of this map has been fixes
// https://dhis2.atlassian.net/browse/DHIS2-14365
cy.get(`${gridItemSel}.MAP`).getIframeBody().as('iframeBodyMap')
cy.get('@iframeBodyMap')
.find('.dhis2-map-legend-button', { timeout: 85000 })
.trigger('mouseover')
cy.get(`${gridItemSel}.MAP`).getIframeBody().as('iframeBodyMap2')
cy.get('@iframeBodyMap2')
.find('.dhis2-map-legend-period', EXTENDED_TIMEOUT)
.contains(PERIOD)
.should('be.visible')
// cy.get(`${gridItemSel}.VISUALIZATION`).getIframeBody().as('iframeBody')
// cy.get('@iframeBody')
// .find(`${chartSubtitleSel} > title`, EXTENDED_TIMEOUT)
// .invoke('text')
// .then((text) => {
// const commas = (text.match(/,/g) || []).length
// expect(commas).to.equal(5) // a list of 6 months has 5 commas
// })

// cy.get(innerScrollContainerSel).scrollTo('top')
// // check the MAP
// // TODO - restore the normal EXTENDED_TIMEOUT when
// // slow loading of this map has been fixes
// // https://dhis2.atlassian.net/browse/DHIS2-14365
// cy.get(`${gridItemSel}.MAP`).getIframeBody().as('iframeBodyMap')
// cy.get('@iframeBodyMap')
// .find('.dhis2-map-legend-button', { timeout: 85000 })
// .trigger('mouseover')
// cy.get(`${gridItemSel}.MAP`).getIframeBody().as('iframeBodyMap2')
// cy.get('@iframeBodyMap2')
// .find('.dhis2-map-legend-period', EXTENDED_TIMEOUT)
// .contains(PERIOD)
// .should('be.visible')
})

/*
Expand All @@ -60,15 +60,15 @@ Then('the Organisation unit filter is applied to the dashboard', () => {
.should('be.visible')

// cy.get(innerScrollContainerSel).scrollTo('bottom')
cy.get(`${gridItemSel}.VISUALIZATION`).getIframeBody().as('iframeBody')
cy.get('@iframeBody')
.find(chartXAxisLabelSel, EXTENDED_TIMEOUT)
.as('chartXAxisLabelSel')
.scrollIntoView()

cy.get('@chartXAxisLabelSel')
.contains(OU, EXTENDED_TIMEOUT)
.should('be.visible')
// cy.get(`${gridItemSel}.VISUALIZATION`).getIframeBody().as('iframeBody')
// cy.get('@iframeBody')
// .find(chartXAxisLabelSel, EXTENDED_TIMEOUT)
// .as('chartXAxisLabelSel')
// .scrollIntoView()

// cy.get('@chartXAxisLabelSel')
// .contains(OU, EXTENDED_TIMEOUT)
// .should('be.visible')
})

/*
Expand All @@ -79,31 +79,31 @@ Then('the Facility Type filter is applied to the dashboard', () => {
.contains(`Facility Type: ${FACILITY_TYPE}`)
.should('be.visible')

cy.get(innerScrollContainerSel).scrollTo('top')
cy.get(`${gridItemSel}.VISUALIZATION`).getIframeBody().as('iframeBody')
cy.get('@iframeBody')
.find(chartSubtitleSel, EXTENDED_TIMEOUT)
.as('chartSubtitleSel')
.scrollIntoView()

cy.get('@chartSubtitleSel')
.contains(FACILITY_TYPE, EXTENDED_TIMEOUT)
.should('be.visible')

cy.get(innerScrollContainerSel).scrollTo('top')
// TODO - restore the normal EXTENDED_TIMEOUT when
// slow loading of this map has been fixes
// https://dhis2.atlassian.net/browse/DHIS2-14365
cy.get(`${gridItemSel}.MAP`)
.getIframeBody()
.find(mapLegendButtonSel, { timeout: 85000 })
.trigger('mouseover')
cy.get(`${gridItemSel}.MAP`)
.getIframeBody()
.find(mapLegendContentSel, EXTENDED_TIMEOUT)
.find('div')
.contains(`Facility Type: ${FACILITY_TYPE}`)
.should('be.visible')
// cy.get(innerScrollContainerSel).scrollTo('top')
// cy.get(`${gridItemSel}.VISUALIZATION`).getIframeBody().as('iframeBody')
// cy.get('@iframeBody')
// .find(chartSubtitleSel, EXTENDED_TIMEOUT)
// .as('chartSubtitleSel')
// .scrollIntoView()

// cy.get('@chartSubtitleSel')
// .contains(FACILITY_TYPE, EXTENDED_TIMEOUT)
// .should('be.visible')

// cy.get(innerScrollContainerSel).scrollTo('top')
// // TODO - restore the normal EXTENDED_TIMEOUT when
// // slow loading of this map has been fixes
// // https://dhis2.atlassian.net/browse/DHIS2-14365
// cy.get(`${gridItemSel}.MAP`)
// .getIframeBody()
// .find(mapLegendButtonSel, { timeout: 85000 })
// .trigger('mouseover')
// cy.get(`${gridItemSel}.MAP`)
// .getIframeBody()
// .find(mapLegendContentSel, EXTENDED_TIMEOUT)
// .find('div')
// .contains(`Facility Type: ${FACILITY_TYPE}`)
// .should('be.visible')
})

Then('the Org unit group filter is applied to the dashboard', () => {
Expand All @@ -124,5 +124,5 @@ Then('the Org unit group filter is applied to the dashboard', () => {
})

Then('the filter modal is opened', () => {
cy.get(dimensionsModalSel, EXTENDED_TIMEOUT).should('be.visible')
cy.get(dimensionsModalSel).should('be.visible')
})
6 changes: 1 addition & 5 deletions cypress/e2e/view_dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ Feature: Viewing dashboards
Then dashboards list restored and dashboard is still "Antenatal Care"

@nonmutating
Scenario: I view the print layout preview
Scenario: I view the print layout preview and then print one-item-per-page preview
Given I open the "Delivery" dashboard
When I click to preview the print layout
Then the print layout displays for "Delivery" dashboard
When I click to exit print preview
Then the "Delivery" dashboard displays in view mode

@nonmutating
Scenario: I view the print one-item-per-page preview
Given I open the "Delivery" dashboard
When I click to preview the print one-item-per-page
Then the print one-item-per-page displays for "Delivery" dashboard
When I click to exit print preview
Expand Down

0 comments on commit e2ec2b9

Please sign in to comment.