Skip to content

Commit d44c97b

Browse files
authored
Fix: user-course-session-behaviour test
Fixes typo in radio selection feedback. Sets node version to 22 in cypress-run job in cypress-test.yml workflow.
1 parent 2cfec66 commit d44c97b

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

.github/workflows/cypress-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- name: Get yarn cache directory path
2121
id: yarn-cache-dir-path
22-
run: echo "::set-output name=dir::$(yarn cache dir)"
22+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
2323
- name: Cache node_modules
2424
uses: actions/cache@v4
2525
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -67,6 +67,10 @@ jobs:
6767
steps:
6868
- name: Checkout
6969
uses: actions/checkout@v4
70+
- name: Use NodeJs
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: '22.x'
7074
- name: Run cypress
7175
uses: cypress-io/github-action@v6.7.16
7276
with:

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,39 @@ describe.only('A course session user', () => {
1515
timeout: 8000,
1616
})
1717
.first()
18-
.click(); //click on a course when link load
18+
.click();
1919

2020
// cy.getIframeBody().find('button').click(); Attempting to watch the session video. iframe isnt working at the moment
2121

2222
cy.get('a[href*="what-is-sexual-trauma"]', {
2323
timeout: 8000,
2424
})
2525
.first()
26-
.click(); //click on a session when link loads
26+
.click();
2727

28-
cy.contains('How was this session?').should('not.exist'); ///no feedback form shown before course has been started
28+
cy.contains('How was this session?').should('not.exist');
2929

3030
cy.get('h1').should('contain', 'What is sexual trauma?');
3131

32-
cy.get('h3').contains('Activity').click(); //open activities
32+
cy.get('h3').contains('Activity').click();
3333

34-
cy.get('h3').contains('Bonus content').click(); //open bonus content
34+
cy.get('h3').contains('Bonus content').click();
3535

36-
// Wait for button to be enabled before clicking
37-
cy.get('button').contains('Session complete').should('not.be.disabled').click(); //mark course as complete
36+
cy.get('button').contains('Session complete').click();
3837

39-
// Wait for loading state to finish
40-
cy.get('button').contains('Session complete').should('not.be.disabled');
38+
cy.wait(2000);
4139

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-
});
40+
cy.get('h2').contains('How was this session?').should('exist');
4941

50-
cy.get('button').contains('Send').click(); //try to send feedback without selecting feedback option first
42+
cy.get('button').contains('Send').click();
5143

52-
cy.get('p').contains('Please select a rating before sending.').should('exist'); //give warning to user
44+
cy.get('p').contains('Please select a rating before sending.').should('exist');
5345

54-
cy.get('input[name="feedback-radio-buttons"').first().check(); //click feedback option
46+
cy.get('input[name="feedback-radio-buttons"]').first().check();
5547

56-
cy.get('button').contains('Send').click(); //submit feedback
48+
cy.get('button').contains('Send').click();
5749

58-
cy.get('h3', { timeout: 15000 })
59-
.contains('Thank you for submitting your feedback')
60-
.should('exist'); //check user feedback
50+
cy.get('h3').contains('Thank you for submitting your feedback').should('exist');
6151
});
6252

6353
after(() => {

0 commit comments

Comments
 (0)