@bigbinary/neeto-playwright-commons 3.2.1 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +5 -3
- package/index.cjs.js.map +1 -1
- package/index.d.ts +5 -0
- package/index.js +5 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -6071,7 +6071,7 @@ class CustomCommands {
|
|
|
6071
6071
|
const startTime = Date.now();
|
|
6072
6072
|
return await this.recursiveMethod(callback, condition, timeout, startTime, 1);
|
|
6073
6073
|
};
|
|
6074
|
-
verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10_000, customPageContext = this.page, } = {}) => {
|
|
6074
|
+
verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10_000, toastCloseTimeout = 10_000, customPageContext = this.page, } = {}) => {
|
|
6075
6075
|
// React-toastify does not support adding data-* attributes to toast DOM elements: https://github.com/fkhadra/react-toastify/issues/1106
|
|
6076
6076
|
const toastrLocator = customPageContext
|
|
6077
6077
|
.locator(COMMON_SELECTORS.neetoUiToastr)
|
|
@@ -6085,14 +6085,16 @@ class CustomCommands {
|
|
|
6085
6085
|
.first();
|
|
6086
6086
|
await test.expect(filteredToastrLocator).toContainText(ramda.isEmpty(message) ? "👍" : message, { timeout });
|
|
6087
6087
|
const toastrCloseButton = filteredToastrLocator.getByTestId(COMMON_SELECTORS.toastCloseButton);
|
|
6088
|
-
if (!closeAfterVerification
|
|
6088
|
+
if (!closeAfterVerification)
|
|
6089
6089
|
return;
|
|
6090
6090
|
const buttonHandle = await toastrCloseButton.elementHandle();
|
|
6091
6091
|
if (buttonHandle) {
|
|
6092
6092
|
await customPageContext.evaluate(button => {
|
|
6093
6093
|
button.dispatchEvent(new Event("click", { bubbles: true }));
|
|
6094
6094
|
}, buttonHandle);
|
|
6095
|
-
await test.expect(toastrCloseButton).toBeHidden({
|
|
6095
|
+
await test.expect(toastrCloseButton).toBeHidden({
|
|
6096
|
+
timeout: toastCloseTimeout,
|
|
6097
|
+
});
|
|
6096
6098
|
}
|
|
6097
6099
|
};
|
|
6098
6100
|
waitForPageLoad = async ({ visibilityTimeout = 35_000, customPageContext = this.page, waitForOption = "serial", } = {}) => {
|