Files
wekan/tests/nextcloud/persistence.spec.cjs
T
Lauri Ojansivu 91bfd08097 Test real Nextcloud deployments and preserve signed SockJS identities
Keep verified gateway identities bound to their actual upgrade sockets before SockJS filters custom headers. Add repository-local Nextcloud 32-35 acceptance runs for authentication, isolation, uploads, lifecycle, source-built upgrades, restored volumes and mutual-TLS FRP. Harden release archive checks and exercise signing and workflow failures.

Thanks to xet7.
2026-10-11 22:46:45 +03:00

25 lines
1.4 KiB
JavaScript

const { test, expect } = require('@playwright/test');
const fs = require('node:fs');
const fixture = JSON.parse(fs.readFileSync(process.env.WEKAN_NEXTCLOUD_FIXTURE));
const saved = JSON.parse(fs.readFileSync(`${fixture.work}/persisted.json`));
test(`accounts, board, attachment and avatar survive ${process.env.NEXTCLOUD_TEST_PHASE}`, async ({ browser }) => {
const context = await browser.newContext();
try {
const page = await context.newPage();
await page.goto(`${fixture.nextcloud}/index.php/login?redirect_url=${encodeURIComponent(new URL(fixture.url).pathname)}`);
await page.locator('[name="user"]').fill('alice');
await page.locator('[name="password"]').fill(fixture.password);
await page.locator('button[type="submit"]').click();
await page.waitForURL(url => !url.pathname.endsWith('/login'));
await page.goto(saved.boardUrl);
await page.waitForFunction(id => Meteor.userId() === id, saved.alice);
await expect(page.locator('.board-canvas')).toBeVisible();
await expect(page.locator('.minicard-title').filter({ hasText: 'After live update' })).toBeVisible();
for (const type of ['attachment', 'avatar']) {
const response = await context.request.get(saved[type].url);
expect(response.ok()).toBe(true);
expect(await response.body()).toEqual(Buffer.from(saved[`${type}Bytes`], 'base64'));
}
} finally { await context.close(); }
});