From 51c5261a89767eb7d75ff883ee32888ace03a915 Mon Sep 17 00:00:00 2001 From: Christian Darsow Date: Mon, 27 Nov 2023 11:34:16 +0100 Subject: [PATCH] Add pause param to waitAndSetValue --- runtime/helpers/waitHelpers.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/runtime/helpers/waitHelpers.js b/runtime/helpers/waitHelpers.js index 9145aab0..41fbcd43 100644 --- a/runtime/helpers/waitHelpers.js +++ b/runtime/helpers/waitHelpers.js @@ -233,13 +233,13 @@ async function waitUntilScriptResultIsTrue(script, timeoutMsg, timeout = pageLoa ); } -async function waitAndSetValue(selectorOrElement, value, timeout = setValueTimeout) { +async function waitAndSetValue(selectorOrElement, value, pause = 200) { await waitUntilElementIsVisible(selectorOrElement); const element = await waitUntilElementIsEnabled(selectorOrElement); await element.clearValue(); await element.click(); driver.keys(value); - await driver.pause(200); + await driver.pause(pause); } async function waitUntilElementAttributeEquals( @@ -333,10 +333,6 @@ async function waitUntilPageTitleEquals(expectedTitle, timeout = titleTimeout) { } } -async function wait(timeout = setValueTimeout) { - await driver.pause(timeout); -} - module.exports = { waitUntilElementIsPresent, waitUntilElementIsNotPresent, @@ -358,5 +354,4 @@ module.exports = { waitUntilPageTitleContains, waitUntilPageTitleEquals, waitUntilNuxtClientLoads, - wait, };