@@ -18,13 +18,43 @@ describe("Wizard general interaction", () => {
18
18
"First step in the header is selected." ) ;
19
19
} ) ;
20
20
21
+ it ( "ARIA Attributes" , ( ) => {
22
+ const wiz = browser . $ ( "#wizTest" ) ;
23
+ const wizRoot = wiz . shadow$ ( ".ui5-wiz-root" ) ;
24
+ const wizNav = wiz . shadow$ ( ".ui5-wiz-nav" ) ;
25
+ const wizList = wiz . shadow$ ( ".ui5-wiz-nav-list" ) ;
26
+
27
+ const wizRootText = "Wizard" ;
28
+ const wizNavText = "Wizard Progress Bar" ;
29
+ const wizListText = "Wizard Steps" ;
30
+
31
+ assert . strictEqual ( wizRoot . getAttribute ( "role" ) , "region" ,
32
+ "Wizard has role set." ) ;
33
+ assert . strictEqual ( wizRoot . getAttribute ( "aria-label" ) , wizRootText ,
34
+ "Wizard has aria-label set." ) ;
35
+ assert . strictEqual ( wizNav . getAttribute ( "aria-label" ) , wizNavText ,
36
+ "Wizard nav has aria-label set." ) ;
37
+ assert . strictEqual ( wizList . getAttribute ( "role" ) , "list" ,
38
+ "Wizard list has role set.." ) ;
39
+ assert . strictEqual ( wizList . getAttribute ( "aria-controls" ) , "ui5-wiz-content" ,
40
+ "Wizard list has aria-controls set." ) ;
41
+ assert . strictEqual ( wizList . getAttribute ( "aria-label" ) , wizListText ,
42
+ "Wizard list has aria-label set." ) ;
43
+ } ) ;
44
+
21
45
it ( "move to next step by API" , ( ) => {
22
46
const wiz = browser . $ ( "#wizTest" ) ;
23
47
const btnToStep2 = browser . $ ( "#toStep2" ) ;
24
48
const step1 = browser . $ ( "#st1" ) ;
25
49
const step2 = browser . $ ( "#st2" ) ;
26
50
const step1InHeader = wiz . shadow$ ( `[data-ui5-index="1"]` ) ;
27
51
const step2InHeader = wiz . shadow$ ( `[data-ui5-index="2"]` ) ;
52
+ const step1InHeaderRoot = step1InHeader . shadow$ ( `.ui5-wiz-step-root` ) ;
53
+ const step2InHeaderRoot = step2InHeader . shadow$ ( `.ui5-wiz-step-root` ) ;
54
+
55
+ const stepText = "Step 1 Product type" ;
56
+ const currentStepText = "Step 2 Product Information current" ;
57
+
28
58
29
59
// act - the click handler calls the API
30
60
btnToStep2 . click ( ) ;
@@ -35,6 +65,12 @@ describe("Wizard general interaction", () => {
35
65
assert . strictEqual ( step1InHeader . getAttribute ( "selected" ) , null ,
36
66
"First step in the header not is selected." ) ;
37
67
68
+ // assert - check if aria-attributes are applied correctly when step is not selected
69
+ assert . strictEqual ( step1InHeaderRoot . getAttribute ( "role" ) , "listitem" ,
70
+ "First step in the header has role." ) ;
71
+ assert . strictEqual ( step1InHeaderRoot . getAttribute ( "aria-label" ) , stepText ,
72
+ "First step in the header has aria-label." ) ;
73
+
38
74
// assert - that second step in the content and in the header are properly selected
39
75
assert . strictEqual ( step2 . getAttribute ( "selected" ) , "true" ,
40
76
"Second step in the content is selected." ) ;
@@ -44,6 +80,10 @@ describe("Wizard general interaction", () => {
44
80
"Second step is enabled." ) ;
45
81
assert . strictEqual ( step2InHeader . getAttribute ( "disabled" ) , null ,
46
82
"Second step in header is enabled." ) ;
83
+
84
+ // assert - check if aria-label is applied correctly when step is selected
85
+ assert . strictEqual ( step2InHeaderRoot . getAttribute ( "aria-label" ) , currentStepText ,
86
+ "Second step in the header has aria-label." ) ;
47
87
} ) ;
48
88
49
89
it ( "move to next step by click" , ( ) => {
0 commit comments