Skip to content

Commit

Permalink
Merge pull request #11104 from owncloud/tests/fix-e2e-gdpr
Browse files Browse the repository at this point in the history
[tests-only][full-ci] wait until the GDPR report is ready for download
  • Loading branch information
saw-jan authored Jun 27, 2024
2 parents 69f460b + 036934a commit 9f5e6df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .drone.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# The version of OCIS to use in pipelines that test against OCIS
OCIS_COMMITID=1af8050ccc8ae77ba3b033b856f4590dda5ffd38
OCIS_COMMITID=5f03a566ee31e760d4031136fb6e553278c2786a
OCIS_BRANCH=master
24 changes: 11 additions & 13 deletions tests/e2e/support/objects/account/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Page } from '@playwright/test'
import util from 'util'
import config from '../../../config'

const accountMenuButton = '.oc-topbar-avatar'
const quotaValue = '.storage-wrapper-quota'
Expand Down Expand Up @@ -46,19 +47,16 @@ export const requestGdprExport = async (args: { page: Page }): Promise<void> =>
resp.status() === 202 &&
resp.request().method() === 'POST'
),
// not waiting for the generation report
page.route('**/.personal_data_export.json', async (route) => {
const response = await route.fetch()
let body = await response.text()
body = body.replace(
'<d:status>HTTP/1.1 425 TOO EARLY</d:status>',
'<d:status>HTTP/1.1 200 OK</d:status>'
)
await route.fulfill({
response,
body
})
}),
page.waitForResponse(
(resp) =>
resp.url().endsWith('.personal_data_export.json') &&
resp.status() === 207 &&
resp.request().method() === 'PROPFIND' &&
resp.text().then((text) => text.includes('HTTP/1.1 200 OK')),
// generating GDPR report can take a while
// so we need to increase the timeout to 60 seconds
{ timeout: config.timeout * 1000 }
),
page.locator(requestExportButton).click()
])
}
Expand Down

0 comments on commit 9f5e6df

Please sign in to comment.