Skip to content

Commit

Permalink
Merge pull request #129 from ddjnw1yu/reduce-testing-random-failure
Browse files Browse the repository at this point in the history
Try to avoid random testing issues in  userstories testing
  • Loading branch information
alan-wu authored Jun 11, 2024
2 parents 7187c71 + 4a28836 commit 7c74c98
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/quality_control_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ jobs:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
containers: [1, 2]

steps:
- name: Cleanup pre-installed tools
run: |
Expand All @@ -135,7 +130,6 @@ jobs:
with:
wait-on: ${{ env.ROOT_URL }}
record: true
parallel: true
spec: tests/cypress/e2e/databrowser.cy.js,tests/cypress/e2e/datasets.cy.js,tests/cypress/e2e/mapsviewer.cy.js
tag: QC-${{github.event.inputs.PORTAL_TARGET}}

Expand All @@ -148,6 +142,5 @@ jobs:
with:
wait-on: ${{ env.ROOT_URL }}
record: true
parallel: true
spec: tests/cypress/e2e/databrowser.cy.js,tests/cypress/e2e/datasets.cy.js,tests/cypress/e2e/mapsviewer.cy.js
tag: QC-${{github.event.inputs.PORTAL_TARGET}}
6 changes: 0 additions & 6 deletions .github/workflows/scheduled_production_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ jobs:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]

steps:
- name: Cleanup pre-installed tools
run: |
Expand All @@ -83,5 +78,4 @@ jobs:
with:
wait-on: ${{ env.ROOT_URL }}
record: true
parallel: true
tag: Scheduled-Production
6 changes: 0 additions & 6 deletions .github/workflows/scheduled_staging_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ jobs:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]

steps:
- name: Cleanup pre-installed tools
run: |
Expand All @@ -83,5 +78,4 @@ jobs:
with:
wait-on: ${{ env.ROOT_URL }}
record: true
parallel: true
tag: Scheduled-Staging
20 changes: 9 additions & 11 deletions tests/cypress/e2e/userstories.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ const categories = ['stomach', 'lung']

describe('User stories', function () {
describe('Should find segmentation in the gallery', { testIsolation: false }, function () {
before('Loading Datasets', function () {
beforeEach('Loading Datasets', function () {
cy.intercept('**/query?**').as('query');
cy.visit('');

cy.wait('@query', { timeout: 20000 });

// Navigate to 'Data&Models' page
cy.get('.mobile-navigation > :nth-child(1) > :nth-child(1) > a').click();

cy.waitForLoadingMask()

})

segmentationDatasetIds.forEach((id) => {

it(`Access dataset ${id}`, function () {

cy.waitForLoadingMask()

// Search for segmentation related dataset
cy.get('.el-input__wrapper > .el-input__inner').clear();
cy.get('.search-text').click();
Expand All @@ -43,14 +43,12 @@ describe('User stories', function () {
cy.findGalleryCard('Segmentation', 'prev');
cy.get('.el-card > .el-card__body > :nth-child(1) > .details > :nth-child(1) > b').should('contain', 'Segmentation');
cy.get('.el-card > .el-card__body > :nth-child(1) > .details > .el-button > span').should('contain', ' View Segmentation');

cy.visit(`${Cypress.config().baseUrl}/data?type=dataset`);
})
})
})

describe('Should open scaffold through the gallery', { testIsolation: false }, function () {
before('Loading Anatomical Models', function () {
beforeEach('Loading Anatomical Models', function () {
cy.intercept('**/query?**').as('query');
cy.visit('');

Expand All @@ -62,14 +60,14 @@ describe('User stories', function () {
// Go to 'Anatomical Models'
cy.get(':nth-child(2) > .search-tabs__button').click();
cy.get(':nth-child(2) > .search-tabs__button').should('have.class', 'active');

cy.waitForLoadingMask()

})

scaffoldDatasetCategories.forEach((category) => {

it(`Access scaffold ${category}`, function () {

cy.waitForLoadingMask()

// Search for scaffold related dataset
cy.get('.el-input__wrapper > .el-input__inner').clear();
cy.get('.search-text').click();
Expand Down Expand Up @@ -142,7 +140,6 @@ describe('User stories', function () {
cy.visit(`/datasets/${datasetId}?type=dataset`);
})
})
cy.visit(`${Cypress.config().baseUrl}/data?type=model&search=${category}`);
})
})
})
Expand All @@ -154,6 +151,7 @@ describe('User stories', function () {

// Wait for 'href' ready for click
cy.wait(5000)
cy.waitForLoadingMask()

})

Expand Down

0 comments on commit 7c74c98

Please sign in to comment.