Skip to content

Commit

Permalink
fix sys dependent regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Mar 1, 2024
1 parent 9c05119 commit 70ba899
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions report-viewer/tests/e2e/OpenComparisonTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ const testSets: DataSet[] = [
secondSubmissionName: '1'
},
// Disabled due to https://github.com/jplag/JPlag/issues/1610
/*{ datasetName: 'fileMultiRoot-report.zip', firstSubmissionName: 'f0\\0.java', secondSubmissionName: 'f1\\1.java' },*/
{
datasetName: 'fileMultiRoot-report.zip',
firstSubmissionName: 'f0\\\\|/0.java',
secondSubmissionName: 'f1\\\\|/1.java'
},
{
datasetName: 'folderMultiRoot-report.zip',
firstSubmissionName: 'f0\\0',
secondSubmissionName: 'f1\\1'
firstSubmissionName: 'f0\\\\|/0',
secondSubmissionName: 'f1\\\\|/1'
}
]

Expand All @@ -35,15 +39,15 @@ for (const testSet of testSets) {
await uploadFile(testSet.datasetName, page)

const comparisonTable = await page.getByText('Cluster1').textContent()
expect(comparisonTable).toContain(
`1${testSet.firstSubmissionName}${testSet.secondSubmissionName}`
)
await page.getByText(`1${testSet.firstSubmissionName}${testSet.secondSubmissionName}`).click()

const lineRegEx = RegExp('1' + testSet.firstSubmissionName + testSet.secondSubmissionName)
expect(comparisonTable).toMatch(lineRegEx)
await page.getByText(lineRegEx).click()
await page.waitForURL(/\/comparison\/.*/)

const bodyComparison = await page.locator('body').textContent()
expect(bodyComparison).toContain(
`Comparison: ${testSet.firstSubmissionName} - ${testSet.secondSubmissionName}`
expect(bodyComparison).toMatch(
RegExp(`Comparison: ${testSet.firstSubmissionName} - ${testSet.secondSubmissionName}`)
)
})
}

0 comments on commit 70ba899

Please sign in to comment.