Browse Source

test: super user

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3848/head
Raju Udava 2 years ago committed by Muhammed Mustafa
parent
commit
d9f34c3d86
  1. 9
      scripts/playwright/pages/Dashboard/Settings/AppStore.ts
  2. 57
      scripts/playwright/tests/rolesSuperUser.spec.ts

9
scripts/playwright/pages/Dashboard/Settings/AppStore.ts

@ -17,16 +17,13 @@ export class AppStoreSettingsPage extends BasePage {
} }
async install({ name }: { name: string }) { async install({ name }: { name: string }) {
let card = this.settings.get().locator(`.nc-app-store-card-${name}`); let card = await this.settings.get().locator(`.nc-app-store-card-${name}`);
// get()
// .locator(`[pw-data="nc-app-store-card-${name}"]`)
// .scrollIntoViewIfNeeded();
// await card.scrollIntoViewIfNeeded();
await card.click(); await card.click();
await card.locator(".nc-app-store-card-install").click(); await card.locator(".nc-app-store-card-install").click();
} }
async configureSlack() {}
async configureSMTP({ async configureSMTP({
email, email,
host, host,

57
scripts/playwright/tests/rolesSuperUser.spec.ts

@ -0,0 +1,57 @@
import { test } from "@playwright/test";
import { DashboardPage } from "../pages/Dashboard";
import setup from "../setup";
test.describe("Super user", () => {
let dashboard: DashboardPage;
let context: any;
test.beforeEach(async ({ page }) => {
context = await setup({ page });
dashboard = new DashboardPage(page, context.project);
});
test("AppStore access", async () => {
await dashboard.closeTab({ title: "Team & Auth" });
await dashboard.rootPage.goto("/#/apps");
await dashboard.rootPage.waitForLoadState("load");
const appPage = await dashboard.rootPage;
// Access slack card
const card = await appPage.locator(".nc-app-store-card-Slack");
await card.click();
await card.locator(".nc-app-store-card-install").click();
// Configure slack
let slackModal = await appPage.locator(".nc-modal-plugin-install");
await slackModal
.locator('[placeholder="Channel Name"]')
.fill("Test Channel");
await slackModal
.locator('[placeholder="Webhook URL"]')
.fill("http://test.com");
await slackModal.locator('button:has-text("Save")').click();
await dashboard.toastWait({ message: "Successfully installed" });
// Modify configuration
await card.click();
await card.locator(".nc-app-store-card-edit").click();
slackModal = await appPage.locator(".nc-modal-plugin-install");
await slackModal
.locator('[placeholder="Channel Name"]')
.fill("Test Channel 2");
await slackModal
.locator('[placeholder="Webhook URL"]')
.fill("http://test2.com");
await slackModal.locator('button:has-text("Save")').click();
await dashboard.toastWait({ message: "Successfully installed" });
// Uninstall
await card.click();
await card.locator(".nc-app-store-card-reset").click();
slackModal = await appPage.locator(".nc-modal-plugin-uninstall");
await slackModal.locator('button:has-text("Confirm")').click();
await dashboard.toastWait({ message: "Plugin uninstalled successfully" });
});
});
Loading…
Cancel
Save