Files
computer-playbook/roles/web-app-nextcloud/files/playwright/addons/external.spec.js
kevinveenbirkenbachandClaude Opus 5 8c299f8e34 Merge PR #495 (nextcloud image bump + NC34 fixes) into feature/svc-net-tor
Covered by PR #380 rather than merged on its own. This branch already carries
the Tor onion-service provider across the whole role set, and #495 touches the
same nextcloud Playwright specs; landing them separately would mean resolving
the same conflicts twice, once here and once on main. Reviewing #495 as part of
#380 keeps the resolution in one place.

One conflict, in the external-sites addon spec. Nextcloud 34 renamed the admin
section from #external to #external-vue and replaced the add-site control with
a 'New site' button, so the incoming selectors win — retargeting them is what
the PR is for. This branch's resolveTimeout wrappers stay on both assertions.

make quality green on the merge result.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 14:47:00 +02:00

42 lines
1.8 KiB
JavaScript

const { test, expect } = require("@playwright/test");
const { resolveTimeout } = require("../timeouts");
const { skipUnlessAddonEnabled } = require("../addon-gating");
const shared = require("../_shared");
const { gotoOnion } = require("../personas");
test.use({ ignoreHTTPSErrors: true });
test("external addon: admin External-sites settings panel renders", async ({ browser }) => {
skipUnlessAddonEnabled("external");
test.setTimeout(resolveTimeout(120_000));
const context = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await context.newPage();
try {
await shared.loginToStandaloneNextcloud(page);
const settingsUrl = new URL("settings/admin/external", shared.env.nextcloudBaseUrl).toString();
await gotoOnion(page, settingsUrl, { waitUntil: "domcontentloaded", timeout: resolveTimeout(60_000) });
await shared.dismissBlockingNextcloudModals(page, page);
await expect(
page.locator("#app-content, #app-content-vue, #content, #content-vue").first(),
"the Nextcloud admin settings shell must render for the external app's own section (settings/admin/external)",
).toBeVisible({ timeout: resolveTimeout(60_000) });
await expect(
page.locator("#external-vue").first(),
"the external app's own admin section (#external-vue) must render (proves the 'external' section + template are served by the enabled app)",
).toBeVisible({ timeout: resolveTimeout(60_000) });
await expect(
page.getByRole("button", { name: "New site" }).first(),
"the external app's add-site admin control (the 'New site' button) must render (proves the External-sites configuration UI is live)",
).toBeVisible({ timeout: resolveTimeout(60_000) });
} finally {
await page.close().catch(() => {});
await context.close().catch(() => {});
}
});