Browse Source

fix(test): Appstore will automatically remove a plugin if the plugin required to install is already installed and then will install it

pull/4278/head
Muhammed Mustafa 2 years ago
parent
commit
73cef534b0
  1. 15
      packages/nc-gui/tests/playwright/pages/Dashboard/Settings/AppStore.ts

15
packages/nc-gui/tests/playwright/pages/Dashboard/Settings/AppStore.ts

@ -17,6 +17,21 @@ export class AppStoreSettingsPage extends BasePage {
async install({ name }: { name: string }) {
const card = await this.settings.get().locator(`.nc-app-store-card-${name}`);
await card.click();
// todo: Hack to solve the issue when if the test installing a plugin fails, the next test will fail because the plugin is already installed
let appAlreadyInstalled = true;
for (let i = 0; i < 5; i++) {
if (await card.locator('.nc-app-store-card-install').isVisible()) {
appAlreadyInstalled = false;
break;
}
await new Promise(resolve => setTimeout(resolve, 1000));
}
if (appAlreadyInstalled) {
await this.uninstall({ name });
}
await card.locator('.nc-app-store-card-install').click();
}

Loading…
Cancel
Save