Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .woodpecker.star
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ config = {
"mobile-view",
],
},
"localization-de": {
"skip": False,
"features": [
"cucumber/features/a11y/smoke.feature",
],
"extraServerEnvironment": {
"OC_DEFAULT_LANGUAGE": "de",
},
},
},
"build": True,
}
Expand Down Expand Up @@ -555,6 +564,9 @@ def e2eTests(ctx):
if "ocm" in suite and not "full-ci" in ctx.build.title.lower() and ctx.build.event != "cron":
continue

if "localization-de" in suite and "localization-de" not in ctx.build.title.lower():
continue

if params["skip"]:
continue

Expand Down Expand Up @@ -630,6 +642,9 @@ def e2eTests(ctx):
else:
pipeline_name = "e2e-tests-%s-%s" % (suite, browser_name)

if "localization-de" in suite:
command = "RUN_LOCALIZATION_TEST_FOR_LANG=de pnpm test:e2e:cucumber tests/e2e/cucumber/features/a11y/smoke.feature"

steps += [{
"name": "e2e-tests",
"image": OC_CI_NODEJS,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"commander": "14.0.1",
"ejs": "3.1.10",
"eslint": "9.37.0",
"franc-min": "^6.2.0",
"glob": "11.0.3",
"happy-dom": "19.0.2",
"jsdom": "^27.0.0",
Expand Down
28 changes: 28 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions tests/e2e/cucumber/features/a11y/smoke.feature
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ Feature: Accessibility checks
# personal space
And "Alice" opens the "files" app
And "Alice" checks the accessibility of the DOM selector ".files-view-wrapper" on the "personal space"
And "Alice" switches to the "tiles" view
And "Alice" checks the accessibility of the DOM selector ".files-view-wrapper" on the "personal space"
And "Alice" switches to the "table-condensed" view
And "Alice" checks the accessibility of the DOM selector ".files-view-wrapper" on the "personal space"
# check empty page
And "Brian" opens the "files" app
And "Brian" checks the accessibility of the DOM selector ".files-view-wrapper" on the "personal space"

# shares
And "Alice" navigates to the shared with me page
Expand Down Expand Up @@ -150,8 +151,11 @@ Feature: Accessibility checks
## 6. space page
And "Alice" navigates to the project space "my_space"
And "Alice" checks the accessibility of the DOM selector "#files-view" on the "project space page"


And "Brian" opens the "files" app
And "Brian" navigates to the projects space page
And "Brian" checks the accessibility of the DOM selector "#files-view" on the "project spaces page"


## 7. app-sidebar (right sidebar)
And "Alice" opens the "files" app
And "Alice" opens the right sidebar of the resource "lorem.txt"
Expand All @@ -161,19 +165,20 @@ Feature: Accessibility checks
And "Alice" opens a "versions" panel of the resource "lorem.txt"
And "Alice" checks the accessibility of the DOM selector "#sidebar-panel-versions" on the "right sidebar->versions panel"
And "Alice" opens a "activities" panel of the resource "lorem.txt"
And "Alice" checks the accessibility of the DOM selector "#sidebar-panel-sharing" on the "right sidebar->activities panel"
And "Alice" checks the accessibility of the DOM selector "#sidebar-panel-activities" on the "right sidebar->activities panel"
And "Alice" opens a "sharing" panel of the resource "lorem.txt"
And "Alice" checks the accessibility of the DOM selector "#sidebar-panel-sharing" on the "right sidebar->sharing panel"

# check create public link modal and link role dropdown
And "Alice" creates a public link of following resource using the sidebar panel
| resource | role | password |
| parent | Secret File Drop | %public% |
| resource | role | password |
| parent | Secret File Drop | %public% |

## 8. public link page
And "Anonymous" opens the public link "Unnamed link"
And "Anonymous" checks the accessibility of the DOM selector "#opencloud" on the "public link page->before unlock"
And "Anonymous" unlocks the public link with password "%public%"
And "Anonymous" checks the accessibility of the DOM selector "#web-content" on the "public link page"
And "Anonymous" checks the accessibility of the DOM selector "#files" on the "public link page"

And "Alice" logs out
And "Brian" logs out
4 changes: 2 additions & 2 deletions tests/e2e/cucumber/steps/ui/a11.y.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Then } from '@cucumber/cucumber'
import { World } from '../../environment'
import { checkAccessibility } from '../../../support/utils/accessibility'
import { checkA11yOrLocalization } from '../../../support/utils/accessibility'

Then(
'{string} checks the accessibility of the DOM selector {string} on the {string}',
async function (this: World, stepUser: string, selector: string, context: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
await checkAccessibility(page, context, selector)
await checkA11yOrLocalization(page, context, selector)
}
)
21 changes: 16 additions & 5 deletions tests/e2e/support/objects/app-files/link/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { sidebar } from '../utils'
import { getActualExpiryDate } from '../../../utils/datePicker'
import { clickResource } from '../resource/actions'
import { config } from '../../../../config'
import { checkAccessibility } from '../../../utils/accessibility'
import { checkA11yOrLocalization } from '../../../utils/accessibility'

export interface createLinkArgs {
page: Page
Expand Down Expand Up @@ -115,6 +115,12 @@ const getRecentLinkName = async (page: Page): Promise<string> => {
return await page.locator(publicLinkNameList).first().textContent()
}

const roleIdMap: Record<string, string> = {
'Can view': '#files-role-view',
'Can edit': '#files-role-edit',
'Secret File Drop': '#files-role-createOnly'
}

export const createLink = async (args: createLinkArgs): Promise<string> => {
const { space, page, resource, password, role, a11yEnabled } = args
if (!space) {
Expand All @@ -129,15 +135,18 @@ export const createLink = async (args: createLinkArgs): Promise<string> => {
await page.locator(addPublicLinkButton).click()
await page.locator(advancedModeButton).click()
if (a11yEnabled) {
await checkAccessibility(page, 'create public link modal', createLinkModal)
await checkA11yOrLocalization(page, 'create public link modal', createLinkModal)
}

if (role) {
const roleSelector = roleIdMap[role]
if (!roleSelector) throw new Error(`Unknown role: ${role}`)
await page.locator(publicLinkRoleToggle).click()

if (a11yEnabled) {
await checkAccessibility(page, 'check link role dropdown', linkRoleDropdown)
await checkA11yOrLocalization(page, 'check link role dropdown', linkRoleDropdown)
}
await page.locator(util.format(publicLinkSetRoleButton, role)).click()
await page.locator(roleSelector).click()
}

await page.locator(editPublicLinkPasswordInput).fill(password)
Expand All @@ -157,7 +166,9 @@ export const createLink = async (args: createLinkArgs): Promise<string> => {
if (config.browser === 'webkit') {
return (await resp[0].json()).link.webUrl
} else {
return await getRecentLinkUrl(page, 'Unnamed link')
const name =
process.env.RUN_LOCALIZATION_TEST_FOR_LANG === 'de' ? 'Unbenannter Link' : 'Unnamed link'
return await getRecentLinkUrl(page, name)
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/support/objects/app-files/page/shares/viaLink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Page } from '@playwright/test'

const sharesNavSelector = '//a[@data-nav-name="files-shares"]'
const sharesViaLinkTabSelector = 'a[href="/files/shares/via-link"]'

export class ViaLink {
#page: Page
Expand All @@ -11,6 +12,6 @@ export class ViaLink {

async navigate(): Promise<void> {
await this.#page.locator(sharesNavSelector).click()
await this.#page.getByText('Shared via link').click()
await this.#page.locator(sharesViaLinkTabSelector).click()
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Page } from '@playwright/test'

const sharesNavSelector = '//a[@data-nav-name="files-shares"]'
const sharesWithOthersTabSelector = 'a[href="/files/shares/with-others"]'

export class WithOthers {
#page: Page
Expand All @@ -11,6 +12,6 @@ export class WithOthers {

async navigate(): Promise<void> {
await this.#page.locator(sharesNavSelector).click()
await this.#page.getByText('Shared with others').click()
await this.#page.locator(sharesWithOthersTabSelector).click()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class Projects {
}

async navigate(): Promise<void> {
await this.#page.locator('//a[@data-nav-name="files-spaces-projects"]').click()
await this.#page.locator('a[data-nav-name="files-spaces-projects"]').click()
await this.#page.locator('#app-loading-spinner').waitFor({ state: 'detached' })
}
}
3 changes: 2 additions & 1 deletion tests/e2e/support/objects/app-files/trashbin/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const emptyTrashbinQuickActionBtn =
'//*[@data-test-resource-name="%s"]//ancestor::tr//button[@aria-label="Empty trash bin"] | //*[@data-test-resource-name="%s"]//ancestor::li[contains(@class, "oc-tiles-item")]//button[@aria-label="Empty trash bin"]'
const actionConfirmButton = '.oc-modal-body-actions-confirm'
const footerTextSelector = '//*[@data-testid="files-list-footer-info"]'
const personalTrashbinSelector = 'a[href^="/files/trash/personal/"]'

export interface openTrashBinArgs {
id: string
Expand All @@ -20,7 +21,7 @@ export const openTrashbinOfProjectSpace = async (args: openTrashBinArgs): Promis
}

export const openTrashbinOfPersonalSpace = async (page: Page): Promise<void> => {
await page.getByTitle('Personal').click()
await page.locator(personalTrashbinSelector).first().click()
}

export const showEmptyTrashbins = async (page: Page): Promise<void> => {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/support/objects/runtime/session.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Page } from '@playwright/test'
import { User } from '../../types'
import { config } from '../../../config'
import { checkAccessibility } from '../../utils/accessibility'
import { checkA11yOrLocalization } from '../../utils/accessibility'

export class Session {
#page: Page
Expand All @@ -21,7 +21,7 @@ export class Session {
await this.#page.locator('#oc-login-username').fill(username)
await this.#page.locator('#oc-login-password').fill(password)
if (a11y) {
await checkAccessibility(this.#page, 'before clicking login submit')
await checkA11yOrLocalization(this.#page, 'before clicking login submit', '#root')
}
await this.#page.locator('button[type="submit"]').click()
}
Expand Down
Loading