From af8f2a231d644d8e1dd46399e74424a8416c21f2 Mon Sep 17 00:00:00 2001 From: Peter Ringelmann Date: Fri, 27 Mar 2026 09:49:54 +0100 Subject: [PATCH 01/11] feat(e2e): add RadioButtons to QuestionType enum Signed-off-by: Peter Ringelmann --- playwright/support/sections/QuestionType.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/playwright/support/sections/QuestionType.ts b/playwright/support/sections/QuestionType.ts index da502e0d9..208b981cf 100644 --- a/playwright/support/sections/QuestionType.ts +++ b/playwright/support/sections/QuestionType.ts @@ -11,5 +11,6 @@ export enum QuestionType { File = 'File', LinearScale = 'Linear scale', LongAnswer = 'Long text', + RadioButtons = 'Radio buttons', ShortAnswer = 'Short answer', } From 11279696d47ce29fda68a239bdc0fa8160da06b1 Mon Sep 17 00:00:00 2001 From: Peter Ringelmann Date: Fri, 27 Mar 2026 09:52:46 +0100 Subject: [PATCH 02/11] feat(e2e): add SubmitSection page object and fixture Signed-off-by: Peter Ringelmann --- playwright/support/fixtures/submit.ts | 18 ++++ playwright/support/sections/SubmitSection.ts | 94 ++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 playwright/support/fixtures/submit.ts create mode 100644 playwright/support/sections/SubmitSection.ts diff --git a/playwright/support/fixtures/submit.ts b/playwright/support/fixtures/submit.ts new file mode 100644 index 000000000..b3c2c3fea --- /dev/null +++ b/playwright/support/fixtures/submit.ts @@ -0,0 +1,18 @@ +/** + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { test as baseTest } from '@playwright/test' +import { SubmitSection } from '../sections/SubmitSection' + +interface SubmitFixture { + submitView: SubmitSection +} + +export const test = baseTest.extend({ + submitView: async ({ page }, use) => { + const submitView = new SubmitSection(page) + await use(submitView) + }, +}) diff --git a/playwright/support/sections/SubmitSection.ts b/playwright/support/sections/SubmitSection.ts new file mode 100644 index 000000000..07504c523 --- /dev/null +++ b/playwright/support/sections/SubmitSection.ts @@ -0,0 +1,94 @@ +/** + * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import type { Locator, Page, Response } from '@playwright/test' + +export class SubmitSection { + public readonly submitButton: Locator + public readonly successMessage: Locator + + constructor(public readonly page: Page) { + this.submitButton = this.page.getByRole('button', { name: 'Submit' }) + this.successMessage = this.page.getByText( + 'Thank you for completing the form!', + ) + } + + /** + * Get a question's list item by its title text. + * Questions render as
  • , + * and each contains an

    with the title text. + */ + public getQuestion(name: string | RegExp): Locator { + return this.page + .getByRole('listitem') + .filter({ has: this.page.getByRole('heading', { name }) }) + } + + /** + * Fill a short/long text question by its title. + * QuestionShort renders , + * QuestionLong renders