Skip to content

Commit

Permalink
πŸ‘½ : change duration type
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit committed Aug 5, 2022
1 parent 1e9e5a9 commit 70ee36e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/test/java/io/gaia_app/e2e/pages/DashboardPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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){

Expand All @@ -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))

Expand Down
5 changes: 3 additions & 2 deletions src/test/java/io/gaia_app/e2e/pages/LoginPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

Expand All @@ -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"))
}

Expand Down
3 changes: 2 additions & 1 deletion src/test/java/io/gaia_app/e2e/pages/ModulesPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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){

Expand All @@ -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"))
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/io/gaia_app/e2e/pages/UsersPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<WebElement>

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"))
Expand Down

0 comments on commit 70ee36e

Please sign in to comment.