Skip to content
Merged
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
32 changes: 18 additions & 14 deletions tests/e2e/support/objects/app-files/resource/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,19 @@ const createDocumentFile = async (
const resourceInput = page.locator(resourceNameInput)
await resourceInput.clear()
await resourceInput.fill(name)
await Promise.all([
page.waitForLoadState(),
page.waitForURL(/.*\/external-.*/),
page.waitForResponse(
(resp) =>
resp.status() === 200 &&
resp.request().method() === 'POST' &&
resp.request().url().includes('/app/open?')
),
page.locator(util.format(actionConfirmationButton, 'Create')).click()
])
const loadStatePromise = page.waitForLoadState()
const urlPromise = page.waitForURL(/.*\/external-.*/)
const responsePromise = page.waitForResponse(
(resp) =>
resp.status() === 200 &&
resp.request().method() === 'POST' &&
resp.request().url().includes('/app/open?')
)
await page.locator(util.format(actionConfirmationButton, 'Create')).click()
await loadStatePromise
await urlPromise
await responsePromise

const editorMainFrame = page.frameLocator(externalEditorIframe)
switch (editorToOpen) {
case 'Collabora':
Expand All @@ -441,10 +443,12 @@ const createDocumentFile = async (
"Editor should be either 'Collabora' or 'OnlyOffice' but found " + editorToOpen
)
}
await Promise.all([
page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND'),
editor.close(page)
const respPromise = Promise.all([
page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND')
])
Comment on lines +446 to 448
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Promise.all() with a single promise is unnecessary. Consider directly awaiting the waitForResponse call or removing the Promise.all wrapper for clarity.

Suggested change
const respPromise = Promise.all([
page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND')
])
const respPromise = page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND')

Copilot uses AI. Check for mistakes.
await editor.close(page)
await respPromise

await page.reload()
await page.locator(util.format(resourceNameSelector, name)).waitFor()
}
Expand Down