@@ -15,6 +15,8 @@ describe("Carousel general interaction", () => {
15
15
16
16
it ( "Carousel navigates left" , ( ) => {
17
17
const carousel = browser . $ ( "#carousel1" ) ;
18
+ carousel . scrollIntoView ( ) ;
19
+ carousel . moveTo ( ) ;
18
20
const carouselRightButton = carousel . shadow$$ ( ".ui5-carousel-navigation-button" ) [ 0 ] ;
19
21
20
22
carouselRightButton . click ( ) ;
@@ -23,6 +25,8 @@ describe("Carousel general interaction", () => {
23
25
24
26
it ( "Carousel navigates right" , ( ) => {
25
27
const carousel = browser . $ ( "#carousel1" ) ;
28
+ carousel . scrollIntoView ( ) ;
29
+ carousel . moveTo ( ) ;
26
30
const carouselLeftButton = carousel . shadow$$ ( ".ui5-carousel-navigation-button" ) [ 1 ] ;
27
31
28
32
carouselLeftButton . click ( ) ;
@@ -31,20 +35,26 @@ describe("Carousel general interaction", () => {
31
35
32
36
it ( "Navigation is rendered for carousel with less than 9 elements" , ( ) => {
33
37
const carousel = browser . $ ( "#carousel1" ) ;
38
+ carousel . moveTo ( ) ;
39
+
34
40
const navigation = carousel . shadow$ ( ".ui5-carousel-navigation > div" ) ;
35
41
36
42
assert . ok ( navigation . isExisting ( ) , "Navigation is rendered" ) ;
37
43
} ) ;
38
44
39
45
it ( "Navigation is rendered for carousel with more than 9 elements" , ( ) => {
40
46
const carousel = browser . $ ( "#carousel2" ) ;
47
+ carousel . scrollIntoView ( ) ;
48
+ carousel . moveTo ( ) ;
41
49
const navigation = carousel . shadow$ ( ".ui5-carousel-navigation > ui5-label" ) ;
42
50
43
51
assert . ok ( navigation . isExisting ( ) , "Navigation is rendered" ) ;
44
52
} ) ;
45
53
46
54
it ( "Buttons are rendered in the navigation(arrows-placement)" , ( ) => {
47
55
const carousel = browser . $ ( "#carousel3" ) ;
56
+ carousel . scrollIntoView ( ) ;
57
+ carousel . moveTo ( ) ;
48
58
const buttons = carousel . shadow$$ ( ".ui5-carousel-navigation-wrapper ui5-button" ) ;
49
59
50
60
assert . strictEqual ( buttons . length , 2 , "Navigation is rendered" ) ;
@@ -59,7 +69,9 @@ describe("Carousel general interaction", () => {
59
69
60
70
it ( "Aria attributes are set" , ( ) => {
61
71
const carousel = browser . $ ( "#carousel5" ) ;
62
- const pageIndicatorDot1 = carousel . shadow$ ( ".ui5-carousel-navigation-dot:first-child" ) ;
72
+ carousel . scrollIntoView ( ) ;
73
+ carousel . moveTo ( ) ;
74
+ const pageIndicatorDot1 = $ ( '#carousel5' ) . shadow$ ( ".ui5-carousel-navigation-dot:first-child" ) ;
63
75
const pageIndicatorDot2 = carousel . shadow$ ( ".ui5-carousel-navigation-dot:nth-child(2)" ) ;
64
76
const PAGE_INDICATOR_ARIA_LABEL1 = "Item 1 of 5 displayed" ;
65
77
const PAGE_INDICATOR_ARIA_LABEL2 = "Item 2 of 5 displayed" ;
@@ -130,6 +142,8 @@ describe("Carousel general interaction", () => {
130
142
131
143
it ( "Event navigate fired when pressing navigation arrows" , ( ) => {
132
144
const carousel = browser . $ ( "#carousel8" ) ;
145
+ carousel . scrollIntoView ( ) ;
146
+ carousel . moveTo ( ) ;
133
147
const selectedIndex = browser . $ ( "#result" ) ;
134
148
const eventCounter = browser . $ ( "#resultCounter" ) ;
135
149
const navigationArrowForward = carousel . shadow$ ( "ui5-button[arrow-forward]" ) ;
@@ -170,6 +184,8 @@ describe("Carousel general interaction", () => {
170
184
it ( "loadMore event is fired only when neccessary" , ( ) => {
171
185
const carousel = browser . $ ( "#carousel9" ) ;
172
186
const eventCounter = browser . $ ( "#loadmore-result" ) ;
187
+ carousel . scrollIntoView ( ) ;
188
+ carousel . moveTo ( ) ;
173
189
const navigationArrowForward = carousel . shadow$ ( "ui5-button[arrow-forward]" ) ;
174
190
175
191
navigationArrowForward . click ( ) ;
0 commit comments