Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions e2e/samples.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ sampleFolders.forEach((sampleFolder) => {
// Navigate to the page.
await page.goto(url);

// There must be no console errors.
// There must be no critical console errors.
await errorPromise;
expect(consoleErrors).toHaveLength(0);
const criticalErrors = consoleErrors.filter(error => !error.includes('Falling back to Raster'));
expect(criticalErrors).toHaveLength(0);

// Wait for the page DOM to load; this does NOT include the Google Maps APIs.
await page.waitForLoadState('domcontentloaded');
Expand All @@ -103,9 +104,6 @@ sampleFolders.forEach((sampleFolder) => {
// Insert a delay in ms to let the map load.
await new Promise((resolve) => setTimeout(resolve, 1000));

// Yo dawg, I heard you like tests, so I made you a test for testing your tests.
//await expect(page).toHaveTitle('Simple Map'); // Passes on the simple map page, fails on the other as expected.

// Assertions. These must be met or the test will fail.
// The sample must load the Google Maps API.
const hasGoogleMaps = await page.evaluate(() => {
Expand All @@ -125,4 +123,4 @@ sampleFolders.forEach((sampleFolder) => {
viteProcess.kill();
}
});
});
});