Skip to content

Commit

Permalink
Merge pull request cdapio#264 from cloudsufi/e2e_errordetailschange
Browse files Browse the repository at this point in the history
error details change
  • Loading branch information
itsankit-google authored Jan 31, 2025
2 parents 96b0de5 + 098c202 commit c48a32e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/main/java/io/cdap/e2e/pages/actions/CdfStudioActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -534,4 +534,42 @@ public static void importPipeline(String filePath) throws URISyntaxException {
FileImportUtil.uploadFile(CdfStudioLocators.importPipelineInputTag(), filePath);
clickOnFixAllButtonIfDisplayed();
}

/**
* Wait till the Pipeline's preview run status banner is displayed within error details
* Timeout: {@link ConstantsUtil#PIPELINE_PREVIEW_TIMEOUT_SECONDS}
*/
public static void waitTillPipelinePreviewRunCompletesWithError() {
waitTillPipelinePreviewRunCompletesWithErrorDetails(ConstantsUtil.PIPELINE_PREVIEW_TIMEOUT_SECONDS);
}

/**
* Wait till the Pipeline's preview run status banner is displayed with error within the given timeout
*
* @param timeoutInSeconds timeout
*/
public static void waitTillPipelinePreviewRunCompletesWithErrorDetails(long timeoutInSeconds) {
WaitHelper.waitForElementToBeDisplayed(CdfStudioLocators.errorDetailsBannerText, timeoutInSeconds);
}

/**
* Click on the View Details button on the Pipeline preview error banner
*/
public static void clickOnViewDetailsButtonOnErrorBanner() {
ElementHelper.clickOnElement(CdfStudioLocators.errorDetailsBannerViewDetailsButton);
}

/**
* Click on the Close button on the Pipeline preview error banner
*/
public static void clickOnCloseButtonOnErrorBanner() {
ElementHelper.clickOnElement(CdfStudioLocators.errorDetailsBannerCloseButton);
}

/**
* Click on the View Logs button on the Pipeline preview error banner
*/
public static void clickOnViewLogsButtonOnErrorBanner() {
ElementHelper.clickOnElement(CdfStudioLocators.errorStatusBannerViewLogsButton);
}
}
12 changes: 12 additions & 0 deletions src/main/java/io/cdap/e2e/pages/locators/CdfStudioLocators.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,16 @@ public static WebElement importPipelineInputTag() {
return SeleniumDriver.getDriver().findElement(By.xpath
("//input[@id='resource-center-import-pipeline']"));
}

@FindBy(how = How.XPATH, using = "//*[@data-testid='features-pipelineDetails-errorDetails-errorCountMessage']")
public static WebElement errorDetailsBannerText;

@FindBy(how = How.XPATH, using = "//*[@data-testid='features-pipelineDetails-errorDetails-closeButton']")
public static WebElement errorDetailsBannerCloseButton;

@FindBy(how = How.XPATH, using = "//*[@data-testid='features-pipelineDetails-errorDetails-viewDetailsButton']")
public static WebElement errorDetailsBannerViewDetailsButton;

@FindBy(how = How.XPATH, using = "//*[@data-testid='features-pipelineDetails-errorDetails-viewLogsButton']")
public static WebElement errorStatusBannerViewLogsButton;
}
20 changes: 20 additions & 0 deletions src/main/java/stepsdesign/PipelineSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,4 +767,24 @@ public void enterKeyForPluginPropertyWithValue(String pluginProperty, String val
public void enterValueInTableKey(String pluginProperty, String value) {
CdfPluginPropertiesActions.enterValueInTableKey(pluginProperty, value);
}

@Then("Wait till pipeline preview is in running state and check if any error occurs")
public void waitTillPipelinePreviewIsInRunningStateAndCheckIfAnyErrorOccurs() {
CdfStudioActions.waitTillPipelinePreviewRunCompletesWithError();
}

@Then("Click on view details button of pipeline preview error")
public void clickOnViewDetailsButtonOfPipelinePreviewError() {
CdfStudioActions.clickOnViewDetailsButtonOnErrorBanner();
}

@Then("Click on close button of pipeline preview error")
public void clickOnCloseButtonOfPipelinePreviewError() {
CdfStudioActions.clickOnCloseButtonOnErrorBanner();
}

@Then("Click on view logs button of pipeline preview error")
public void clickOnViewLogsOfPipelinePreviewError() {
CdfStudioActions.clickOnViewLogsButtonOnErrorBanner();
}
}

0 comments on commit c48a32e

Please sign in to comment.