diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index eb32960b85e..c563b315e60 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -129,7 +129,7 @@ export const downloadResources = async (args: downloadResourcesArgs): Promise => { - const { page, folder, names } = args +export const selectOrDeselectResources = async (args: selectResourcesArgs): Promise => { + const { page, folder, names, select } = args if (folder) { await clickResource({ page: page, path: folder }) } @@ -165,8 +166,10 @@ export const selectResources = async (args: selectResourcesArgs): Promise }) if (exists) { const resourceCheckbox = page.locator(util.format(checkBox, resource)) - if (!(await resourceCheckbox.isChecked())) { + if (!(await resourceCheckbox.isChecked()) && select) { await resourceCheckbox.check() + } else if (await resourceCheckbox.isChecked()) { + await resourceCheckbox.uncheck() } } else { throw new Error(`The resource ${resource} you are trying to select does not exist`)