-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { expect, test } from '@playwright/test' | ||
import { uploadFile } from './TestUtils' | ||
|
||
const oldVersionZips = [ | ||
{ | ||
zipName: 'progpedia-report-v5_1_0.zip', | ||
version: '5.1.0', | ||
urlPostfix: 'v5' | ||
}, | ||
{ | ||
zipName: 'progpedia-report-v4_2_0.zip', | ||
version: '4.2.0', | ||
urlPostfix: 'v5' | ||
} | ||
] | ||
|
||
for (const oldVersion of oldVersionZips) { | ||
test(`Test old version redirect for v${oldVersion.version}`, async ({ page }) => { | ||
await page.goto('/') | ||
await uploadFile(oldVersion.zipName, page, '/old/' + oldVersion.version) | ||
|
||
const bodyContent = await page.locator('body').textContent() | ||
expect(bodyContent).toContain('You are trying to open a report from an older version of JPlag') | ||
expect(bodyContent).toContain(oldVersion.version) | ||
expect(bodyContent).toContain('You can access the old report viewer here:') | ||
expect(bodyContent).toContain('Open old report viewer') | ||
|
||
const oldVersionLinkElement = await page.locator('a').first() | ||
const oldVersionURL = await oldVersionLinkElement.getAttribute('href') | ||
expect(oldVersionURL.endsWith('/v5/')).toBeTruthy() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.