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
4 changes: 2 additions & 2 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def e2eTests(ctx):
"federationServer": False,
"failOnUncaughtConsoleError": False,
"extraServerEnvironment": {},
"skipA11y": False,
"skipA11y": True,
}

pipelines = []
Expand Down Expand Up @@ -748,7 +748,7 @@ def e2eTests(ctx):
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
"BROWSER": "chromium",
"FEDERATED_BASE_URL_OCIS": "federation-ocis:9200",
"SKIP_A11Y_TESTS": True,
"SKIP_A11Y_TESTS": params["skipA11y"],
}

if "suites" in matrix:
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e-playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
forbidOnly: !!process.env.CI,

// Retry on CI only.
retries: process.env.CI ? 1 : 0,
retries: config.retry,

// Opt out of parallel tests on CI.
workers: process.env.CI ? 1 : undefined,
Expand All @@ -36,7 +36,8 @@ export default defineConfig({
ignoreHTTPSErrors: true,

// Collect trace when retrying the failed test.
trace: config.reportTracing ? 'on' : 'on-first-retry'
trace: config.reportTracing ? 'on' : 'on-first-retry',
headless: config.headless
},
// Configure projects for major browsers.
projects: [
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-playwright/steps/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function userHasCreatedPublicLinkOfResource({
resource: string
role: string
name?: string
password?: undefined
password?: string
space?: 'Personal'
}) {
const user = usersEnvironment.getUser({ key: stepUser })
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const config = {
debug: process.env.DEBUG === 'true',
logLevel: process.env.LOG_LEVEL || 'silent',
// cucumber
retry: process.env.RETRY || 0,
retry: parseInt(process.env.RETRY) || 0,
// playwright
slowMo: parseInt(process.env.SLOW_MO) || 0,
timeout: parseInt(process.env.TIMEOUT) || 60,
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/support/objects/app-files/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export class Link {
const startUrl = this.#page.url()
const url = await po.createLink({ ...args, page: this.#page })

const linkName = args.name ?? 'Unnamed link'
this.#linksEnvironment.createLink({
key: args.name,
link: { name: args.name, url }
key: linkName,
link: { name: linkName, url }
})

await this.#page.goto(startUrl)
Expand Down
23 changes: 22 additions & 1 deletion tests/e2e/support/objects/app-files/page/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ import { File } from '../../../types'
import util from 'util'
import path from 'path'
import * as po from '../resource/actions'
import { objects } from '../../..'

const passwordInput = 'input[type="password"]'
const fileUploadInput = '//input[@id="files-file-upload-input"]'
const dropUploadResourceSelector = '.upload-info-items [data-test-resource-name="%s"]'
const uploadInfoSuccessLabelSelector = '.upload-info-success'
const publicLinkAuthorizeButton = '.oc-login-authorize-button'
const folderModalIframe = '#iframe-folder-view'
const passwordProtectedPublicLinkForm =
'//span[contains(text(),"password-protected")]/ancestor::form'
const publicLinkErrorMessage = 'div.oc-link-resolve-error-title'

export class Public {
#page: Page
Expand All @@ -19,7 +23,24 @@ export class Public {
}

async open({ url }: { url: string }): Promise<void> {
await this.#page.goto(url)
await Promise.all([
this.#page.waitForResponse(
(res) =>
res.url().includes('/public-files/') &&
res.request().method() === 'PROPFIND' &&
res.status() >= 207
),
this.#page.goto(url)
])
if (
!(await this.#page.locator(passwordProtectedPublicLinkForm).isVisible()) &&
!(await this.#page.locator(publicLinkErrorMessage).isVisible())
) {
// wait for redirection to complete
await this.#page.waitForURL('**/public/**')
}
const a11yObject = new objects.a11y.Accessibility({ page: this.#page })
await a11yObject.getSevereAccessibilityViolations('body')
}

async authenticate({
Expand Down