@@ -18,4 +18,35 @@ describe("BusyIndicator general interaction", () => {
18
18
assert . strictEqual ( input . getProperty ( "value" ) , "0" , "itemClick is not thrown" ) ;
19
19
} ) ;
20
20
21
+ it ( "tests focus handling" , ( ) => {
22
+ const busyIndicator = browser . $ ( "#indicator1" ) ;
23
+ busyIndicator . click ( ) ;
24
+
25
+ let innerFocusElement = browser . execute ( ( ) => {
26
+ return document . getElementById ( "indicator1" ) . shadowRoot . activeElement ;
27
+ } ) ;
28
+
29
+ innerFocusElement = $ ( innerFocusElement ) ;
30
+
31
+ assert . strictEqual ( innerFocusElement . getAttribute ( "class" ) , "ui5-busyindicator-busy-area" , "The correct inner element is focused" ) ;
32
+ } ) ;
33
+
34
+ it ( "tests internal focused element attributes" , ( ) => {
35
+ const busyIndicator = browser . $ ( "#indicator1" ) ;
36
+ busyIndicator . click ( ) ;
37
+ const innerFocusElement = busyIndicator . shadow$ ( ".ui5-busyindicator-busy-area" ) ;
38
+
39
+ assert . strictEqual ( innerFocusElement . getAttribute ( "role" ) , "progressbar" , "Correct 'role' is set" ) ;
40
+ assert . strictEqual ( innerFocusElement . getAttribute ( "tabindex" ) , "0" , "Correct 'tabindex' is set" ) ;
41
+ assert . strictEqual ( innerFocusElement . getAttribute ( "aria-valuemin" ) , "0" , "Correct 'aria-valuemin' is set" ) ;
42
+ assert . strictEqual ( innerFocusElement . getAttribute ( "aria-valuemax" ) , "100" , "Correct 'aria-valuemax' is set" ) ;
43
+ assert . strictEqual ( innerFocusElement . getAttribute ( "aria-valuetext" ) , "Busy" , "Correct 'aria-valuetext' is set" ) ;
44
+ } ) ;
45
+
46
+ it ( "tests content is not reachable with keyboard when active" , ( ) => {
47
+ const busyIndicator = browser . $ ( "#indicatorWithBtn" ) ;
48
+ const defaultSLot = busyIndicator . shadow$ ( "slot" ) ;
49
+
50
+ assert . strictEqual ( defaultSLot . getAttribute ( "tabindex" ) , "-1" , "Slot is not reachable via keyboard" ) ;
51
+ } ) ;
21
52
} ) ;
0 commit comments