@@ -15,49 +15,39 @@ describe.only('A course session user', () => {
15
15
timeout : 8000 ,
16
16
} )
17
17
. first ( )
18
- . click ( ) ; //click on a course when link load
18
+ . click ( ) ;
19
19
20
20
// cy.getIframeBody().find('button').click(); Attempting to watch the session video. iframe isnt working at the moment
21
21
22
22
cy . get ( 'a[href*="what-is-sexual-trauma"]' , {
23
23
timeout : 8000 ,
24
24
} )
25
25
. first ( )
26
- . click ( ) ; //click on a session when link loads
26
+ . click ( ) ;
27
27
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' ) ;
29
29
30
30
cy . get ( 'h1' ) . should ( 'contain' , 'What is sexual trauma?' ) ;
31
31
32
- cy . get ( 'h3' ) . contains ( 'Activity' ) . click ( ) ; //open activities
32
+ cy . get ( 'h3' ) . contains ( 'Activity' ) . click ( ) ;
33
33
34
- cy . get ( 'h3' ) . contains ( 'Bonus content' ) . click ( ) ; //open bonus content
34
+ cy . get ( 'h3' ) . contains ( 'Bonus content' ) . click ( ) ;
35
35
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 ( ) ;
38
37
39
- // Wait for loading state to finish
40
- cy . get ( 'button' ) . contains ( 'Session complete' ) . should ( 'not.be.disabled' ) ;
38
+ cy . wait ( 2000 ) ;
41
39
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' ) ;
49
41
50
- cy . get ( 'button' ) . contains ( 'Send' ) . click ( ) ; //try to send feedback without selecting feedback option first
42
+ cy . get ( 'button' ) . contains ( 'Send' ) . click ( ) ;
51
43
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' ) ;
53
45
54
- cy . get ( 'input[name="feedback-radio-buttons"' ) . first ( ) . check ( ) ; //click feedback option
46
+ cy . get ( 'input[name="feedback-radio-buttons"] ' ) . first ( ) . check ( ) ;
55
47
56
- cy . get ( 'button' ) . contains ( 'Send' ) . click ( ) ; //submit feedback
48
+ cy . get ( 'button' ) . contains ( 'Send' ) . click ( ) ;
57
49
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' ) ;
61
51
} ) ;
62
52
63
53
after ( ( ) => {
0 commit comments