Skip to content

Commit

Permalink
Revert "chore: test cleanup and use non-recording e2e-prod"
Browse files Browse the repository at this point in the history
This reverts commit e9c64fe.
  • Loading branch information
jenniferarnesen committed Oct 30, 2023
1 parent 88ae3cc commit 8abeffe
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 237 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:

call-workflow-e2e-prod:
needs: [build, lint, test]
uses: dhis2/line-listing-app/.github/workflows/e2e-prod.yml@e2e-prod-maps
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests.yml@master
secrets:
baseurl: ${{ secrets.CYPRESS_DHIS2_BASE_URL_DEV }}
username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
Expand Down
81 changes: 42 additions & 39 deletions cypress/integration/new.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,61 +41,64 @@ const TEST_INDICATOR_NAMES = TEST_INDICATORS.slice(1, 3).map(
)

describe('creating a new AO', () => {
it('navigates to the start page', () => {
goToStartPage()
})
visTypes.forEach((visType) => {
const visTypeName = visTypeDisplayNames[visType]
it(`create AO of type ${visTypeName}`, () => {
// navigates to start page
goToStartPage()
describe(visTypeName, () => {
it(`create AO of type ${visTypeName}`, () => {
// creates a new AO
createNewAO()
expectStoreCurrentToBeEmpty()
expectVisualizationToNotBeVisible()
expectVisTypeToBeDefault()

// creates a new AO
createNewAO()
expectStoreCurrentToBeEmpty()
expectVisualizationToNotBeVisible()
expectVisTypeToBeDefault()
// changes vis type
changeVisType(visTypeName)
expectVisTypeToBeValue(visTypeName)

// changes vis type
changeVisType(visTypeName)
expectVisTypeToBeValue(visTypeName)
// adds dimensions
openDimension(DIMENSION_ID_DATA)

// adds dimensions
openDimension(DIMENSION_ID_DATA)
if (visType === VIS_TYPE_SCATTER) {
selectIndicators(TEST_INDICATOR_NAMES.slice(0, 1))
switchDataTab('Horizontal')
selectDataElements(TEST_DATA_ELEMENT_NAMES.slice(0, 1))
} else {
if (getAxisMaxNumberOfItems(visType, TEST_AXIS_ID) === 1) {
// Gauge and SV can only have 1 data item
TEST_DATA_ELEMENT_NAMES.splice(1)
}

if (visType === VIS_TYPE_SCATTER) {
selectIndicators(TEST_INDICATOR_NAMES.slice(0, 1))
switchDataTab('Horizontal')
selectDataElements(TEST_DATA_ELEMENT_NAMES.slice(0, 1))
} else {
if (getAxisMaxNumberOfItems(visType, TEST_AXIS_ID) === 1) {
// Gauge and SV can only have 1 data item
TEST_DATA_ELEMENT_NAMES.splice(1)
selectDataElements(TEST_DATA_ELEMENT_NAMES)
}

selectDataElements(TEST_DATA_ELEMENT_NAMES)
}

clickDimensionModalUpdateButton()
clickDimensionModalUpdateButton()

expectVisualizationToBeVisible(visType)
expectVisualizationToBeVisible(visType)

isYearOverYear(visType) && expectAOTitleToBeUnsaved()
isYearOverYear(visType) && expectAOTitleToBeUnsaved()

// FIXME: Store is always in default state
/* !isYearOverYear(visType)
// FIXME: Store is always in default state
/* !isYearOverYear(visType)
? expectStoreCurrentColumnsToHaveLength(1)
: expectAOTitleToBeUnsaved() */

if (visType !== VIS_TYPE_SCATTER) {
TEST_DATA_ELEMENT_NAMES.forEach((item) =>
expectChartToContainDimensionItem(visType, item)
)
}
if (visType !== VIS_TYPE_SCATTER) {
TEST_DATA_ELEMENT_NAMES.forEach((item) =>
expectChartToContainDimensionItem(visType, item)
)
}
})

if ([VIS_TYPE_SINGLE_VALUE, VIS_TYPE_GAUGE].includes(visType)) {
// Data is locked to Series
expectDimensionOnAxisToHaveLockIcon(
DIMENSION_ID_DATA,
AXIS_ID_COLUMNS
)
it('Data is locked to Series', () => {
expectDimensionOnAxisToHaveLockIcon(
DIMENSION_ID_DATA,
AXIS_ID_COLUMNS
)
})
}
})
})
Expand Down
Loading

0 comments on commit 8abeffe

Please sign in to comment.