@@ -12,25 +12,28 @@ namespace Aquality.Selenium.Tests.Integration.Actions
1212 internal class JsActionsTests : UITest
1313 {
1414 [ Test ]
15- public void Should_BeAbleClick_WithJsActions ( )
15+ public void Should_BePossibleTo_Click ( )
1616 {
1717 var welcomeForm = new WelcomeForm ( ) ;
18+ welcomeForm . Open ( ) ;
1819 welcomeForm . GetExampleLink ( AvailableExample . Dropdown ) . JsActions . Click ( ) ;
1920 Assert . IsTrue ( new DropdownForm ( ) . IsDisplayed , "Dropdown form should be displayed" ) ;
2021 }
2122
2223 [ Test ]
23- public void Should_BeAbleClickAndWait_WithJsActions ( )
24- {
24+ public void Should_BePossibleTo_ClickAndWait ( )
25+ {
2526 var welcomeForm = new WelcomeForm ( ) ;
27+ welcomeForm . Open ( ) ;
2628 welcomeForm . GetExampleLink ( AvailableExample . Dropdown ) . JsActions . ClickAndWait ( ) ;
2729 Assert . IsTrue ( new DropdownForm ( ) . IsDisplayed , "Dropdown form should be displayed" ) ;
2830 }
2931
3032 [ Test ]
31- public void Should_BeAbleHighlight_WithJsActions ( )
33+ public void Should_BePossibleTo_HighlightElement ( )
3234 {
3335 var welcomeForm = new WelcomeForm ( ) ;
36+ welcomeForm . Open ( ) ;
3437 var dropdownExample = welcomeForm . GetExampleLink ( AvailableExample . Dropdown ) ;
3538 dropdownExample . JsActions . HighlightElement ( HighlightState . Highlight ) ;
3639 var border = dropdownExample . GetCssValue ( "border" ) ;
@@ -39,7 +42,7 @@ public void Should_BeAbleHighlight_WithJsActions()
3942
4043 [ Ignore ( "should be updated" ) ]
4144 [ Test ]
42- public void Should_BeAbleHover_WithJsActions ( )
45+ public void Should_BePossibleTo_HoverMouse ( )
4346 {
4447 BrowserManager . Browser . GoTo ( Constants . UrlAutomationPractice ) ;
4548 var productList = new ProductListForm ( ) ;
@@ -52,7 +55,7 @@ public void Should_BeAbleHover_WithJsActions()
5255 }
5356
5457 [ Test ]
55- public void Should_BeAbleSetFocus_WithJsActions ( )
58+ public void Should_BePossibleTo_SetFocus ( )
5659 {
5760 BrowserManager . Browser . GoTo ( Constants . UrlAutomationPractice ) ;
5861 var productList = new ProductListForm ( ) ;
@@ -68,12 +71,10 @@ public void Should_BeAbleSetFocus_WithJsActions()
6871
6972 [ Ignore ( "should be updated" ) ]
7073 [ Test ]
71- public void Should_BeAbleCheckIsElementOnScreen_WithJsActions ( )
74+ public void Should_BePossibleTo_CheckIsElementOnScreen ( )
7275 {
73- var welcomeForm = new WelcomeForm ( ) ;
74- welcomeForm . SelectExample ( AvailableExample . Hovers ) ;
75-
7676 var hoversForm = new HoversForm ( ) ;
77+ hoversForm . Open ( ) ;
7778 Assert . Multiple ( ( ) =>
7879 {
7980 Assert . IsFalse ( hoversForm . GetHiddenElement ( HoverExample . First , ElementState . ExistsInAnyState ) . JsActions . IsElementOnScreen ( ) ,
@@ -84,84 +85,80 @@ public void Should_BeAbleCheckIsElementOnScreen_WithJsActions()
8485 }
8586
8687 [ Test ]
87- public void Should_BeAbleSetValue_WithJsActions ( )
88+ public void Should_BePossibleTo_SetValue ( )
8889 {
89- const string text = "text" ;
90- var welcomeForm = new WelcomeForm ( ) ;
91- welcomeForm . SelectExample ( AvailableExample . KeyPresses ) ;
92-
9390 var keyPressesForm = new KeyPressesForm ( ) ;
94- keyPressesForm . TxtInput . JsActions . SetValue ( text ) ;
95- var actualText = keyPressesForm . TxtInput . Value ;
91+ keyPressesForm . Open ( ) ;
92+ var text = "text" ;
93+ keyPressesForm . InputTextBox . JsActions . SetValue ( text ) ;
94+ var actualText = keyPressesForm . InputTextBox . Value ;
9695 Assert . AreEqual ( text , actualText , $ "Text should be '{ text } ' after setting value via JS") ;
9796 }
9897
9998 [ Test ]
100- public void Should_BeAbleGetText_WithJsActions ( )
99+ public void Should_BePossibleTo_GetElementText ( )
101100 {
102101 var welcomeForm = new WelcomeForm ( ) ;
103- Assert . AreEqual ( WelcomeForm . SubTitle , welcomeForm . LblSubTitle . JsActions . GetElementText ( ) ,
102+ welcomeForm . Open ( ) ;
103+ Assert . AreEqual ( WelcomeForm . SubTitle , welcomeForm . SubTitleLabel . JsActions . GetElementText ( ) ,
104104 $ "Sub title should be { WelcomeForm . SubTitle } ") ;
105105 }
106106
107107 [ Test ]
108- public void Should_BeAbleGetLocator_WithJsActions ( )
108+ public void Should_BePossibleTo_GetXPathLocator ( )
109109 {
110- const string expectedLocator = "/html/body/DIV[2]/DIV[1]/H2[1]" ;
111110 var welcomeForm = new WelcomeForm ( ) ;
112- var actualLocator = welcomeForm . LblSubTitle . JsActions . GetXPath ( ) ;
111+ welcomeForm . Open ( ) ;
112+ var actualLocator = welcomeForm . SubTitleLabel . JsActions . GetXPath ( ) ;
113+ var expectedLocator = "/html/body/DIV[2]/DIV[1]/H2[1]" ;
113114 Assert . AreEqual ( expectedLocator , actualLocator , $ "Locator of sub title should be { expectedLocator } ") ;
114115 }
115116
116117 [ Test ]
117- public void Should_BeAbleGetCoordinates_WithJsActions ( )
118+ public void Should_BePossibleTo_GetViewPortCoordinates ( )
118119 {
119120 var welcomeForm = new WelcomeForm ( ) ;
120- var actualPoint = welcomeForm . LblSubTitle . JsActions . GetViewPortCoordinates ( ) ;
121+ welcomeForm . Open ( ) ;
122+ var actualPoint = welcomeForm . SubTitleLabel . JsActions . GetViewPortCoordinates ( ) ;
121123 Assert . IsFalse ( actualPoint . IsEmpty , "Coordinates of Sub title should not be empty" ) ;
122124 }
123125
126+ [ Ignore ( "should be updated" ) ]
124127 [ Test ]
125- public void Should_BeAbleScrollIntoView_WithJsActions ( )
128+ public void Should_BePossibleTo_ScrollIntoView ( )
126129 {
127- var welcomeForm = new WelcomeForm ( ) ;
128- welcomeForm . SelectExample ( AvailableExample . InfiniteScroll ) ;
129-
130130 var infiniteScrollForm = new InfiniteScrollForm ( ) ;
131- var defaultCount = infiniteScrollForm . LblExamples . Count ;
132- infiniteScrollForm . GetLastExample ( ) . JsActions . ScrollIntoView ( ) ;
131+ infiniteScrollForm . Open ( ) ;
132+ var defaultCount = infiniteScrollForm . ExampleLabels . Count ;
133+ infiniteScrollForm . LastExampleLabel . JsActions . ScrollIntoView ( ) ;
133134 Assert . DoesNotThrow (
134- ( ) => ConditionalWait . WaitForTrue ( ( ) => infiniteScrollForm . LblExamples . Count > defaultCount ) ,
135+ ( ) => ConditionalWait . WaitForTrue ( ( ) => infiniteScrollForm . ExampleLabels . Count > defaultCount ) ,
135136 "Some examples should be added after scroll" ) ;
136137 }
137138
138139 [ Ignore ( "should be updated" ) ]
139140 [ Test ]
140- public void Should_BeAbleScrollBy_WithJsActions ( )
141+ public void Should_BePossibleTo_ScrollBy ( )
141142 {
142- var welcomeForm = new WelcomeForm ( ) ;
143- welcomeForm . SelectExample ( AvailableExample . InfiniteScroll ) ;
144-
145143 var infiniteScrollForm = new InfiniteScrollForm ( ) ;
146- var defaultCount = infiniteScrollForm . LblExamples . Count ;
147- infiniteScrollForm . GetLastExample ( ) . JsActions . ScrollBy ( 100000 , 100000 ) ;
144+ infiniteScrollForm . Open ( ) ;
145+ var defaultCount = infiniteScrollForm . ExampleLabels . Count ;
146+ infiniteScrollForm . LastExampleLabel . JsActions . ScrollBy ( 100000 , 100000 ) ;
148147 Assert . DoesNotThrow (
149- ( ) => ConditionalWait . WaitForTrue ( ( ) => infiniteScrollForm . LblExamples . Count > defaultCount ) ,
148+ ( ) => ConditionalWait . WaitForTrue ( ( ) => infiniteScrollForm . ExampleLabels . Count > defaultCount ) ,
150149 "Some examples should be added after scroll" ) ;
151150 }
152151
153152 [ Ignore ( "should be updated" ) ]
154153 [ Test ]
155- public void Should_BeAbleToTheCenter_WithJsActions ( )
154+ public void Should_BePossibleTo_ScrollToTheCenter ( )
156155 {
157- var welcomeForm = new WelcomeForm ( ) ;
158- welcomeForm . SelectExample ( AvailableExample . InfiniteScroll ) ;
159-
160156 var infiniteScrollForm = new InfiniteScrollForm ( ) ;
161- var defaultCount = infiniteScrollForm . LblExamples . Count ;
162- infiniteScrollForm . GetLastExample ( ) . JsActions . ScrollToTheCenter ( ) ;
157+ infiniteScrollForm . Open ( ) ;
158+ var defaultCount = infiniteScrollForm . ExampleLabels . Count ;
159+ infiniteScrollForm . LastExampleLabel . JsActions . ScrollToTheCenter ( ) ;
163160 Assert . DoesNotThrow (
164- ( ) => ConditionalWait . WaitForTrue ( ( ) => infiniteScrollForm . LblExamples . Count > defaultCount ) ,
161+ ( ) => ConditionalWait . WaitForTrue ( ( ) => infiniteScrollForm . ExampleLabels . Count > defaultCount ) ,
165162 "Some examples should be added after scroll" ) ;
166163 }
167164 }
0 commit comments