Skip to content

Commit 415f2b0

Browse files
Merge pull request cdapio#265 from cloudsufi/e2e_errordetailschange
e2e error details fix
2 parents c48a32e + d61405d commit 415f2b0

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

src/main/java/io/cdap/e2e/pages/actions/CdfStudioActions.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,19 +537,16 @@ public static void importPipeline(String filePath) throws URISyntaxException {
537537

538538
/**
539539
* Wait till the Pipeline's preview run status banner is displayed within error details
540-
* Timeout: {@link ConstantsUtil#PIPELINE_PREVIEW_TIMEOUT_SECONDS}
541540
*/
542541
public static void waitTillPipelinePreviewRunCompletesWithError() {
543-
waitTillPipelinePreviewRunCompletesWithErrorDetails(ConstantsUtil.PIPELINE_PREVIEW_TIMEOUT_SECONDS);
542+
waitTillPipelinePreviewRunCompletesWithErrorDetails();
544543
}
545544

546545
/**
547-
* Wait till the Pipeline's preview run status banner is displayed with error within the given timeout
548-
*
549-
* @param timeoutInSeconds timeout
546+
* Wait till the Pipeline's preview run status banner is displayed with error text on banner
550547
*/
551-
public static void waitTillPipelinePreviewRunCompletesWithErrorDetails(long timeoutInSeconds) {
552-
WaitHelper.waitForElementToBeDisplayed(CdfStudioLocators.errorDetailsBannerText, timeoutInSeconds);
548+
public static void waitTillPipelinePreviewRunCompletesWithErrorDetails() {
549+
WaitHelper.waitForElementToBePresent(CdfStudioLocators.errorDetailsTextOnBanner());
553550
}
554551

555552
/**

src/main/java/io/cdap/e2e/pages/actions/WranglerActions.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package io.cdap.e2e.pages.actions;
1717

1818
import io.cdap.e2e.pages.locators.WranglerLocators;
19+
import io.cdap.e2e.utils.ConstantsUtil;
1920
import io.cdap.e2e.utils.ElementHelper;
2021
import io.cdap.e2e.utils.PluginPropertyUtils;
2122
import 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
}

src/main/java/io/cdap/e2e/pages/locators/CdfStudioLocators.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,8 @@ public static WebElement importPipelineInputTag() {
292292

293293
@FindBy(how = How.XPATH, using = "//*[@data-testid='features-pipelineDetails-errorDetails-viewLogsButton']")
294294
public static WebElement errorStatusBannerViewLogsButton;
295+
296+
public static By errorDetailsTextOnBanner() {
297+
return By.xpath("//*[@data-testid='features-pipelineDetails-errorDetails-errorCountMessage']");
298+
}
295299
}

0 commit comments

Comments
 (0)