Skip to content

Commit bdf2fed

Browse files
committed
Test: Fix container selection in user-course-session-behaviour test
- Replace generic MuiContainer-root selector with precise feedback form targeting - Use contains() and parents() to find specific container with feedback form - Fix Cypress within() error by ensuring single container selection - Maintain existing timeout and state checks for CI reliability
1 parent 5354175 commit bdf2fed

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cypress/integration/tests/user-course-session-behaviour.cy.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@ describe.only('A course session user', () => {
3636
// Wait for button to be enabled before clicking
3737
cy.get('button').contains('Session complete').should('not.be.disabled').click(); //mark course as complete
3838

39-
// Wait for loading state to finish and feedback form to appear
39+
// Wait for loading state to finish
4040
cy.get('button').contains('Session complete').should('not.be.disabled');
41-
cy.get('h2', { timeout: 15000 }).contains('How was this session?').should('exist'); //feedback form available after course has started
41+
42+
// Wait for Redux store update by checking for container with feedback form
43+
cy.get('div.MuiContainer-root')
44+
.contains('How was this session?')
45+
.parents('.MuiContainer-root')
46+
.within(() => {
47+
cy.get('h2').contains('How was this session?').should('exist');
48+
});
4249

4350
cy.get('button').contains('Send').click(); //try to send feedback without selecting feedback option first
4451

0 commit comments

Comments
 (0)