From 766331f657f74ef078a1fdd25e2bd5419f27999e Mon Sep 17 00:00:00 2001 From: Alexander Abarca Date: Tue, 30 Apr 2024 18:15:18 -0400 Subject: [PATCH] Added changes to Webhook page --- .../gui/pages/webhooks/WebhooksPage.groovy | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/functional-test/src/test/groovy/org/rundeck/util/gui/pages/webhooks/WebhooksPage.groovy b/functional-test/src/test/groovy/org/rundeck/util/gui/pages/webhooks/WebhooksPage.groovy index f3af305314e..2524e3b2956 100644 --- a/functional-test/src/test/groovy/org/rundeck/util/gui/pages/webhooks/WebhooksPage.groovy +++ b/functional-test/src/test/groovy/org/rundeck/util/gui/pages/webhooks/WebhooksPage.groovy @@ -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) @@ -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)