Skip to content

Commit

Permalink
fix: added fix for failing e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
rH4rtinger committed Nov 11, 2024
1 parent 2757daf commit 7530695
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/test/e2e/LiquibaseGUITestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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);
Expand Down

0 comments on commit 7530695

Please sign in to comment.