Skip to content

Commit

Permalink
add e2e ui tests for CE
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 committed Oct 2, 2024
1 parent 73691fd commit 75beef8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions apps/meteor/tests/e2e/apps/private-apps-upload.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,32 @@ test.describe.serial('Private apps upload', () => {
await poMarketplace.appMenu.click();
await expect(poMarketplace.btnEnableApp).toBeDisabled();
});

test('expect updated private app in CE to be kept as disabled', async ({ page }) => {
const fileChooserPromise = page.waitForEvent('filechooser');

await poMarketplace.btnUploadPrivateApp.click();
await expect(poMarketplace.btnConfirmAppUploadModal).toBeEnabled();
await poMarketplace.btnConfirmAppUploadModal.click();

await expect(poMarketplace.btnInstallPrivateApp).toBeDisabled();
await poMarketplace.btnUploadPrivateAppFile.click();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles('./tests/e2e/fixtures/files/test-app_0.0.1.zip');

await expect(poMarketplace.btnInstallPrivateApp).toBeEnabled();
await poMarketplace.btnInstallPrivateApp.click();

await expect(poMarketplace.confirmAppUploadModalTitle).toHaveText('Private apps limit reached');
await expect(poMarketplace.btnConfirmAppUploadModal).toBeEnabled();
await poMarketplace.btnConfirmAppUploadModal.click();

await poMarketplace.btnConfirmAppUpdate.click();

await page.getByRole('button', { name: 'Agree' }).click();
await expect(poMarketplace.appStatusTag).toHaveText('Disabled');
await page.reload();
await expect(poMarketplace.appStatusTag).toHaveText('Disabled');
});
});
});
8 changes: 8 additions & 0 deletions apps/meteor/tests/e2e/page-objects/marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,12 @@ export class Marketplace {
get btnEnableApp(): Locator {
return this.page.getByRole('menuitem', { name: 'Enable' });
}

get btnDisableApp(): Locator {
return this.page.getByRole('menuitem', { name: 'Disable' });
}

get btnConfirmAppUpdate(): Locator {
return this.page.locator('role=button[name="Yes"]');
}
}

0 comments on commit 75beef8

Please sign in to comment.