This is an automated email from the ASF dual-hosted git repository.
chanholee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push:
new 776e29c89f [ZEPPELIN-6398] Fix Selenium-based integration tests
776e29c89f is described below
commit 776e29c89f4e1d47a89bd09c9a467acb0dce3767
Author: ChanHo Lee <[email protected]>
AuthorDate: Thu Feb 26 00:19:36 2026 +0900
[ZEPPELIN-6398] Fix Selenium-based integration tests
### What is this PR for?
Selenium-based integration tests have been failing recently.
There were several issues:
- The Chrome/Edge driver had a bug related to calling window.maximize().
Since a fixed window size is sufficient for our tests, I replaced it with a
method that sets a fixed window size instead.
- The element wait logic was not properly separated by intent, which caused
unintended test failures. I refactored the wait methods to distinguish between
presence, visibility, and clickability.
- Browser built-in features such as the password manager could trigger
alert dialogs that block test execution, so these have been disabled.
Previously, we switched to EdgeDriver (also Chromium-based) to work around
the window.maximize() bug, but the same issue occurred. Therefore, I reverted
back to ChromeDriver.
### What type of PR is it?
Bug Fix
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6398
### How should this be tested?
- Check `test-selenium-with-spark-module-for-spark-3-5` job
### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Closes #5160 from tbonelee/fix-selenium-edge.
Signed-off-by: ChanHo Lee <[email protected]>
---
.github/workflows/frontend.yml | 18 ----------
.../org/apache/zeppelin/AbstractZeppelinIT.java | 39 ++++++++++++----------
.../java/org/apache/zeppelin/WebDriverManager.java | 10 +++++-
.../zeppelin/integration/AuthenticationIT.java | 30 ++++++++---------
.../integration/InterpreterModeActionsIT.java | 34 +++++++++----------
.../zeppelin/integration/PersonalizeActionsIT.java | 26 +++++++--------
.../apache/zeppelin/integration/ZeppelinIT.java | 4 +--
7 files changed, 77 insertions(+), 84 deletions(-)
diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml
index 2f99846e69..7eecf57638 100644
--- a/.github/workflows/frontend.yml
+++ b/.github/workflows/frontend.yml
@@ -149,29 +149,11 @@ jobs:
defaults:
run:
shell: bash -l {0}
- env:
- ZEPPELIN_SELENIUM_BROWSER: "edge"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
- - name: Install Microsoft Edge
- run: |
- curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo
gpg --dearmor -o /usr/share/keyrings/microsoft-edge.gpg
- echo "deb [arch=amd64
signed-by=/usr/share/keyrings/microsoft-edge.gpg]
https://packages.microsoft.com/repos/edge stable main" | sudo tee
/etc/apt/sources.list.d/microsoft-edge.list
- sudo apt-get update
- sudo apt-get install -y microsoft-edge-stable
- - name: Install msedgedriver
- run: |
- EDGE_VERSION=$(microsoft-edge --version | awk '{print $3}')
- wget -q
"https://msedgedriver.microsoft.com/${EDGE_VERSION}/edgedriver_linux64.zip" -O
edgedriver.zip
- unzip -q edgedriver.zip
- sudo mv msedgedriver /usr/local/bin/
- sudo chmod +x /usr/local/bin/msedgedriver
- rm edgedriver.zip
- - name: Print Edge version
- run: msedgedriver --version
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
diff --git
a/zeppelin-integration/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
b/zeppelin-integration/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
index cfffe5051d..6d2746eeab 100644
---
a/zeppelin-integration/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
+++
b/zeppelin-integration/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
@@ -18,12 +18,10 @@
package org.apache.zeppelin;
-import com.google.common.base.Function;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.time.Duration;
-import java.time.temporal.ChronoUnit;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
@@ -38,8 +36,6 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.FluentWait;
-import org.openqa.selenium.support.ui.Wait;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,15 +51,13 @@ abstract public class AbstractZeppelinIT {
protected static final long MAX_PARAGRAPH_TIMEOUT_SEC = 120;
protected void authenticationUser(String userName, String password) {
- pollingWait(
+ clickableWait(
By.xpath("//div[contains(@class,
'navbar-collapse')]//li//button[contains(.,'Login')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
- ZeppelinITUtils.sleep(1000, false);
-
- pollingWait(By.xpath("//*[@id='userName']"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys(userName);
- pollingWait(By.xpath("//*[@id='password']"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys(password);
- pollingWait(
+ visibilityWait(By.xpath("//*[@id='userName']"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys(userName);
+ visibilityWait(By.xpath("//*[@id='password']"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys(password);
+ clickableWait(
By.xpath("//*[@id='loginModalContent']//button[contains(.,'Login')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
@@ -132,7 +126,7 @@ abstract public class AbstractZeppelinIT {
protected boolean waitForParagraph(final int paragraphNo, final String
state) {
By locator = By.xpath(getParagraphXPath(paragraphNo)
+ "//div[contains(@class, 'control')]//span[2][contains(.,'" + state +
"')]");
- WebElement element = pollingWait(locator, MAX_PARAGRAPH_TIMEOUT_SEC);
+ WebElement element = visibilityWait(locator, MAX_PARAGRAPH_TIMEOUT_SEC);
return element.isDisplayed();
}
@@ -145,7 +139,7 @@ abstract public class AbstractZeppelinIT {
protected boolean waitForText(final String txt, final By locator) {
try {
- WebElement element = pollingWait(locator, MAX_BROWSER_TIMEOUT_SEC);
+ WebElement element = visibilityWait(locator, MAX_BROWSER_TIMEOUT_SEC);
return txt.equals(element.getText());
} catch (TimeoutException e) {
return false;
@@ -153,12 +147,21 @@ abstract public class AbstractZeppelinIT {
}
protected WebElement pollingWait(final By locator, final long timeWait) {
- Wait<WebDriver> wait = new FluentWait<>(manager.getWebDriver())
- .withTimeout(Duration.of(timeWait, ChronoUnit.SECONDS))
- .pollingEvery(Duration.of(1, ChronoUnit.SECONDS))
- .ignoring(NoSuchElementException.class);
+ WebDriverWait wait = new WebDriverWait(manager.getWebDriver(),
+ Duration.ofSeconds(timeWait));
+ return wait.until(ExpectedConditions.presenceOfElementLocated(locator));
+ }
+
+ protected WebElement visibilityWait(final By locator, final long timeWait) {
+ WebDriverWait wait = new WebDriverWait(manager.getWebDriver(),
+ Duration.ofSeconds(timeWait));
+ return wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
+ }
- return wait.until((Function<WebDriver, WebElement>) driver ->
driver.findElement(locator));
+ protected WebElement clickableWait(final By locator, final long timeWait) {
+ WebDriverWait wait = new WebDriverWait(manager.getWebDriver(),
+ Duration.ofSeconds(timeWait));
+ return wait.until(ExpectedConditions.elementToBeClickable(locator));
}
protected void createNewNote() {
@@ -193,7 +196,7 @@ abstract public class AbstractZeppelinIT {
}
protected void clickAndWait(final By locator) {
- WebElement element = pollingWait(locator, MAX_IMPLICIT_WAIT);
+ WebElement element = clickableWait(locator, MAX_IMPLICIT_WAIT);
try {
element.click();
ZeppelinITUtils.sleep(1000, false);
diff --git
a/zeppelin-integration/src/test/java/org/apache/zeppelin/WebDriverManager.java
b/zeppelin-integration/src/test/java/org/apache/zeppelin/WebDriverManager.java
index f2e1c91d80..a6aa0341a2 100644
---
a/zeppelin-integration/src/test/java/org/apache/zeppelin/WebDriverManager.java
+++
b/zeppelin-integration/src/test/java/org/apache/zeppelin/WebDriverManager.java
@@ -30,6 +30,7 @@ import java.util.stream.Stream;
import org.apache.commons.lang3.SystemUtils;
import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
@@ -84,6 +85,12 @@ public class WebDriverManager implements Closeable {
Supplier<WebDriver> chromeDriverSupplier = () -> {
try {
ChromeOptions options = new ChromeOptions();
+ options.addArguments("--disable-search-engine-choice-screen");
+ options.setExperimentalOption("prefs", Map.of(
+ "credentials_enable_service", false,
+ "profile.password_manager_enabled", false,
+ "profile.password_manager_leak_detection", false
+ ));
return new ChromeDriver(options);
} catch (Exception e) {
LOG.error("Exception in WebDriverManager while ChromeDriver ", e);
@@ -169,7 +176,8 @@ public class WebDriverManager implements Closeable {
assertTrue(loaded);
try {
- driver.manage().window().maximize();
+ // Manually setting fixed window size since `maximize()` crashes for
Chrome/Edge driver on linux with xvfb.
+ driver.manage().window().setSize(new Dimension(1920, 1080));
} catch (Exception e) {
LOG.warn("Failed to maximize browser window. Consider using setSize()
instead.", e);
}
diff --git
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
index 64713b8062..0eb414327e 100644
---
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
+++
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/AuthenticationIT.java
@@ -109,11 +109,11 @@ public class AuthenticationIT extends AbstractZeppelinIT {
try {
authenticationUser("admin", "password1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
- assertTrue(pollingWait(By.xpath(
+ assertTrue(visibilityWait(By.xpath(
"//div[@id='main']/div/div[2]"),
MIN_IMPLICIT_WAIT).isDisplayed(), "Check is user has permission to
view this page");
@@ -121,25 +121,25 @@ public class AuthenticationIT extends AbstractZeppelinIT {
authenticationUser("finance1", "finance1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
assertTrue(
- pollingWait(By.xpath("//div[@id='main']/div/div[2]"),
MIN_IMPLICIT_WAIT).isDisplayed(),
+ visibilityWait(By.xpath("//div[@id='main']/div/div[2]"),
MIN_IMPLICIT_WAIT).isDisplayed(),
"Check is user has permission to view this page");
logoutUser("finance1");
authenticationUser("hr1", "hr1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
try {
assertTrue(
- pollingWait(By.xpath("//li[contains(@class,
'ng-toast__message')]//span/span"),
+ visibilityWait(By.xpath("//li[contains(@class,
'ng-toast__message')]//span/span"),
MIN_IMPLICIT_WAIT).isDisplayed(),
"Check is user has permission to view this page");
} catch (TimeoutException e) {
@@ -161,27 +161,27 @@ public class AuthenticationIT extends AbstractZeppelinIT {
String noteId = manager.getWebDriver().getCurrentUrl()
.substring(manager.getWebDriver().getCurrentUrl().lastIndexOf("/") +
1);
- pollingWait(By.xpath("//span[@uib-tooltip='Note permissions']"),
+ clickableWait(By.xpath("//span[@uib-tooltip='Note permissions']"),
MAX_BROWSER_TIMEOUT_SEC).click();
- pollingWait(By.xpath(".//*[@id='selectOwners']/following::span//input"),
+
visibilityWait(By.xpath(".//*[@id='selectOwners']/following::span//input"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("finance ");
- pollingWait(By.xpath(".//*[@id='selectReaders']/following::span//input"),
+
visibilityWait(By.xpath(".//*[@id='selectReaders']/following::span//input"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("finance ");
- pollingWait(By.xpath(".//*[@id='selectRunners']/following::span//input"),
+
visibilityWait(By.xpath(".//*[@id='selectRunners']/following::span//input"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("finance ");
- pollingWait(By.xpath(".//*[@id='selectWriters']/following::span//input"),
+
visibilityWait(By.xpath(".//*[@id='selectWriters']/following::span//input"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("finance ");
- pollingWait(By.xpath("//button[@ng-click='savePermissions()']"),
MAX_BROWSER_TIMEOUT_SEC)
+ visibilityWait(By.xpath("//button[@ng-click='savePermissions()']"),
MAX_BROWSER_TIMEOUT_SEC)
.sendKeys(Keys.ENTER);
-
pollingWait(By.xpath("//div[@class='modal-dialog'][contains(.,'Permissions
Saved ')]" +
+
clickableWait(By.xpath("//div[@class='modal-dialog'][contains(.,'Permissions
Saved ')]" +
"//div[@class='modal-footer']//button[contains(.,'OK')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
logoutUser("finance1");
authenticationUser("hr1", "hr1");
try {
- WebElement element =
pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + noteId
+ "')]"),
+ WebElement element =
visibilityWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" +
noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC);
assertFalse(element.isDisplayed(), "Check is user has permission to
view this note link");
} catch (Exception e) {
@@ -202,7 +202,7 @@ public class AuthenticationIT extends AbstractZeppelinIT {
authenticationUser("finance2", "finance2");
try {
- WebElement element =
pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" + noteId
+ "')]"),
+ WebElement element =
visibilityWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '" +
noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC);
assertTrue(element.isDisplayed(), "Check is user has permission to
view this note link");
} catch (Exception e) {
diff --git
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/InterpreterModeActionsIT.java
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/InterpreterModeActionsIT.java
index 35b98046c3..2dfb87d2e0 100644
---
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/InterpreterModeActionsIT.java
+++
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/InterpreterModeActionsIT.java
@@ -111,10 +111,10 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
try {
//step 1: (admin) login, set 'globally in shared' mode of python
interpreter, logout
authenticationUser("admin", "password1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
- pollingWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
+ visibilityWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("python");
ZeppelinITUtils.sleep(500, false);
clickAndWait(By.xpath("//div[contains(@id,
'python')]//button[contains(@ng-click, 'valueform.$show();\n" +
@@ -206,7 +206,7 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
(new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC)))
.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ user1noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + user1noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
waitForParagraph(2, "FINISHED");
@@ -265,11 +265,11 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
try {
//step 1: (admin) login, set 'Per user in scoped' mode of python
interpreter, logout
authenticationUser("admin", "password1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
- pollingWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
+ visibilityWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("python");
ZeppelinITUtils.sleep(500, false);
@@ -370,7 +370,7 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
(new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC)))
.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ user1noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + user1noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
runParagraph(2);
@@ -467,7 +467,7 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
(new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC)))
.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ user1noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + user1noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
waitForParagraph(1, "FINISHED");
@@ -486,7 +486,7 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
(new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC)))
.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ user2noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + user2noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
runParagraph(1);
@@ -510,11 +510,11 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
//System: Check if the number of python interpreter process is 0
//System: Check if the number of python process is 0
authenticationUser("admin", "password1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
- pollingWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
+ visibilityWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("python");
ZeppelinITUtils.sleep(500, false);
@@ -553,10 +553,10 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
try {
//step 1: (admin) login, set 'Per user in isolated' mode of python
interpreter, logout
authenticationUser("admin", "password1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
- pollingWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
+ visibilityWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("python");
ZeppelinITUtils.sleep(500, false);
clickAndWait(By.xpath("//div[contains(@id,
'python')]//button[contains(@ng-click, 'valueform.$show();\n" +
@@ -653,7 +653,7 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
(new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC)))
.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ user1noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + user1noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
runParagraph(2);
@@ -752,7 +752,7 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
(new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC)))
.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ user1noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + user1noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
waitForParagraph(1, "FINISHED");
@@ -771,7 +771,7 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
(new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC)))
.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ user2noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + user2noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
runParagraph(1);
@@ -795,11 +795,11 @@ public class InterpreterModeActionsIT extends
AbstractZeppelinIT {
//System: Check if the number of python interpreter process is 0
//System: Check if the number of python process is 0
authenticationUser("admin", "password1");
- pollingWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
+ clickableWait(By.xpath("//div/button[contains(@class, 'nav-btn
dropdown-toggle ng-scope')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//li/a[contains(@href, '#/interpreter')]"));
- pollingWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
+ visibilityWait(By.xpath("//input[contains(@ng-model,
'searchInterpreter')]"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("python");
ZeppelinITUtils.sleep(500, false);
diff --git
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java
index bc4e0277c0..ea3ad80e31 100644
---
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java
+++
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/PersonalizeActionsIT.java
@@ -117,7 +117,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
.findElement(
By.xpath(getParagraphXPath(1) + "//div[contains(@class,
'markdown-body')]"))
.getText());
- pollingWait(By.xpath("//*[@id='actionbar']" +
+ clickableWait(By.xpath("//*[@id='actionbar']" +
"//button[contains(@uib-tooltip, 'Switch to personal mode')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//div[@class='modal-dialog'][contains(.,'Do you
want to personalize your analysis?')" +
"]//div[@class='modal-footer']//button[contains(.,'OK')]"));
@@ -129,7 +129,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
wait = new WebDriverWait(manager.getWebDriver(),
Duration.ofSeconds(MAX_BROWSER_TIMEOUT_SEC));
element =
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
assertEquals("Switch to personal mode (owner can change)",
@@ -149,7 +149,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
locator = By.xpath("//*[@id='notebook-names']//a[contains(@href, '" +
noteId + "')]");
element =
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ noteId + "')]"), MAX_BROWSER_TIMEOUT_SEC).click();
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + noteId + "')]"), MAX_BROWSER_TIMEOUT_SEC).click();
}
waitForParagraph(1, "FINISHED");
setParagraphText("After");
@@ -164,7 +164,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
locator = By.xpath("//*[@id='notebook-names']//a[contains(@href, '" +
noteId + "')]");
element =
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ noteId + "')]"), MAX_BROWSER_TIMEOUT_SEC).click();
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + noteId + "')]"), MAX_BROWSER_TIMEOUT_SEC).click();
}
assertEquals("Before", manager.getWebDriver()
.findElement(
@@ -205,12 +205,12 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
"Exception in PersonalizeActionsIT while testGraphAction, status
of 1st Spark Paragraph ");
}
- pollingWait(By.xpath("//*[@id='actionbar']" +
+ clickableWait(By.xpath("//*[@id='actionbar']" +
"//button[contains(@uib-tooltip, 'Switch to personal mode')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//div[@class='modal-dialog'][contains(.,'Do you
want to personalize your analysis?')" +
"]//div[@class='modal-footer']//button[contains(.,'OK')]"));
- pollingWait(By.xpath(getParagraphXPath(1) +
+ clickableWait(By.xpath(getParagraphXPath(1) +
"//button[contains(@uib-tooltip, 'Bar Chart')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
assertEquals("fa fa-bar-chart",
manager.getWebDriver().findElement(By.xpath(getParagraphXPath(1)
@@ -226,7 +226,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
locator = By.xpath("//*[@id='notebook-names']//a[contains(@href, '" +
noteId + "')]");
element =
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
assertEquals("Switch to personal mode (owner can change)",
@@ -238,7 +238,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
+ "//button[contains(@class," +
"'btn btn-default btn-sm ng-binding ng-scope
active')]//i")).getAttribute("class"));
- pollingWait(By.xpath(getParagraphXPath(1) +
+ clickableWait(By.xpath(getParagraphXPath(1) +
"//button[contains(@uib-tooltip, 'Table')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
ZeppelinITUtils.sleep(1000, false);
assertEquals("fa fa-table",
manager.getWebDriver().findElement(By.xpath(getParagraphXPath(1)
@@ -252,7 +252,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
locator = By.xpath("//*[@id='notebook-names']//a[contains(@href, '" +
noteId + "')]");
element =
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
assertEquals("fa fa-bar-chart",
@@ -293,7 +293,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
assertEquals("Before",
manager.getWebDriver().findElement(By.xpath(getParagraphXPath(1) +
"//input[contains(@name, 'name')]")).getAttribute("value"));
- pollingWait(By.xpath("//*[@id='actionbar']" +
+ clickableWait(By.xpath("//*[@id='actionbar']" +
"//button[contains(@uib-tooltip, 'Switch to personal mode')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
clickAndWait(By.xpath("//div[@class='modal-dialog'][contains(.,'Do you
want to personalize your analysis?')" +
"]//div[@class='modal-footer']//button[contains(.,'OK')]"));
@@ -305,7 +305,7 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
locator = By.xpath("//*[@id='notebook-names']//a[contains(@href, '" +
noteId + "')]");
element =
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
if (element.isDisplayed()) {
- pollingWait(By.xpath("//*[@id='notebook-names']//a[contains(@href, '"
+ noteId + "')]"),
+ clickableWait(By.xpath("//*[@id='notebook-names']//a[contains(@href,
'" + noteId + "')]"),
MAX_BROWSER_TIMEOUT_SEC).click();
}
assertEquals("Switch to personal mode (owner can change)",
@@ -316,9 +316,9 @@ public class PersonalizeActionsIT extends
AbstractZeppelinIT {
assertEquals("Before",
manager.getWebDriver().findElement(By.xpath(getParagraphXPath(1) +
"//input[contains(@name, 'name')]")).getAttribute("value"));
- pollingWait(By.xpath(getParagraphXPath(1) +
+ visibilityWait(By.xpath(getParagraphXPath(1) +
"//input[contains(@name, 'name')]"),
MAX_BROWSER_TIMEOUT_SEC).clear();
- pollingWait(By.xpath(getParagraphXPath(1) +
+ visibilityWait(By.xpath(getParagraphXPath(1) +
"//input[contains(@name, 'name')]"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("After");
runParagraph(1);
diff --git
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
index 4d94ce69c7..003f7cc537 100644
---
a/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
+++
b/zeppelin-integration/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
@@ -236,7 +236,7 @@ class ZeppelinIT extends AbstractZeppelinIT {
manager.getWebDriver().findElement(By.xpath("//div[@id='spark']//button[contains(.,'edit')]"))
.sendKeys(Keys.ENTER);
- WebElement depArtifact =
pollingWait(By.xpath("//input[@ng-model='setting.depArtifact']"),
+ WebElement depArtifact =
visibilityWait(By.xpath("//input[@ng-model='setting.depArtifact']"),
MAX_BROWSER_TIMEOUT_SEC);
String artifact = "org.apache.commons:commons-csv:1.1";
depArtifact.sendKeys(artifact);
@@ -279,7 +279,7 @@ class ZeppelinIT extends AbstractZeppelinIT {
interpreterLink.click();
manager.getWebDriver().findElement(By.xpath("//div[@id='spark']//button[contains(.,'edit')]"))
.sendKeys(Keys.ENTER);
- WebElement testDepRemoveBtn =
pollingWait(By.xpath("//tr[descendant::text()[contains(.,'" +
+ WebElement testDepRemoveBtn =
visibilityWait(By.xpath("//tr[descendant::text()[contains(.,'" +
artifact + "')]]/td[3]/button"), MAX_IMPLICIT_WAIT);
testDepRemoveBtn.sendKeys(Keys.ENTER);
manager.getWebDriver().findElement(By.xpath("//div[@id='spark']//form//button[1]")).click();