-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
4ff942c
commit 23a7cfa
Showing
6 changed files
with
98 additions
and
8 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
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,38 @@ | ||
import fs from 'fs'; | ||
import { test, expect } from '../pages/basePage'; | ||
|
||
const datasetIds = JSON.parse(fs.readFileSync('e2e/playwrightTestData.json', 'utf8')).datasetIds; | ||
|
||
test.describe('catalog card routing', () => { | ||
for (const dataset of datasetIds) { | ||
test.only(`${dataset} routes to dataset details page`, async({ | ||
page, | ||
catalogPage, | ||
datasetPage, | ||
}) => { | ||
let pageErrorCalled = false; | ||
// Log all uncaught errors to the terminal to be visible in trace | ||
page.on('pageerror', exception => { | ||
console.log(`Uncaught exception: "${JSON.stringify(exception)}"`); | ||
pageErrorCalled = true; | ||
}); | ||
|
||
//mosaic isn't hit on all datasets | ||
const collectionsResponsePromise = page.waitForResponse(response => | ||
response.url().includes('collections') && response.status() === 200 | ||
); | ||
|
||
await page.goto(`data-catalog/${dataset}/explore`); | ||
await expect(page.getByText('Layers')).toBeVisible(); | ||
|
||
const mosaicResponse = await collectionsResponsePromise; | ||
expect(mosaicResponse.ok(), 'mapbox request should be successful').toBeTruthy(); | ||
|
||
// scroll page to bottom | ||
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)); | ||
|
||
expect(pageErrorCalled, 'no javascript exceptions thrown on page').toBe(false); | ||
}); | ||
} | ||
|
||
}); |
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