Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPL-8: QAF Migration - WebhooksPage updated #9099

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ import org.rundeck.util.gui.pages.BasePage
class WebhooksPage extends BasePage{

String loadPath
By whEditBy = By.id('wh-edit')
By whHeaderBy = By.id('wh-header')
By dropdownMenu = By.className("dropdown-menu")
By modalContent = By.className("modal-content")
By alertDangerBy = By.className("alert-danger")
By createWebhookButtonBy = By.cssSelector(".btn.btn-primary.btn-full")
By handlerConfigTabBy = By.xpath("//*[@class='rdtabs__tab-inner' and contains(text(),'Handler Configuration')]")
By chooseWebhookPluginBy = By.xpath("//button//*[contains(text(),'Choose Webhook Plugin')]")
By trashButtonBy = By.xpath("//div[contains(@id,'rule-')]//i[contains(@class,'fa-trash')]")
By okButtonBy = By.xpath("//button[contains(.,'OK')]")
By saveButtonBy = By.xpath("//button[contains(.,'Save')]")

WebhooksPage(SeleniumContext context) {
super(context)
Expand All @@ -18,6 +28,30 @@ class WebhooksPage extends BasePage{
el createWebhookButtonBy
}

WebElement getHandlerConfigTab() {
return el(whEditBy).findElement(handlerConfigTabBy)
}

WebElement getChooseWebhookPlugin() {
return el(whEditBy).findElement(chooseWebhookPluginBy)
}

WebElement getTrashButton() {
return el(whEditBy).findElement(trashButtonBy)
}

WebElement getOkButton() {
return el(modalContent).findElement(okButtonBy)
}

WebElement getSaveButton() {
return el(whHeaderBy).findElement(saveButtonBy)
}

WebElement getAlertDanger() {
return el(alertDangerBy)
}

void validatePage() {
if (!driver.currentUrl.contains(loadPath)) {
throw new IllegalStateException("Not on execution show page: " + driver.currentUrl)
Expand Down