* pierremtb/adhoc-quick-sharelink-follow-up * Update snapshots * Update snapshots * Remove Linux from 2000 tests * Revert "Remove Linux from 2000 tests" This reverts commitad9bc58dd7
. * Remove Linux from 2000 tests and guard linux in the app too * Revert "Remove Linux from 2000 tests and guard linux in the app too" This reverts commite13983eb12
. * Break out test in two * Not * Add debug prints * Try to force userAgent in pw config * Revert "Try to force userAgent in pw config" This reverts commitd1e6d7c7be
. * Clean up * Add sad fix --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
import { expect, test } from '@e2e/playwright/zoo-test'
|
|
import type { Page } from '@playwright/test'
|
|
|
|
async function navigateAndClickOpenInDesktopApp(
|
|
page: Page,
|
|
codeLength: number
|
|
) {
|
|
const code = Array(codeLength).fill('0').join('')
|
|
const targetURL = `?create-file=true&browser=test&code=${code}&ask-open-desktop=true`
|
|
expect(targetURL.length).toEqual(codeLength + 58)
|
|
await page.goto(page.url() + targetURL)
|
|
expect(page.url()).toContain(targetURL)
|
|
const button = page.getByRole('button', { name: 'Open in desktop app' })
|
|
await button.click()
|
|
}
|
|
|
|
function getToastError(page: Page) {
|
|
return page.getByText('The URL is too long to open in the desktop app')
|
|
}
|
|
|
|
test.describe('Share link tests', () => {
|
|
test(
|
|
`Open in desktop app with 2000-long code works non-Windows`,
|
|
{ tag: ['@web', '@macos', '@linux'] },
|
|
async ({ page }) => {
|
|
test.skip(process.platform === 'win32')
|
|
const codeLength = 2000
|
|
await navigateAndClickOpenInDesktopApp(page, codeLength)
|
|
await expect(getToastError(page)).not.toBeVisible()
|
|
}
|
|
)
|
|
|
|
test(
|
|
`Open in desktop app with 1000-long code works on Windows`,
|
|
{ tag: ['@web', '@windows'] },
|
|
async ({ page }) => {
|
|
test.skip(process.platform !== 'win32')
|
|
const codeLength = 1000
|
|
await navigateAndClickOpenInDesktopApp(page, codeLength)
|
|
await expect(getToastError(page)).not.toBeVisible()
|
|
}
|
|
)
|
|
|
|
test(
|
|
`Open in desktop app with 2000-long code doesn't work on Windows`,
|
|
{ tag: ['@web', '@windows'] },
|
|
async ({ page }) => {
|
|
test.skip(process.platform !== 'win32')
|
|
const codeLength = 2000
|
|
await navigateAndClickOpenInDesktopApp(page, codeLength)
|
|
await expect(getToastError(page)).toBeVisible()
|
|
}
|
|
)
|
|
})
|