Skip to content

Commit

Permalink
give up for this iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 7, 2021
1 parent 814eaf2 commit 21e2d53
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions test/regressions/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as fse from 'fs-extra';
import { expect } from 'chai';
import * as path from 'path';
import * as playwright from 'playwright';

Expand Down Expand Up @@ -27,15 +26,6 @@ async function main() {
}
});

let errorConsole;

page.on('console', (msg) => {
// Filter out native user-agent errors e.g. "Failed to load resource: net::ERR_FAILED"
if (msg.args().length > 0 && (msg.type() === 'error' || msg.type() === 'warning')) {
errorConsole = msg.text();
}
});

// Wait for all requests to finish.
// This should load shared ressources such as fonts.
await page.goto(`${baseUrl}#no-dev`, { waitUntil: 'networkidle0' });
Expand Down Expand Up @@ -66,16 +56,8 @@ async function main() {
await browser.close();
});

it('should have no errors after the initial render', () => {
const msg = errorConsole;
errorConsole = undefined;
expect(msg).to.equal(undefined);
});

routes.forEach((route, index) => {
const pathURL = route.replace(baseUrl, '');

it(`creates screenshots of ${pathURL}`, async function test() {
it(`creates screenshots of ${route.replace(baseUrl, '')}`, async function test() {
// With the playwright inspector we might want to call `page.pause` which would lead to a timeout.
if (process.env.PWDEBUG) {
this.timeout(0);
Expand All @@ -99,12 +81,6 @@ async function main() {
await fse.ensureDir(path.dirname(screenshotPath));
await testcase.screenshot({ path: screenshotPath, type: 'png' });
});

it(`should have no errors rendering ${pathURL}`, () => {
const msg = errorConsole;
errorConsole = undefined;
expect(msg).to.equal(undefined);
});
});
});

Expand Down

0 comments on commit 21e2d53

Please sign in to comment.