Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v100.4.0 #2936

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ jobs:

call-workflow-e2e-prod:
needs: [build, lint, test]
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests.yml@master
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master
secrets:
baseurl: ${{ secrets.CYPRESS_DHIS2_BASE_URL_DEV }}
username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
recordkey: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand Down
76 changes: 0 additions & 76 deletions .github/workflows/e2e-dev.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ defaults:

jobs:
call-workflow-e2e-dev:
if: github.ref == 'refs/heads/dev'
uses: ./.github/workflows/e2e-dev.yml
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-dev.yml@master
secrets:
baseurl: ${{ secrets.CYPRESS_DHIS2_BASE_URL_DEV }}
username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
recordkey: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand Down
9 changes: 8 additions & 1 deletion cypress/elements/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ const loadingEl = 'dhis2-uicore-circularloader'
export const expectAppToNotBeLoading = () =>
cy.getBySel(loadingEl, { timeout: 15000 }).should('not.exist')

export const clickCheckbox = (target) =>
export const checkCheckbox = (target) =>
cy.getBySel(target).click().find('[type="checkbox"]').should('be.checked')

export const uncheckCheckbox = (target) =>
cy
.getBySel(target)
.click()
.find('[type="checkbox"]')
.should('not.be.checked')

export const typeInput = (target, text) =>
cy.getBySel(target).find('input').type(text)

Expand Down
8 changes: 4 additions & 4 deletions cypress/elements/optionsModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ export {
} from './axes.js'

export {
clickTrendLineCheckbox,
checkTrendLineCheckbox,
selectTrendLineType,
clickTargetLineCheckbox,
checkTargetLineCheckbox,
setTargetLineValue,
setTargetLineLabel,
clickBaseLineCheckbox,
checkBaseLineCheckbox,
setBaseLineLabel,
setBaseLineValue,
} from './lines.js'

export { setCustomSubtitle } from './subtitle.js'

export { clickOutliersCheckbox } from './outliers.js'
export { checkOutliersCheckbox } from './outliers.js'

export { setItemToAxis, setItemToType } from './series.js'

Expand Down
8 changes: 4 additions & 4 deletions cypress/elements/optionsModal/lines.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clickCheckbox, typeInput } from '../common.js'
import { checkCheckbox, typeInput } from '../common.js'

const trendLineCheckboxEl = 'option-trend-line-checkbox'
const trendLineSelectEl = 'option-trend-line-select'
Expand All @@ -10,22 +10,22 @@ const baseLineCheckboxEl = 'option-base-line-checkbox'
const baseLineValueInputEl = 'option-base-line-value-input'
const baseLineLabelInputEl = 'option-base-line-label-input'

export const clickTrendLineCheckbox = () => clickCheckbox(trendLineCheckboxEl)
export const checkTrendLineCheckbox = () => checkCheckbox(trendLineCheckboxEl)

export const selectTrendLineType = (optionName) => {
cy.getBySel(trendLineSelectEl).findBySel('dhis2-uicore-select').click()
cy.getBySel(trendLineSelectOptionEl).contains(optionName).click()
}

export const clickTargetLineCheckbox = () => clickCheckbox(targetLineCheckboxEl)
export const checkTargetLineCheckbox = () => checkCheckbox(targetLineCheckboxEl)

export const setTargetLineValue = (text) =>
typeInput(targetLineValueInputEl, text)

export const setTargetLineLabel = (text) =>
typeInput(targetLineLabelInputEl, text)

export const clickBaseLineCheckbox = () => clickCheckbox(baseLineCheckboxEl)
export const checkBaseLineCheckbox = () => checkCheckbox(baseLineCheckboxEl)

export const setBaseLineValue = (text) => typeInput(baseLineValueInputEl, text)

Expand Down
4 changes: 2 additions & 2 deletions cypress/elements/optionsModal/outliers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { clickCheckbox } from '../common.js'
import { checkCheckbox } from '../common.js'

const outliersCheckboxEl = 'option-outliers-enabled-checkbox'

export const clickOutliersCheckbox = () => clickCheckbox(outliersCheckboxEl)
export const checkOutliersCheckbox = () => checkCheckbox(outliersCheckboxEl)
100 changes: 100 additions & 0 deletions cypress/elements/optionsModal/totals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
export const colTotalsOptionEl = 'option-col-totals'
const colSubTotalsOptionEl = 'option-col-subtotals'
const rowTotalsOptionEl = 'option-row-totals'
const rowSubTotalsOptionEl = 'option-row-subtotals'

export const expectColumnsTotalsToBeDisabled = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectColumnsTotalsToBeEnabled = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.disabled')

export const expectColumnsTotalsToBeChecked = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectColumnsTotalsToBeUnchecked = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectColumnsSubTotalsToBeDisabled = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectColumnsSubTotalsToBeEnabled = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectColumnsSubTotalsToBeChecked = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectColumnsSubTotalsToBeUnchecked = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectRowsTotalsToBeDisabled = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectRowsTotalsToBeEnabled = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectRowsTotalsToBeChecked = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectRowsTotalsToBeUnchecked = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectRowsSubTotalsToBeDisabled = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectRowsSubTotalsToBeEnabled = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectRowsSubTotalsToBeChecked = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectRowsSubTotalsToBeUnchecked = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')
7 changes: 7 additions & 0 deletions cypress/elements/pivotTable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
const valueCellEl = 'visualization-value-cell'
const headerCellEl = 'visualization-column-header'

export const clickTableValueCell = (index) =>
cy.getBySel(valueCellEl).eq(index).click()

export const expectTableValueCellsToHaveLength = (length) =>
cy.getBySel(valueCellEl).should('have.length', length)

export const expectTableValueCellToContainValue = (index, value) =>
cy.getBySel(valueCellEl).eq(index).contains(value)

export const clickTableHeaderCell = (name) =>
cy.getBySel(headerCellEl).contains(name).click()
Loading
Loading