1
1
package io .github .epam .angular .tests .elements .complex ;
2
2
3
- import com .epam .jdi .light .angular .elements .composite .MaterialSelectorContainer ;
4
3
import com .epam .jdi .light .elements .common .UIElement ;
5
4
import io .github .epam .TestsInit ;
6
- import org .testng .annotations .BeforeMethod ;
5
+ import org .testng .annotations .BeforeClass ;
7
6
import org .testng .annotations .Test ;
8
7
9
8
import static com .epam .jdi .light .elements .composite .WebPage .refresh ;
19
18
import static io .github .com .pages .SideNavPage .contentRadioGroup ;
20
19
import static io .github .com .pages .SideNavPage .contentToggle ;
21
20
import static io .github .com .pages .SideNavPage .customEscapeBackdrop ;
22
- import static io .github .com .pages .SideNavPage .firstElement ;
23
21
import static io .github .com .pages .SideNavPage .firstElementFocused ;
24
22
import static io .github .com .pages .SideNavPage .fixSideNav ;
25
23
import static io .github .com .pages .SideNavPage .fixedPosition ;
@@ -55,7 +53,7 @@ public class SideNavTests extends TestsInit {
55
53
public static final String MODE = "mode" ;
56
54
public static final String SIDE = "side" ;
57
55
58
- @ BeforeMethod (alwaysRun = true )
56
+ @ BeforeClass (alwaysRun = true )
59
57
public void before () {
60
58
sideNavPage .open ();
61
59
waitCondition (() -> sideNavPage .isOpened ());
@@ -87,11 +85,11 @@ public void verifyPositionSelectionDrawerWithExplicitBackdropSettingSideNavTest(
87
85
sidenavBackdropContainer .is ().enabled ();
88
86
89
87
sideNavPosition .click ();
90
- ( new MaterialSelectorContainer ()) .select ("End" );
88
+ sideNavPosition .select ("End" );
91
89
92
90
backDropToggle .click ();
93
91
sidenavBackdropDrawer .is ().displayed ();
94
- sidenavBackdropDrawer .has ().cssClass ( "mat-drawer-end" );
92
+ sidenavBackdropContainer .has ().sideNavSectionOnTheRight ( sidenavBackdropDrawer . getLocation () );
95
93
}
96
94
97
95
@ Test (description = "Test verifies first menu item focus when 'true' is selected" )
@@ -101,13 +99,13 @@ public void verifyFocusSelectionDrawerWithExplicitBackdropSettingSideNavTest() {
101
99
sidenavBackdropContainer .is ().enabled ();
102
100
103
101
sideNavFocusSelection .click ();
104
- ( new MaterialSelectorContainer ()) .select ("True" );
102
+ sideNavFocusSelection .select ("True" );
105
103
106
104
backDropToggle .click ();
107
105
108
106
firstElementFocused .base ().timer ().wait (() -> firstElementFocused .has ().cssClass ("cdk-program-focused" ));
109
- firstElementFocused .has ().cssClass ("cdk-focused" );
110
107
firstElementFocused .is ().displayed ();
108
+ firstElementFocused .is ().focused ();
111
109
}
112
110
113
111
@ Test (description = "Verify main content is properly displayed alongside two side navigation panels" )
@@ -131,6 +129,7 @@ public void verifyImplicitMainContentWithTwoSideNavTest() {
131
129
132
130
@ Test (description = "Tests the opening and closing functionality of the component" )
133
131
public void verifyOpenCloseBehaviorTest () {
132
+ refresh ();
134
133
openCloseBehavior .show ();
135
134
openCloseBehavior .getContent ().is ().displayed ();
136
135
openCloseBehavior .getContent ().is ().enabled ();
@@ -140,8 +139,6 @@ public void verifyOpenCloseBehaviorTest() {
140
139
141
140
sideNavOpened .click ();
142
141
openCloseBehavior .base ().timer ().wait (() -> openCloseBehavior .isEnabled ());
143
- openCloseBehavior .base ().timer ().wait (() -> openCloseBehavior .getEvents ().has ().text ("open!" ));
144
- sideNavOpened .click ();
145
142
openCloseBehavior .base ().timer ().wait (() -> openCloseBehavior .getEvents ().has ().text ("open!\n close!" ));
146
143
}
147
144
@@ -206,19 +203,17 @@ public void verifyAutoSizeSideNav() {
206
203
toggleAutoNav .click ();
207
204
toggleExtraText .click ();
208
205
autoSizeSideNav .getMatDrawer ().has ().text (containsString ("Toggle extra text" ));
209
- autoSizeSideNav .getMatDrawerContent ().has ().attr (STYLE , "margin-left: 305px ;" );
206
+ autoSizeSideNav .getMatDrawerContent ().has ().attr (STYLE , "margin-left: 303px ;" );
210
207
}
211
208
212
209
@ Test (description = "Verify fixed sideNav" )
213
210
public void fixedSideNavTest () {
214
211
String testValue = "100" ;
215
212
fixedPosition .show ();
216
- topGap .click ();
217
213
topGap .clear ();
218
- topGap .sendKeys (testValue );
219
- bottomGap .click ();
214
+ topGap .setValue (testValue );
220
215
bottomGap .clear ();
221
- bottomGap .sendKeys (testValue );
216
+ bottomGap .setValue (testValue );
222
217
fixSideNav .click ();
223
218
fixedPosition .getSideNav ().has ().attr (STYLE , "transform: none; visibility: visible; top: 100px; bottom: " +
224
219
"100px;" );
0 commit comments