1616package io .cdap .e2e .pages .actions ;
1717
1818import io .cdap .e2e .pages .locators .WranglerLocators ;
19+ import io .cdap .e2e .utils .ConstantsUtil ;
1920import io .cdap .e2e .utils .ElementHelper ;
2021import io .cdap .e2e .utils .PluginPropertyUtils ;
2122import io .cdap .e2e .utils .SeleniumDriver ;
@@ -44,7 +45,8 @@ public class WranglerActions {
4445 * @param directive The directive to be selected for the column.
4546 */
4647 public static void selectDirective (String columnName , String directive ) {
47- WaitHelper .waitForPageToLoad ();
48+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
49+ WaitHelper .waitForElementToBeEnabled (WranglerLocators .locateTransformationButton (columnName ));
4850 ElementHelper .clickOnElement (WranglerLocators .locateTransformationButton (columnName ));
4951 String pluginPropertyDirective = PluginPropertyUtils .getPluginPropertyElementTestId (directive );
5052 ElementHelper .clickOnElement (WranglerLocators .locateDirectivesTitle (pluginPropertyDirective ));
@@ -60,7 +62,8 @@ public static void selectDirective(String columnName, String directive) {
6062 */
6163 public static void selectDirectiveAndOption (String columnName , String directive , String option )
6264 throws InterruptedException {
63- WaitHelper .waitForPageToLoad ();
65+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
66+ WaitHelper .waitForElementToBeEnabled (WranglerLocators .locateTransformationButton (columnName ));
6467 ElementHelper .clickOnElement (WranglerLocators .locateTransformationButton (columnName ));
6568 String pluginPropertyDirective = PluginPropertyUtils .getPluginPropertyElementTestId (directive );
6669 String pluginPropertyDirectiveOption = PluginPropertyUtils .getPluginPropertyElementTestId (option );
@@ -145,7 +148,8 @@ public static void selectDirectiveAndOption(String columnName, String directive,
145148 public static void selectDirectiveTypeWithDropdownAndText (String columnName , String directive , String directiveType ,
146149 String text ) throws
147150 InterruptedException {
148- WaitHelper .waitForPageToLoad ();
151+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
152+ WaitHelper .waitForElementToBeEnabled (WranglerLocators .locateTransformationButton (columnName ));
149153 ElementHelper .clickOnElement (WranglerLocators .locateTransformationButton (columnName ));
150154 String pluginPropertyDirective = PluginPropertyUtils .getPluginPropertyElementTestId (directive );
151155 ElementHelper .clickOnElement (WranglerLocators .locateDirectivesTitle (pluginPropertyDirective ));
@@ -192,7 +196,8 @@ public static void selectDirectiveTypeWithDropdownAndText(String columnName, Str
192196 public static void selectDirectiveTypeWithThreeOptions (String columnName , String directive , String directiveType ,
193197 String option )
194198 throws InterruptedException {
195- WaitHelper .waitForPageToLoad ();
199+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
200+ WaitHelper .waitForElementToBeEnabled (WranglerLocators .locateTransformationButton (columnName ));
196201 ElementHelper .clickOnElement (WranglerLocators .locateTransformationButton (columnName ));
197202 String pluginPropertyDirective = PluginPropertyUtils .getPluginPropertyElementTestId (directive );
198203 String pluginPropertyDirectiveOption = PluginPropertyUtils .getPluginPropertyElementTestId (directiveType );
@@ -278,7 +283,8 @@ public static void selectDirectiveTypeWithThreeOptions(String columnName, String
278283 public static void selectDirectiveTypeWithFourOption (String columnName , String directive , String directiveType ,
279284 String option , String text )
280285 throws InterruptedException {
281- WaitHelper .waitForPageToLoad ();
286+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
287+ WaitHelper .waitForElementToBeEnabled (WranglerLocators .locateTransformationButton (columnName ));
282288 ElementHelper .clickOnElement (WranglerLocators .locateTransformationButton (columnName ));
283289 String pluginPropertyDirective = PluginPropertyUtils .getPluginPropertyElementTestId (directive );
284290 String pluginPropertyDirectiveOption = PluginPropertyUtils .getPluginPropertyElementTestId (directiveType );
@@ -328,7 +334,8 @@ public static void selectDirectiveTypeWithFourOption(String columnName, String d
328334 public static void selectDirectiveTypeWithFiveOption (String columnName , String directive , String option1 ,
329335 String option2 , String option3 , String option4 )
330336 throws InterruptedException {
331- WaitHelper .waitForPageToLoad ();
337+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
338+ WaitHelper .waitForElementToBeEnabled (WranglerLocators .locateTransformationButton (columnName ));
332339 ElementHelper .clickOnElement (WranglerLocators .locateTransformationButton (columnName ));
333340 String pluginPropertyDirective = PluginPropertyUtils .getPluginPropertyElementTestId (directive );
334341 ElementHelper .clickOnElement (WranglerLocators .locateDirectivesTitle (pluginPropertyDirective ));
@@ -364,7 +371,8 @@ public static void selectDirectiveTypeWithFiveOption(String columnName, String d
364371 * @throws InterruptedException If interrupted while waiting.
365372 */
366373 public static void enterDirectiveFromCommandLine (String directive ) throws InterruptedException {
367- WaitHelper .waitForPageToLoad ();
374+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
375+ WaitHelper .waitForElementToBeEnabled (WranglerLocators .directiveCommandLine );
368376 WaitHelper .waitForElementToBeClickable (WranglerLocators .directiveCommandLine );
369377 ElementHelper .sendKeys (WranglerLocators .directiveCommandLine , directive );
370378 Actions act = new Actions (SeleniumDriver .getDriver ());
@@ -378,6 +386,7 @@ public static void enterDirectiveFromCommandLine(String directive) throws Interr
378386 * @param column2 The second column's name to select its checkbox.
379387 */
380388 public static void selectCheckboxOnTwoColumns (String column1 , String column2 ) {
389+ WaitHelper .waitForPageToLoad (ConstantsUtil .DEFAULT_TIMEOUT_SECONDS );
381390 ElementHelper .clickOnElement (WranglerLocators .locateCheckboxOfColumn (column1 ));
382391 ElementHelper .clickOnElement (WranglerLocators .locateCheckboxOfColumn (column2 ));
383392 }
0 commit comments