Skip to content

Commit 633ec4b

Browse files
committed
test: let it pass on Windows
On Windows, file names cannot contain question marks. We describe a work-around to allow rendering the site (which does contain pages whose URLs contain literal question marks, for historical reasons, and that can therefore unfortunately not be changed) by changing the affected `url` front-matter attributes to _not_ contain question marks. To let the resulting site pass the test suite, we need to adjust it a little. We also need to give the test more time because the `manual pages` test case seems to take a bit longer than those 30 seconds which are the default timeout of Playwright, at least in my setup. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e053a42 commit 633ec4b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/git-scm.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ test.afterEach(async ({ page }, testInfo) => {
2121
}
2222
})
2323

24+
if (process.platform === 'win32') test.setTimeout(60_000) // give it some time
25+
2426
test('generator is Hugo', async ({page}) => {
2527
await page.goto(url)
2628
await expect(page.locator('meta[name="generator"]')).toHaveAttribute('content', /^Hugo /)
@@ -250,7 +252,11 @@ test('book', async ({ page }) => {
250252

251253
// Navigate to a page whose URL contains a question mark
252254
await page.goto(`${url}book/az/v2/Başlanğıc-Git-Nədir?`)
253-
await expect(page).toHaveURL(/Ba%C5%9Flan%C4%9F%C4%B1c-Git-N%C9%99dir%3F/)
255+
if (process.platform === 'win32' && process.env.PLAYWRIGHT_TEST_URL?.startsWith('http://localhost')) {
256+
await expect(page).toHaveURL(/Ba%C5%9Flan%C4%9F%C4%B1c-Git-N%C9%99dir\?/)
257+
} else {
258+
await expect(page).toHaveURL(/Ba%C5%9Flan%C4%9F%C4%B1c-Git-N%C9%99dir%3F/)
259+
}
254260
await expect(page.getByRole('document')).toHaveText(/Snapshotlar, Fərqlər Yox/)
255261

256262
// the repository URL now points to the Azerbaijani translation

0 commit comments

Comments
 (0)