From 6fdfc9879d0dfcecc59daf909edd000e09131ad5 Mon Sep 17 00:00:00 2001 From: labkey-susanh Date: Wed, 24 Jan 2024 15:58:21 -0800 Subject: [PATCH] Add helper for checking state of dismiss button --- src/org/labkey/test/components/bootstrap/ModalDialog.java | 5 +++++ .../labkey/test/components/ui/DeleteConfirmationDialog.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/org/labkey/test/components/bootstrap/ModalDialog.java b/src/org/labkey/test/components/bootstrap/ModalDialog.java index dd970afa2c..cd0008c7e2 100644 --- a/src/org/labkey/test/components/bootstrap/ModalDialog.java +++ b/src/org/labkey/test/components/bootstrap/ModalDialog.java @@ -121,6 +121,11 @@ public void dismiss(String buttonText, Integer waitSeconds) waitForClose(waitSeconds); } + public boolean isDismissEnabled(String buttonText) + { + return Locators.dismissButton(buttonText).findElement(getComponentElement()).isEnabled(); + } + protected void waitForClose() { waitForClose(10); diff --git a/src/org/labkey/test/components/ui/DeleteConfirmationDialog.java b/src/org/labkey/test/components/ui/DeleteConfirmationDialog.java index ef8e8f9918..8a869f2eb4 100644 --- a/src/org/labkey/test/components/ui/DeleteConfirmationDialog.java +++ b/src/org/labkey/test/components/ui/DeleteConfirmationDialog.java @@ -63,6 +63,11 @@ public ConfirmPage confirmDelete(Integer waitSeconds) return _confirmPageSupplier.get(); } + public Boolean isDeleteEnabled() + { + return isDismissEnabled("Yes, Delete"); + } + public ConfirmPage confirmPermanentlyDelete() { return confirmPermanentlyDelete(10);