Files
Ferdinand Thiessen 3d9d485737 test(core): add Playwright coverage for the guest pages
Cover the core pages no end-to-end test exercised so far, so that moving
them to another rendering engine cannot silently break them:

- the password prompt of protected link shares
- the login flow v1 and v2 up to the hand-over of the app password
- the unsupported browser warning, including the redirect back
- the legacy unified search that is offered while
  `unified_search.enabled` is set

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Assisted-by: ClaudeCode:claude-opus-5-5
2026-09-30 23:29:56 +02:00

34 lines
931 B
TypeScript

/*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import type { Locator, Page } from '@playwright/test'
/**
* The warning page unsupported browsers are redirected to.
*/
export class UnsupportedBrowserPage {
constructor(private readonly page: Page) {}
/**
* Open the warning page.
*
* @param redirectPath - The path to continue to, as the redirect passes it
*/
async open(redirectPath?: string): Promise<void> {
const query = redirectPath === undefined
? ''
: `?redirect_url=${encodeURIComponent(Buffer.from(redirectPath).toString('base64'))}`
await this.page.goto(`/unsupported${query}`)
}
heading(): Locator {
return this.page.getByRole('heading', { name: 'Your browser is not supported.' })
}
continueButton(): Locator {
return this.page.getByRole('button', { name: 'Continue with this unsupported browser' })
}
}