@@ -18,18 +18,15 @@ import * as roles from "../utils/roles";
18
18
import * as elements from "../utils/elements" ;
19
19
import { diagnosticsElement , supportElement } from "../utils/elements-menu" ;
20
20
21
- fixture ( "For user with Diagnostics permissions" )
22
- . page ( "http://localhost:9090" )
23
- . beforeEach ( async ( t ) => {
24
- await t . useRole ( roles . diagnostics ) ;
25
- } ) ;
21
+ fixture ( "For user with Diagnostics permissions" ) . page ( "http://localhost:9090" ) ;
26
22
27
23
test ( "Support sidebar item exists" , async ( t ) => {
28
- await t . expect ( supportElement . exists ) . ok ( ) ;
24
+ await t . useRole ( roles . diagnostics ) . expect ( supportElement . exists ) . ok ( ) ;
29
25
} ) ;
30
26
31
27
test ( "Diagnostics link exists in Tools page" , async ( t ) => {
32
28
await t
29
+ . useRole ( roles . diagnostics )
33
30
. expect ( supportElement . exists )
34
31
. ok ( )
35
32
. click ( supportElement )
@@ -38,50 +35,61 @@ test("Diagnostics link exists in Tools page", async (t) => {
38
35
} ) ;
39
36
40
37
test ( "Diagnostics page can be opened" , async ( t ) => {
41
- await t . navigateTo ( "http://localhost:9090/support/diagnostics" ) ;
38
+ await t
39
+ . useRole ( roles . diagnostics )
40
+ . navigateTo ( "http://localhost:9090/support/diagnostics" ) ;
42
41
} ) ;
43
42
44
43
test ( "Start Diagnostic button exists" , async ( t ) => {
45
44
const startDiagnosticExists = elements . startDiagnosticButton . exists ;
46
45
await t
46
+ . useRole ( roles . diagnostics )
47
47
. navigateTo ( "http://localhost:9090/support/diagnostics" )
48
48
. expect ( startDiagnosticExists )
49
49
. ok ( ) ;
50
50
} ) ;
51
51
52
52
test ( "Start Diagnostic button can be clicked" , async ( t ) => {
53
53
await t
54
+ . useRole ( roles . diagnostics )
54
55
. navigateTo ( "http://localhost:9090/support/diagnostics" )
55
56
. click ( elements . startDiagnosticButton ) ;
56
57
} ) ;
57
58
58
59
test ( "Download button exists after Diagnostic is completed" , async ( t ) => {
59
- const downloadExists = elements . downloadButton . exists ;
60
60
await t
61
+ . useRole ( roles . diagnostics )
61
62
. navigateTo ( "http://localhost:9090/support/diagnostics" )
62
63
. click ( elements . startDiagnosticButton )
63
- . expect ( downloadExists )
64
+ . wait ( 2000 )
65
+ . expect ( elements . downloadButton . exists )
64
66
. ok ( ) ;
65
67
} ) ;
66
68
67
69
test ( "Download button is clickable after Diagnostic is completed" , async ( t ) => {
68
70
await t
71
+ . useRole ( roles . diagnostics )
69
72
. navigateTo ( "http://localhost:9090/support/diagnostics" )
70
73
. click ( elements . startDiagnosticButton )
74
+ . wait ( 2000 )
71
75
. click ( elements . downloadButton ) ;
72
76
} ) ;
73
77
74
78
test ( "Start New Diagnostic button exists after Diagnostic is completed" , async ( t ) => {
75
79
await t
80
+ . useRole ( roles . diagnostics )
76
81
. navigateTo ( "http://localhost:9090/support/diagnostics" )
77
82
. click ( elements . startDiagnosticButton )
83
+ . wait ( 2000 )
78
84
. expect ( elements . startNewDiagnosticButton . exists )
79
85
. ok ( ) ;
80
86
} ) ;
81
87
82
88
test ( "Start New Diagnostic button is clickable after Diagnostic is completed" , async ( t ) => {
83
89
await t
90
+ . useRole ( roles . diagnostics )
84
91
. navigateTo ( "http://localhost:9090/support/diagnostics" )
85
92
. click ( elements . startDiagnosticButton )
93
+ . wait ( 2000 )
86
94
. click ( elements . startNewDiagnosticButton ) ;
87
95
} ) ;
0 commit comments