Skip to content

Commit

Permalink
Added changes to Webhook page
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Abarca committed May 9, 2024
1 parent 9d1d55e commit 76ceb51
Showing 1 changed file with 34 additions and 0 deletions.
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

0 comments on commit 76ceb51

Please sign in to comment.