chore(firefox): mark all Puppeteer tests that are failing on FF (#3924)

This patch:
- introduces new testRunner methods `addTestDSL` and `addSuiteDSL`
  to add annotated test / suite.
- introduces new test/suite declaration methods: `it_fails_ffox` and
  `describe_fails_ffox`. These are equal to `it`/`describe` for chromium
  tests and to `xit`/`xdescribe` for firefox.
- marks all unsupported tests with `it_fails_ffox`
- adds a new command-line flag `'--firefox-status'` to `//test/test.js`.
  This flag dumps current amount of tests that are intentionally skipped
  for Firefox.

End goal: get rid of all `it_fails_ffox` and `describe_fails_ffox`
tests.

Drive-By: remove cookie tests  "afterEach" hook that was removing
cookies - it's not needed any more since every test is run in a
designated browser context.

References #3889
This commit is contained in:
Andrey Lushnikov
2019-02-05 22:32:41 -08:00
committed by GitHub
parent 86783c2495
commit 14fb3e38db
26 changed files with 230 additions and 202 deletions

View File

@@ -20,8 +20,8 @@ const iPhone = DeviceDescriptors['iPhone 6'];
const iPhoneLandscape = DeviceDescriptors['iPhone 6 landscape'];
module.exports.addTests = function({testRunner, expect, product}) {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner;
const {describe, xdescribe, fdescribe, describe_fails_ffox} = testRunner;
const {it, fit, xit, it_fails_ffox} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
describe('Page.viewport', function() {
@@ -72,7 +72,7 @@ module.exports.addTests = function({testRunner, expect, product}) {
await page.addScriptTag({url: server.PREFIX + '/modernizr.js'});
expect(await page.evaluate(() => Modernizr.touchevents)).toBe(true);
});
it('should support landscape emulation', async({page, server}) => {
it_fails_ffox('should support landscape emulation', async({page, server}) => {
await page.goto(server.PREFIX + '/mobile.html');
expect(await page.evaluate(() => screen.orientation.type)).toBe('portrait-primary');
await page.setViewport(iPhoneLandscape.viewport);
@@ -82,7 +82,7 @@ module.exports.addTests = function({testRunner, expect, product}) {
});
});
describe('Page.emulate', function() {
describe_fails_ffox('Page.emulate', function() {
it('should work', async({page, server}) => {
await page.goto(server.PREFIX + '/mobile.html');
await page.emulate(iPhone);
@@ -99,7 +99,7 @@ module.exports.addTests = function({testRunner, expect, product}) {
});
});
describe('Page.emulateMedia', function() {
describe_fails_ffox('Page.emulateMedia', function() {
it('should work', async({page, server}) => {
expect(await page.evaluate(() => window.matchMedia('screen').matches)).toBe(true);
expect(await page.evaluate(() => window.matchMedia('print').matches)).toBe(false);