Skip to content

Commit 4263b75

Browse files
authored
Merge pull request cdapio#292 from cloudsufi/pageLoadTimeoutFix
Updating timeouts and data-testid
2 parents 15aeb92 + e780800 commit 4263b75

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public static void selectRealtimeSourcePlugin(String pluginName) {
105105
*/
106106
public static void verifyPluginNodeIsDisplayedOnCanvas(String pluginName, long timeoutInSeconds) {
107107
logger.info("Waiting for plugin : " + pluginName + " node to displayed on the canvas");
108+
WaitHelper.waitForPageToLoad();
108109
WaitHelper.waitForElementToBeDisplayed(CdfStudioLocators.locatePluginNodeInCanvas(pluginName), timeoutInSeconds);
109110
AssertionHelper.verifyElementDisplayed(CdfStudioLocators.locatePluginNodeInCanvas(pluginName)
110111
, "Plugin : " + pluginName + " node should be displayed on the canvas");
@@ -294,6 +295,7 @@ public static void verifyPipelinePreviewStatusInLogs(String status) {
294295
* Click on the Deploy button
295296
*/
296297
public static void pipelineDeploy() {
298+
WaitHelper.waitForPageToLoad();
297299
ElementHelper.clickOnElement(CdfStudioLocators.pipelineDeploy);
298300
WaitHelper.waitForElementToBeDisplayed(CdfStudioLocators.deployingPipelineMessage);
299301
WaitHelper.waitForElementToBeHidden(
@@ -533,6 +535,7 @@ public static void importPipeline(String filePath) throws URISyntaxException {
533535
WaitHelper.waitForElementToBeDisplayed(CdfStudioLocators.importPipelineButton);
534536
FileImportUtil.uploadFile(CdfStudioLocators.importPipelineInputTag(), filePath);
535537
clickOnFixAllButtonIfDisplayed();
538+
WaitHelper.waitForPageToLoad();
536539
}
537540

538541
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,19 @@ public static WebElement locatePluginGroupCollapsed(String pluginGroupName) {
185185
}
186186

187187
public static WebElement locatePluginNameInList(String pluginName, String pluginGroupName) {
188-
String xpath = "//div[@data-cy='plugin-" + pluginGroupName + "-group']" +
188+
String xpath = "//div[@data-testid='plugin-" + pluginGroupName + "-group']" +
189189
"//div[contains(@class, 'PluginNameContainer')][normalize-space(text()) = '" + pluginName + "' " +
190190
"or translate(normalize-space(text()),' ','') = '" + pluginName + "']";
191191
return SeleniumDriver.getDriver().findElement(By.xpath(xpath));
192192
}
193193

194194
public static WebElement locateSinkPluginNameInList(String pluginName) {
195-
String xpath = "//*[@data-cy='plugin-" + pluginName + "-batchsink']";
195+
String xpath = "//*[@data-testid='plugin-" + pluginName + "-batchsink']";
196196
return SeleniumDriver.getDriver().findElement(By.xpath(xpath));
197197
}
198198

199199
public static WebElement locateRealtimeSourcePluginNameInList(String pluginName) {
200-
String xpath = "//*[@data-cy='plugin-" + pluginName + "-streamingsource']";
200+
String xpath = "//*[@data-testid='plugin-" + pluginName + "-streamingsource']";
201201
return SeleniumDriver.getDriver().findElement(By.xpath(xpath));
202202
}
203203

src/main/java/io/cdap/e2e/utils/ConstantsUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ public class ConstantsUtil {
8787
/**
8888
* PAGE_LOAD_TIMEOUT_SECONDS: To be used as Selenium driver's default page load timeout
8989
*/
90-
public static final int PAGE_LOAD_TIMEOUT_SECONDS = 50;
90+
public static final int PAGE_LOAD_TIMEOUT_SECONDS = 300;
9191
/**
9292
* SMALL_TIMEOUT_SECONDS: To be used as a small static wait (only if needed)
9393
*/
94-
public static final int SMALL_TIMEOUT_SECONDS = 5;
94+
public static final int SMALL_TIMEOUT_SECONDS = 20;
9595
/**
9696
* MEDIUM_TIMEOUT_SECONDS: To be used as a medium static wait (only if needed)
9797
*/

src/main/java/stepsdesign/PipelineSteps.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.cdap.e2e.utils.ConstantsUtil;
2626
import io.cdap.e2e.utils.PluginPropertyUtils;
2727
import io.cdap.e2e.utils.SeleniumHelper;
28+
import io.cdap.e2e.utils.WaitHelper;
2829
import io.cucumber.datatable.DataTable;
2930
import io.cucumber.java.en.Given;
3031
import io.cucumber.java.en.Then;
@@ -89,6 +90,7 @@ public void expandPluginGroup(String pluginGroup) {
8990
@When("Select plugin: {string} from the plugins list as: {string}")
9091
public void selectPlugin(String pluginName, String pluginGroupName) {
9192
logger.info("Click on plugin: " + pluginName + " from the Plugin group: " + pluginGroupName);
93+
WaitHelper.waitForPageToLoad();
9294
CdfStudioActions.selectPluginFromList(pluginName, pluginGroupName);
9395
}
9496

@@ -109,6 +111,7 @@ public void verifyPluginNodeIsDisplayedOnTheCanvas(String pluginName, long timeo
109111

110112
@When("Navigate to the properties page of plugin: {string}")
111113
public void navigateToPluginPropertiesPage(String pluginName) {
114+
WaitHelper.waitForPageToLoad();
112115
CdfStudioActions.navigateToPluginPropertiesPage(pluginName);
113116
}
114117

0 commit comments

Comments
 (0)