Skip to content

Commit 83535d3

Browse files
authored
Merge pull request #4021 from bcgov/fix/alex-cypress-stability-3832
Fix: Cypress Stability - 3832
2 parents 1e6d431 + 711f6fc commit 83535d3

File tree

8 files changed

+74
-20
lines changed

8 files changed

+74
-20
lines changed

frontend/cypress/e2e/accessibility.cy.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('Accessibility Tests for LCFS', () => {
2121
Cypress.env('ADMIN_IDIR_USERNAME'),
2222
Cypress.env('ADMIN_IDIR_PASSWORD')
2323
)
24-
cy.wait(5000)
24+
cy.get('.main-layout-navbar', { timeout: 30000 }).should('be.visible')
2525
cy.injectAxe() // Injects the axe-core library
2626
cy.checkA11y(null, null, terminalLog)
2727
})
@@ -36,9 +36,8 @@ describe('Accessibility Tests for LCFS', () => {
3636
Cypress.env('ADMIN_IDIR_USERNAME'),
3737
Cypress.env('ADMIN_IDIR_PASSWORD')
3838
)
39-
cy.wait(5000)
39+
cy.getByDataTest('bc-navbar', { timeout: 30000 }).should('be.visible')
4040
cy.injectAxe() // Injects the axe-core library
41-
cy.getByDataTest('bc-navbar').should('exist')
4241
cy.getByDataTest('bc-navbar').within(() => {
4342
cy.checkA11y(null, null, terminalLog)
4443
})

frontend/cypress/e2e/admin.cy.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ describe('Admin view happy paths', () => {
3131
]
3232

3333
cy.visit('/admin/users', { timeout: 30000 })
34+
cy.getByDataTest('bc-grid-container', { timeout: 30000 }).should('exist')
3435

3536
tabs.forEach(({ label, path, panelIndex }) => {
36-
cy.contains('[role="tab"]', label, { timeout: 10000 }).click()
37+
cy.contains('[role="tab"]', label, { timeout: 10000 })
38+
.should('be.visible')
39+
.click()
3740
cy.location('pathname', { timeout: 30000 }).should('eq', path)
3841
cy.get(
3942
`#full-width-AdminTabPanel-${panelIndex} [data-test="bc-grid-container"]`,

frontend/cypress/e2e/charging_equipment_and_fse_reporting.cy.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ describe('ChargingEquipment create/edit/list filters/download', () => {
214214
cy.wait(['@orgNames', '@equipmentList'])
215215

216216
cy.contains('.filter-toolbar', 'Show FSE for:', { timeout: 30000 })
217+
.should('be.visible')
217218
.find('input')
218219
.first()
220+
.should('be.visible')
219221
.type('LCFS Org 2')
220-
cy.contains('li', 'LCFS Org 2', { timeout: 30000 }).click()
222+
cy.contains('li', 'LCFS Org 2', { timeout: 30000 }).should('be.visible').click()
221223
cy.wait('@equipmentListFiltered').its('request.body.organization_id').should('eq', 1002)
222224

223225
cy.getByDataTest('download-fse-excel', { timeout: 30000 }).click()
@@ -357,10 +359,12 @@ describe('FSE Reporting grid interactions + save flow', () => {
357359
'be.visible'
358360
)
359361

360-
cy.get('#site-selector input', { timeout: 30000 }).type(
361-
'Cypress Charging Site'
362-
)
363-
cy.contains('li', 'Cypress Charging Site', { timeout: 30000 }).click()
362+
cy.get('#site-selector input', { timeout: 30000 })
363+
.should('be.visible')
364+
.type('Cypress Charging Site')
365+
cy.contains('li', 'Cypress Charging Site', { timeout: 30000 })
366+
.should('be.visible')
367+
.click()
364368
cy.wait('@fseReportingListFiltered')
365369

366370
cy.contains('.ag-row', 'REG-8001', { timeout: 30000 })

frontend/cypress/e2e/charging_sites_fse_workflows.cy.js

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -396,19 +396,30 @@ describe('Charging Site and FSE supplier workflows', () => {
396396
cy.visit('/compliance-reporting/fse', { timeout: 30000 })
397397
cy.wait('@chargingEquipmentList')
398398

399-
cy.contains('button', 'Select all Draft/Updated', { timeout: 30000 }).click()
400-
cy.contains('button', 'Submit selected').click()
399+
cy.contains('button', 'Select all Draft/Updated', { timeout: 30000 })
400+
.should('be.visible')
401+
.click()
402+
cy.contains('button', 'Submit selected', { timeout: 30000 })
403+
.should('be.visible')
404+
.click()
405+
// Click the confirmation button in the modal
401406
cy.contains('button', 'Submit selected', { timeout: 30000 }).last().click()
402407
cy.wait('@bulkSubmit')
403-
cy.getByDataTest('alert-box').should('contain', 'submitted')
408+
cy.getByDataTest('alert-box', { timeout: 30000 }).should('contain', 'submitted')
404409

405-
cy.contains('button', 'Select all Validated', { timeout: 30000 }).click()
406-
cy.contains('button', 'Set to Decommissioned').first().click()
410+
cy.contains('button', 'Select all Validated', { timeout: 30000 })
411+
.should('be.visible')
412+
.click()
413+
cy.contains('button', 'Set to Decommissioned', { timeout: 30000 })
414+
.should('be.visible')
415+
.first()
416+
.click()
417+
// Click the confirmation button in the modal
407418
cy.contains('button', 'Set to Decommissioned', { timeout: 30000 })
408419
.last()
409420
.click()
410421
cy.wait('@bulkDecommission')
411-
cy.getByDataTest('alert-box').should('contain', 'decommissioned')
422+
cy.getByDataTest('alert-box', { timeout: 30000 }).should('contain', 'decommissioned')
412423
})
413424
})
414425

@@ -499,13 +510,18 @@ describe('FSE processing and map workflows (IDIR)', () => {
499510
cy.contains('h5, h6', 'Charging site/FSE processing', {
500511
timeout: 30000
501512
}).should('be.visible')
502-
cy.contains('button', 'Select all submitted').click()
503-
cy.contains('button', 'Set selected as validated').click()
513+
cy.contains('button', 'Select all submitted', { timeout: 30000 })
514+
.should('be.visible')
515+
.click()
516+
cy.contains('button', 'Set selected as validated', { timeout: 30000 })
517+
.should('be.visible')
518+
.click()
519+
// Click the confirmation button in the modal
504520
cy.contains('button', 'Validate Equipment', { timeout: 30000 })
505521
.last()
506522
.click()
507523
cy.wait('@bulkValidate')
508-
cy.getByDataTest('alert-box').should('contain', 'Validated')
524+
cy.getByDataTest('alert-box', { timeout: 30000 }).should('contain', 'Validated')
509525
})
510526

511527
it('renders the FSE map view and supports interactions', () => {

frontend/cypress/e2e/dashboard.cy.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ describe('Dashboard view coverage', () => {
1717
cy.getByDataTest('dashboard-admin-links-card', {
1818
timeout: 30000
1919
}).should('be.visible')
20-
cy.getByDataTest('admin-link-admin-users').click()
20+
cy.getByDataTest('admin-link-admin-users', { timeout: 30000 })
21+
.should('be.visible')
22+
.click()
2123
cy.location('pathname', { timeout: 30000 }).should('eq', '/admin/users')
2224
})
2325

frontend/cypress/e2e/notifications.cy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ describe('Notifications view flows', () => {
6565
cy.getByDataTest('select-all').click()
6666
cy.getByDataTest('select-all').click()
6767

68+
// Note: data-test="mark-as-unread" is actually the delete button
6869
cy.getByDataTest('mark-as-unread').should('not.be.disabled').click()
6970
cy.wait('@deleteNotifications')
7071
.its('request.body')

frontend/package-lock.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158
"@rollup/rollup-linux-x64-gnu": "4.6.1"
159159
},
160160
"overrides": {
161-
"minimatch": "9.0.5"
161+
"minimatch": "9.0.5",
162+
"find-cypress-specs": {
163+
"minimatch": "5.1.6"
164+
}
162165
}
163166
}

0 commit comments

Comments
 (0)