-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81f7411
commit 0cc5419
Showing
7 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,43 @@ | ||
package io.codeka.gaia.e2e | ||
|
||
import org.openqa.selenium.By | ||
import org.openqa.selenium.WebDriver | ||
import org.openqa.selenium.WebElement | ||
import org.openqa.selenium.support.FindBy | ||
import org.openqa.selenium.support.ui.ExpectedCondition | ||
import org.openqa.selenium.support.ui.ExpectedConditions | ||
import org.openqa.selenium.support.ui.WebDriverWait | ||
|
||
class DashboardPage (val webDriver: WebDriver){ | ||
|
||
init { | ||
if(! webDriver.title.equals("Gaia - A terraform UI")){ | ||
if(! webDriver.currentUrl.endsWith("/dashboard")){ | ||
throw IllegalStateException("This is not the dashboard page. Current page is ${webDriver.title}") | ||
} | ||
} | ||
|
||
@FindBy(className= "modules_count") | ||
fun waitForPageLoaded() { | ||
val wait = WebDriverWait(webDriver, 10) | ||
wait.until(ExpectedConditions.titleIs("Gaia - Dashboard")) | ||
wait.until(ExpectedConditions.numberOfElementsToBe(By.className("b-overlay"), 0)) | ||
|
||
// getting widget values | ||
wait.until(ExpectedConditions.numberOfElementsToBe(By.className("widget-value"), 3)) | ||
|
||
val countElements = webDriver.findElements(By.className("widget-value")) | ||
modulesCountElement = countElements[0] | ||
stacksCountElement = countElements[1] | ||
stacksToUpdateCountElement = countElements[2] | ||
} | ||
|
||
private lateinit var modulesCountElement: WebElement | ||
|
||
@FindBy(className="stacks_count") | ||
private lateinit var stacksCountElement: WebElement | ||
|
||
@FindBy(className = "stacks_toUpdate_count") | ||
private lateinit var stacksToUpdateCountElement: WebElement | ||
|
||
fun modulesCount() = this.modulesCountElement.text.toInt() | ||
fun stacksCount() = this.stacksCountElement.text.toInt() | ||
fun stacksToUpdateCount() = this.stacksToUpdateCountElement.text.toInt() | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ class JobPage(webDriver: WebDriver) { | |
|
||
fun jobDetailTitle() : String = jobDetailTitle.text | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters