From 70ee36e78d1a27981efec72c74e1a4a6f28068bf Mon Sep 17 00:00:00 2001 From: Julien WITTOUCK Date: Fri, 5 Aug 2022 18:02:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BD=20:=20change=20duration=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/io/gaia_app/e2e/pages/DashboardPage.kt | 3 ++- src/test/java/io/gaia_app/e2e/pages/LoginPage.kt | 5 +++-- src/test/java/io/gaia_app/e2e/pages/ModulesPage.kt | 3 ++- src/test/java/io/gaia_app/e2e/pages/UsersPage.kt | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/test/java/io/gaia_app/e2e/pages/DashboardPage.kt b/src/test/java/io/gaia_app/e2e/pages/DashboardPage.kt index 32ff9a444..7876cc652 100644 --- a/src/test/java/io/gaia_app/e2e/pages/DashboardPage.kt +++ b/src/test/java/io/gaia_app/e2e/pages/DashboardPage.kt @@ -5,6 +5,7 @@ import org.openqa.selenium.WebDriver import org.openqa.selenium.WebElement import org.openqa.selenium.support.ui.ExpectedConditions import org.openqa.selenium.support.ui.WebDriverWait +import java.time.Duration class DashboardPage (private val webDriver: WebDriver){ @@ -15,7 +16,7 @@ class DashboardPage (private val webDriver: WebDriver){ } fun waitForPageLoaded() { - val wait = WebDriverWait(webDriver, 10) + val wait = WebDriverWait(webDriver, Duration.ofSeconds(10)) wait.until(ExpectedConditions.titleIs("Gaia - Dashboard")) wait.until(ExpectedConditions.numberOfElementsToBe(By.className("b-overlay"), 0)) diff --git a/src/test/java/io/gaia_app/e2e/pages/LoginPage.kt b/src/test/java/io/gaia_app/e2e/pages/LoginPage.kt index 612f64f38..9c98531b7 100644 --- a/src/test/java/io/gaia_app/e2e/pages/LoginPage.kt +++ b/src/test/java/io/gaia_app/e2e/pages/LoginPage.kt @@ -5,11 +5,12 @@ import org.openqa.selenium.WebElement import org.openqa.selenium.support.FindBy import org.openqa.selenium.support.ui.ExpectedConditions.titleIs import org.openqa.selenium.support.ui.WebDriverWait +import java.time.Duration class LoginPage(private val webDriver: WebDriver) { init { - val wait = WebDriverWait(webDriver, 10) + val wait = WebDriverWait(webDriver, Duration.ofSeconds(10)) wait.until(titleIs("Gaia - A terraform UI - Login")) } @@ -28,7 +29,7 @@ class LoginPage(private val webDriver: WebDriver) { submitButton.click() // wait for successful login - val wait = WebDriverWait(webDriver, 10) + val wait = WebDriverWait(webDriver, Duration.ofSeconds(10)) wait.until(titleIs("Gaia - Dashboard")) } diff --git a/src/test/java/io/gaia_app/e2e/pages/ModulesPage.kt b/src/test/java/io/gaia_app/e2e/pages/ModulesPage.kt index fc8639b5a..48baa286c 100644 --- a/src/test/java/io/gaia_app/e2e/pages/ModulesPage.kt +++ b/src/test/java/io/gaia_app/e2e/pages/ModulesPage.kt @@ -5,6 +5,7 @@ import org.openqa.selenium.WebDriver import org.openqa.selenium.WebElement import org.openqa.selenium.support.ui.ExpectedConditions import org.openqa.selenium.support.ui.WebDriverWait +import java.time.Duration class ModulesPage (private val webDriver: WebDriver){ @@ -19,7 +20,7 @@ class ModulesPage (private val webDriver: WebDriver){ fun modulesCount() = this.moduleCards.size fun waitForPageLoaded() { - val wait = WebDriverWait(webDriver, 10) + val wait = WebDriverWait(webDriver, Duration.ofSeconds(10)) wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("moduleCard"))) moduleCards = webDriver.findElements(By.className("moduleCard")) diff --git a/src/test/java/io/gaia_app/e2e/pages/UsersPage.kt b/src/test/java/io/gaia_app/e2e/pages/UsersPage.kt index d727490e6..9e79c10ab 100644 --- a/src/test/java/io/gaia_app/e2e/pages/UsersPage.kt +++ b/src/test/java/io/gaia_app/e2e/pages/UsersPage.kt @@ -6,20 +6,21 @@ import org.openqa.selenium.WebElement import org.openqa.selenium.support.ui.ExpectedConditions import org.openqa.selenium.support.ui.ExpectedConditions.titleIs import org.openqa.selenium.support.ui.WebDriverWait +import java.time.Duration class UsersPage(private val webDriver: WebDriver) { private lateinit var usersRows: List init { - val wait = WebDriverWait(webDriver, 10) + val wait = WebDriverWait(webDriver, Duration.ofSeconds(10)) wait.until(titleIs("Gaia - Users")) } fun usersCount() = usersRows.size fun waitForPageLoaded() { - val wait = WebDriverWait(webDriver, 10) + val wait = WebDriverWait(webDriver, Duration.ofSeconds(10)) wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("usersTable"))) val usersTable = webDriver.findElement(By.id("usersTable"))