From 7530695a710445a0e0d76790e1d9f9ea4e759c3c Mon Sep 17 00:00:00 2001 From: Ramona Hartinger Date: Mon, 11 Nov 2024 07:31:48 +0100 Subject: [PATCH] fix: added fix for failing e2e test --- src/test/e2e/LiquibaseGUITestUtils.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/test/e2e/LiquibaseGUITestUtils.ts b/src/test/e2e/LiquibaseGUITestUtils.ts index 12e97d6..3394352 100644 --- a/src/test/e2e/LiquibaseGUITestUtils.ts +++ b/src/test/e2e/LiquibaseGUITestUtils.ts @@ -694,16 +694,22 @@ export class LiquibaseGUITestUtils { * @param checkForCacheToBeThere - if `true`, then during the command execution it will check if there is a cache entry to remove */ static async removeWholeCache(checkForCacheToBeThere?: boolean): Promise { - const input = await LiquibaseGUITestUtils.startCommandExecution({ + let input = await LiquibaseGUITestUtils.startCommandExecution({ command: "Cache: Remove any values from the recently loaded elements...", }); - if ( - checkForCacheToBeThere && - (await this.waitForCommandExecution("There are no elements stored to remove", false)) - ) { - // no cache elements there, just return - return; + if (checkForCacheToBeThere) { + if (await this.waitForCommandExecution("There are no elements stored to remove", false)) { + // no cache elements there, just return + return; + } + + // if the notifications were checked and the input is no longer displayed, reopen the command + if (!(await input.isDisplayed())) { + input = await LiquibaseGUITestUtils.startCommandExecution({ + command: "Cache: Remove any values from the recently loaded elements...", + }); + } } await input.setText(RemoveCacheOptions.WHOLE_CACHE);