-
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
Showing
5 changed files
with
149 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.codeka.gaia.e2e | ||
|
||
import org.openqa.selenium.WebDriver | ||
import org.openqa.selenium.WebElement | ||
import org.openqa.selenium.support.FindBy | ||
|
||
class DashboardPage (val webDriver: WebDriver){ | ||
|
||
init { | ||
if(! webDriver.title.equals("Gaia - A terraform UI")){ | ||
throw IllegalStateException("This is not the dashboard page. Current page is ${webDriver.title}") | ||
} | ||
} | ||
|
||
@FindBy(className= "modules_count") | ||
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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.PageFactory | ||
|
||
class ModulePage(webDriver: WebDriver) { | ||
|
||
init { | ||
if(! webDriver.currentUrl.contains("/modules/")){ | ||
throw IllegalStateException("This is not the module page. Current page is ${webDriver.currentUrl}") | ||
} | ||
} | ||
|
||
@FindBy(id="module.name") | ||
private lateinit var nameInput: WebElement | ||
|
||
@FindBy(id="module.cliVersion") | ||
private lateinit var cliVersionInput: WebElement | ||
|
||
@FindBy(id="module.description") | ||
private lateinit var descriptionInput: WebElement | ||
|
||
fun moduleName() : String = nameInput.getAttribute("value") | ||
|
||
fun moduleDescription() : String = descriptionInput.getAttribute("value") | ||
|
||
fun cliVersion() : String = cliVersionInput.getAttribute("value") | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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.FindAll | ||
import org.openqa.selenium.support.FindBy | ||
import org.openqa.selenium.support.FindBys | ||
|
||
class ModulesPage (webDriver: WebDriver){ | ||
|
||
private var moduleCards: List<WebElement> | ||
|
||
init { | ||
if(! webDriver.title.equals("Gaia - Modules")){ | ||
throw IllegalStateException("This is not the modules page. Current page is ${webDriver.title}") | ||
} | ||
moduleCards = webDriver.findElements(By.className("card")); | ||
} | ||
|
||
fun modulesCount() = this.moduleCards.size | ||
|
||
} |
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