chore: group tests under tests/ (1) (#13081)

This commit is contained in:
Pavel Feldman 2022-03-25 15:05:50 -08:00 committed by GitHub
parent 5734c18ef8
commit 02cac8a066
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
133 changed files with 117 additions and 117 deletions

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
it('should close browser with beforeunload page', async ({ server, browserType }) => { it('should close browser with beforeunload page', async ({ server, browserType }) => {
const browser = await browserType.launch(); const browser = await browserType.launch();

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as test, expect } from './config/browserTest'; import { browserTest as test, expect } from '../config/browserTest';
test('should create new page @smoke', async function({ browser }) { test('should create new page @smoke', async function({ browser }) {
const page1 = await browser.newPage(); const page1 = await browser.newPage();

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, playwrightTest, expect } from './config/browserTest'; import { contextTest as it, playwrightTest, expect } from '../config/browserTest';
it('should work @smoke', async ({ context, page, server }) => { it('should work @smoke', async ({ context, page, server }) => {
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
it('should work with browser context scripts @smoke', async ({ context, server }) => { it('should work with browser context scripts @smoke', async ({ context, server }) => {
await context.addInitScript(() => window['temp'] = 123); await context.addInitScript(() => window['temp'] = 123);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should construct a new URL when a baseURL in browser.newContext is passed to page.goto @smoke', async function({ browser, server }) { it('should construct a new URL when a baseURL in browser.newContext is passed to page.goto @smoke', async function({ browser, server }) {
const context = await browser.newContext({ const context = await browser.newContext({

View file

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import { attachFrame, verifyViewport } from './config/utils'; import { attachFrame, verifyViewport } from '../config/utils';
it('should create new context @smoke', async function({ browser }) { it('should create new context @smoke', async function({ browser }) {
expect(browser.contexts().length).toBe(0); expect(browser.contexts().length).toBe(0);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
it('should clear cookies', async ({ context, page, server }) => { it('should clear cookies', async ({ context, page, server }) => {
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
it('should return no cookies in pristine browser context', async ({ context, page, server }) => { it('should return no cookies in pristine browser context', async ({ context, page, server }) => {
expect(await context.cookies()).toEqual([]); expect(await context.cookies()).toEqual([]);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should fail without credentials', async ({ browser, server, browserName, headless }) => { it('should fail without credentials', async ({ browser, server, browserName, headless }) => {
it.fail(browserName === 'chromium' && !headless); it.fail(browserName === 'chromium' && !headless);

View file

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import { attachFrame } from './config/utils'; import { attachFrame } from '../config/utils';
it('should bypass CSP meta tag @smoke', async ({ browser, server }) => { it('should bypass CSP meta tag @smoke', async ({ browser, server }) => {
// Make sure CSP prohibits addScriptTag. // Make sure CSP prohibits addScriptTag.

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it.describe('device', () => { it.describe('device', () => {
it.skip(({ browserName }) => browserName === 'firefox'); it.skip(({ browserName }) => browserName === 'firefox');

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should fetch lodpi assets @smoke', async ({ contextFactory, server }) => { it('should fetch lodpi assets @smoke', async ({ contextFactory, server }) => {
const context = await contextFactory({ const context = await contextFactory({

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
it('expose binding should work', async ({ context }) => { it('expose binding should work', async ({ context }) => {
let bindingSource; let bindingSource;

View file

@ -19,8 +19,8 @@ import http from 'http';
import zlib from 'zlib'; import zlib from 'zlib';
import fs from 'fs'; import fs from 'fs';
import { pipeline } from 'stream'; import { pipeline } from 'stream';
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
import { suppressCertificateWarning } from './config/utils'; import { suppressCertificateWarning } from '../config/utils';
it.skip(({ mode }) => mode !== 'default'); it.skip(({ mode }) => mode !== 'default');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should affect accept-language header @smoke', async ({ browser, server }) => { it('should affect accept-language header @smoke', async ({ browser, server }) => {
const context = await browser.newContext({ locale: 'fr-CH' }); const context = await browser.newContext({ locale: 'fr-CH' });

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('BrowserContext.Events.Request', async ({ context, server }) => { it('BrowserContext.Events.Request', async ({ context, server }) => {
const page = await context.newPage(); const page = await context.newPage();

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should have url', async ({ browser, server }) => { it('should have url', async ({ browser, server }) => {
const context = await browser.newContext(); const context = await browser.newContext();

View file

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import { attachFrame, chromiumVersionLessThan } from './config/utils'; import { attachFrame, chromiumVersionLessThan } from '../config/utils';
it('should not be visible in context.pages', async ({ contextFactory }) => { it('should not be visible in context.pages', async ({ contextFactory }) => {
const context = await contextFactory(); const context = await contextFactory();

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it.use({ it.use({
launchOptions: async ({ launchOptions }, use) => { launchOptions: async ({ launchOptions }, use) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should intercept', async ({ browser, server }) => { it('should intercept', async ({ browser, server }) => {
const context = await browser.newContext(); const context = await browser.newContext();

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should override extra headers from browser context', async ({ browser, server }) => { it('should override extra headers from browser context', async ({ browser, server }) => {
const context = await browser.newContext({ const context = await browser.newContext({

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import fs from 'fs'; import fs from 'fs';
it('should capture local storage', async ({ contextFactory }) => { it('should capture local storage', async ({ contextFactory }) => {

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should not fail page.textContent in non-strict mode', async ({ page }) => { it('should not fail page.textContent in non-strict mode', async ({ page }) => {
await page.setContent(`<span>span1</span><div><span>target</span></div>`); await page.setContent(`<span>span1</span><div><span>target</span></div>`);

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should work @smoke', async ({ browser, browserName }) => { it('should work @smoke', async ({ browser, browserName }) => {
const func = () => new Date(1479579154987).toString(); const func = () => new Date(1479579154987).toString();

View file

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import { attachFrame } from './config/utils'; import { attachFrame } from '../config/utils';
it('should work', async ({ browser, server }) => { it('should work', async ({ browser, server }) => {
{ {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it.describe('mobile viewport', () => { it.describe('mobile viewport', () => {
it.skip(({ browserName }) => browserName === 'firefox'); it.skip(({ browserName }) => browserName === 'firefox');

View file

@ -15,9 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
import { browserTest } from './config/browserTest'; import { browserTest } from '../config/browserTest';
import { verifyViewport } from './config/utils'; import { verifyViewport } from '../config/utils';
it('should get the proper default viewport size', async ({ page, server }) => { it('should get the proper default viewport size', async ({ page, server }) => {
await verifyViewport(page, 1280, 720); await verifyViewport(page, 1280, 720);

View file

@ -16,7 +16,7 @@
*/ */
import fs from 'fs'; import fs from 'fs';
import { playwrightTest as test, expect } from './config/browserTest'; import { playwrightTest as test, expect } from '../config/browserTest';
test('browserType.executablePath should work', async ({ browserType, channel }) => { test('browserType.executablePath should work', async ({ browserType, channel }) => {
test.skip(!!channel, 'We skip browser download when testing a channel'); test.skip(!!channel, 'We skip browser download when testing a channel');

View file

@ -18,10 +18,10 @@
import fs from 'fs'; import fs from 'fs';
import os from 'os'; import os from 'os';
import * as path from 'path'; import * as path from 'path';
import { getUserAgent } from '../packages/playwright-core/lib/utils/utils'; import { getUserAgent } from '../../packages/playwright-core/lib/utils/utils';
import WebSocket from 'ws'; import WebSocket from 'ws';
import { expect, playwrightTest as test } from './config/browserTest'; import { expect, playwrightTest as test } from '../config/browserTest';
import { parseTrace, suppressCertificateWarning } from './config/utils'; import { parseTrace, suppressCertificateWarning } from '../config/utils';
import formidable from 'formidable'; import formidable from 'formidable';
test.slow(true, 'All connect tests are slow'); test.slow(true, 'All connect tests are slow');

View file

@ -14,11 +14,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as test, expect } from './config/browserTest'; import { playwrightTest as test, expect } from '../config/browserTest';
import type { TestInfo } from '@playwright/test'; import type { TestInfo } from '@playwright/test';
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
import { start } from '../packages/playwright-core/lib/outofprocess'; import { start } from '../../packages/playwright-core/lib/outofprocess';
const chromeDriver = process.env.PWTEST_CHROMEDRIVER; const chromeDriver = process.env.PWTEST_CHROMEDRIVER;
const brokenDriver = path.join(__dirname, 'assets', 'selenium-grid', 'broken-selenium-driver.js'); const brokenDriver = path.join(__dirname, 'assets', 'selenium-grid', 'broken-selenium-driver.js');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
it.describe('launch server', () => { it.describe('launch server', () => {
it.skip(({ mode }) => mode !== 'default'); it.skip(({ mode }) => mode !== 'default');

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
it('should reject all promises when browser is closed', async ({ browserType }) => { it('should reject all promises when browser is closed', async ({ browserType }) => {
const browser = await browserType.launch(); const browser = await browserType.launch();

View file

@ -16,7 +16,7 @@
import os from 'os'; import os from 'os';
import url from 'url'; import url from 'url';
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
it('SharedArrayBuffer should work @smoke', async function({ contextFactory, httpsServer, browserName }) { it('SharedArrayBuffer should work @smoke', async function({ contextFactory, httpsServer, browserName }) {
it.fail(browserName === 'webkit', 'no shared array buffer on webkit'); it.fail(browserName === 'webkit', 'no shared array buffer on webkit');

View file

@ -16,7 +16,7 @@
*/ */
import domain from 'domain'; import domain from 'domain';
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
// Use something worker-scoped (e.g. launch args) to force a new worker for this file. // Use something worker-scoped (e.g. launch args) to force a new worker for this file.
// Otherwise, a browser launched for other tests in this worker will affect the expectations. // Otherwise, a browser launched for other tests in this worker will affect the expectations.

View file

@ -15,12 +15,12 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as test, expect } from '../config/browserTest'; import { contextTest as test, expect } from '../../config/browserTest';
import { playwrightTest } from '../config/browserTest'; import { playwrightTest } from '../../config/browserTest';
import http from 'http'; import http from 'http';
import fs from 'fs'; import fs from 'fs';
import { getUserAgent } from '../../packages/playwright-core/lib/utils/utils'; import { getUserAgent } from '../../../packages/playwright-core/lib/utils/utils';
import { suppressCertificateWarning } from '../config/utils'; import { suppressCertificateWarning } from '../../config/utils';
test('should create a worker from a service worker', async ({ page, server }) => { test('should create a worker from a service worker', async ({ page, server }) => {
const [worker] = await Promise.all([ const [worker] = await Promise.all([

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from '../config/browserTest'; import { contextTest as it, expect } from '../../config/browserTest';
it('should work', async function({ page, server }) { it('should work', async function({ page, server }) {
await page.coverage.startCSSCoverage(); await page.coverage.startCSSCoverage();

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from '../config/browserTest'; import { contextTest as it, expect } from '../../config/browserTest';
it.skip(({ trace }) => trace === 'on'); it.skip(({ trace }) => trace === 'on');

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from '../config/browserTest'; import { playwrightTest as it, expect } from '../../config/browserTest';
it('should throw with remote-debugging-pipe argument', async ({ browserType, mode }) => { it('should throw with remote-debugging-pipe argument', async ({ browserType, mode }) => {
it.skip(mode !== 'default'); it.skip(mode !== 'default');

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from '../config/browserTest'; import { contextTest as it, expect } from '../../config/browserTest';
it.use({ it.use({
launchOptions: async ({ launchOptions }, use) => { launchOptions: async ({ launchOptions }, use) => {

View file

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from '../config/browserTest'; import { contextTest as it, expect } from '../../config/browserTest';
import { browserTest } from '../config/browserTest'; import { browserTest } from '../../config/browserTest';
it('should work', async function({ page }) { it('should work', async function({ page }) {
const client = await page.context().newCDPSession(page); const client = await page.context().newCDPSession(page);

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from '../config/browserTest'; import { browserTest as it, expect } from '../../config/browserTest';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';

View file

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
import { ParsedComponentSelector, parseComponentSelector } from '../packages/playwright-core/src/server/injected/componentUtils'; import { ParsedComponentSelector, parseComponentSelector } from '../../packages/playwright-core/src/server/injected/componentUtils';
const parse = parseComponentSelector; const parse = parseComponentSelector;
const serialize = (parsed: ParsedComponentSelector) => { const serialize = (parsed: ParsedComponentSelector) => {

View file

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
import { parseCSS, serializeSelector as serialize } from '../packages/playwright-core/lib/server/common/cssParser'; import { parseCSS, serializeSelector as serialize } from '../../packages/playwright-core/lib/server/common/cssParser';
const parse = (selector: string) => { const parse = (selector: string) => {
return parseCSS(selector, new Set(['text', 'not', 'has', 'react', 'scope', 'right-of', 'is'])).selector; return parseCSS(selector, new Set(['text', 'not', 'has', 'react', 'scope', 'right-of', 'is'])).selector;

View file

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
import { verifyViewport } from './config/utils'; import { verifyViewport } from '../config/utils';
import fs from 'fs'; import fs from 'fs';
it('context.cookies() should work @smoke', async ({ server, launchPersistent, defaultSameSiteCookieValue }) => { it('context.cookies() should work @smoke', async ({ server, launchPersistent, defaultSameSiteCookieValue }) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import crypto from 'crypto'; import crypto from 'crypto';

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';

View file

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, browserTest, expect } from './config/browserTest'; import { contextTest as it, browserTest, expect } from '../config/browserTest';
import { attachFrame } from './config/utils'; import { attachFrame } from '../config/utils';
it('should think that it is focused by default', async ({ page }) => { it('should think that it is focused by default', async ({ page }) => {
expect(await page.evaluate('document.hasFocus()')).toBe(true); expect(await page.evaluate('document.hasFocus()')).toBe(true);

View file

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 333 B

View file

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it } from './config/browserTest'; import { contextTest as it } from '../config/browserTest';
it('should load svg favicon with prefer-color-scheme', async ({ page, server, browserName, channel, headless, asset }) => { it('should load svg favicon with prefer-color-scheme', async ({ page, server, browserName, channel, headless, asset }) => {
it.skip(headless && browserName !== 'firefox', 'headless browsers, except firefox, do not request favicons'); it.skip(headless && browserName !== 'firefox', 'headless browsers, except firefox, do not request favicons');

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from '../config/browserTest'; import { playwrightTest as it, expect } from '../../config/browserTest';
it('should pass firefox user preferences', async ({ browserType }) => { it('should pass firefox user preferences', async ({ browserType }) => {
const browser = await browserType.launch({ const browser = await browserType.launch({

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should work @smoke', async ({ server, contextFactory }) => { it('should work @smoke', async ({ server, contextFactory }) => {
const context = await contextFactory(); const context = await contextFactory();

View file

@ -17,7 +17,7 @@
import fs from 'fs'; import fs from 'fs';
import http from 'http'; import http from 'http';
import type { APIRequestContext } from 'playwright-core'; import type { APIRequestContext } from 'playwright-core';
import { expect, playwrightTest } from './config/browserTest'; import { expect, playwrightTest } from '../config/browserTest';
export type GlobalFetchFixtures = { export type GlobalFetchFixtures = {
request: APIRequestContext; request: APIRequestContext;

View file

@ -17,8 +17,8 @@
import http from 'http'; import http from 'http';
import os from 'os'; import os from 'os';
import * as util from 'util'; import * as util from 'util';
import { getPlaywrightVersion } from '../packages/playwright-core/lib/utils/utils'; import { getPlaywrightVersion } from '../../packages/playwright-core/lib/utils/utils';
import { expect, playwrightTest as it } from './config/browserTest'; import { expect, playwrightTest as it } from '../config/browserTest';
it.skip(({ mode }) => mode !== 'default'); it.skip(({ mode }) => mode !== 'default');

View file

@ -15,13 +15,13 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import * as path from 'path'; import * as path from 'path';
import fs from 'fs'; import fs from 'fs';
import http2 from 'http2'; import http2 from 'http2';
import type { BrowserContext, BrowserContextOptions } from 'playwright-core'; import type { BrowserContext, BrowserContextOptions } from 'playwright-core';
import type { AddressInfo } from 'net'; import type { AddressInfo } from 'net';
import type { Log } from '../packages/playwright-core/src/server/supplements/har/har'; import type { Log } from '../../packages/playwright-core/src/server/supplements/har/har';
async function pageWithHar(contextFactory: (options?: BrowserContextOptions) => Promise<BrowserContext>, testInfo: any, outputPath: string = 'test.har') { async function pageWithHar(contextFactory: (options?: BrowserContextOptions) => Promise<BrowserContext>, testInfo: any, outputPath: string = 'test.har') {
const harPath = testInfo.outputPath(outputPath); const harPath = testInfo.outputPath(outputPath);
@ -48,7 +48,7 @@ it('should have version and creator', async ({ contextFactory, server }, testInf
const log = await getLog(); const log = await getLog();
expect(log.version).toBe('1.2'); expect(log.version).toBe('1.2');
expect(log.creator.name).toBe('Playwright'); expect(log.creator.name).toBe('Playwright');
expect(log.creator.version).toBe(require('../package.json')['version']); expect(log.creator.version).toBe(require('../../package.json')['version']);
}); });
it('should have browser', async ({ browserName, browser, contextFactory, server }, testInfo) => { it('should have browser', async ({ browserName, browser, contextFactory, server }, testInfo) => {
@ -500,8 +500,8 @@ it('should contain http2 for http2 requests', async ({ contextFactory, browserNa
it.fixme(browserName === 'webkit' && platform === 'win32'); it.fixme(browserName === 'webkit' && platform === 'win32');
const server = http2.createSecureServer({ const server = http2.createSecureServer({
key: await fs.promises.readFile(path.join(__dirname, '..', 'utils', 'testserver', 'key.pem')), key: await fs.promises.readFile(path.join(__dirname, '..', '..', 'utils', 'testserver', 'key.pem')),
cert: await fs.promises.readFile(path.join(__dirname, '..', 'utils', 'testserver', 'cert.pem')), cert: await fs.promises.readFile(path.join(__dirname, '..', '..', 'utils', 'testserver', 'cert.pem')),
}); });
server.on('stream', stream => { server.on('stream', stream => {
stream.respond({ stream.respond({

View file

@ -16,7 +16,7 @@
import pixelmatch from 'pixelmatch'; import pixelmatch from 'pixelmatch';
import { PNG } from 'pngjs'; import { PNG } from 'pngjs';
import { expect, playwrightTest as it } from './config/browserTest'; import { expect, playwrightTest as it } from '../config/browserTest';
it('should have default url when launching browser @smoke', async ({ browserType, createUserDataDir }) => { it('should have default url when launching browser @smoke', async ({ browserType, createUserDataDir }) => {
const browserContext = await browserType.launchPersistentContext(await createUserDataDir(), { headless: false }); const browserContext = await browserType.launchPersistentContext(await createUserDataDir(), { headless: false });

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
declare const renderComponent; declare const renderComponent;
declare const e; declare const e;

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should work @smoke', async ({ browser, httpsServer }) => { it('should work @smoke', async ({ browser, httpsServer }) => {
let error = null; let error = null;

View file

@ -18,7 +18,7 @@ import path from 'path';
import fs from 'fs'; import fs from 'fs';
import { test, expect } from './inspectorTest'; import { test, expect } from './inspectorTest';
const emptyHTML = new URL('file://' + path.join(__dirname, '..', 'assets', 'empty.html')).toString(); const emptyHTML = new URL('file://' + path.join(__dirname, '..', '..', 'assets', 'empty.html')).toString();
const launchOptions = (channel: string) => { const launchOptions = (channel: string) => {
return channel ? `Headless = false,\n Channel = "${channel}",` : `Headless = false,`; return channel ? `Headless = false,\n Channel = "${channel}",` : `Headless = false,`;
}; };

View file

@ -18,7 +18,7 @@ import fs from 'fs';
import path from 'path'; import path from 'path';
import { test, expect } from './inspectorTest'; import { test, expect } from './inspectorTest';
const emptyHTML = new URL('file://' + path.join(__dirname, '..', 'assets', 'empty.html')).toString(); const emptyHTML = new URL('file://' + path.join(__dirname, '..', '..', 'assets', 'empty.html')).toString();
const launchOptions = (channel: string) => { const launchOptions = (channel: string) => {
return channel ? `.setHeadless(false)\n .setChannel("${channel}")` : '.setHeadless(false)'; return channel ? `.setHeadless(false)\n .setChannel("${channel}")` : '.setHeadless(false)';
}; };

View file

@ -18,7 +18,7 @@ import fs from 'fs';
import path from 'path'; import path from 'path';
import { test, expect } from './inspectorTest'; import { test, expect } from './inspectorTest';
const emptyHTML = new URL('file://' + path.join(__dirname, '..', 'assets', 'empty.html')).toString(); const emptyHTML = new URL('file://' + path.join(__dirname, '..', '..', 'assets', 'empty.html')).toString();
const launchOptions = (channel: string) => { const launchOptions = (channel: string) => {
return channel ? `headless: false,\n channel: '${channel}'` : 'headless: false'; return channel ? `headless: false,\n channel: '${channel}'` : 'headless: false';

View file

@ -18,7 +18,7 @@ import fs from 'fs';
import path from 'path'; import path from 'path';
import { test, expect } from './inspectorTest'; import { test, expect } from './inspectorTest';
const emptyHTML = new URL('file://' + path.join(__dirname, '..', 'assets', 'empty.html')).toString(); const emptyHTML = new URL('file://' + path.join(__dirname, '..', '..', 'assets', 'empty.html')).toString();
const launchOptions = (channel: string) => { const launchOptions = (channel: string) => {
return channel ? `headless=False, channel="${channel}"` : 'headless=False'; return channel ? `headless=False, channel="${channel}"` : 'headless=False';
}; };

View file

@ -18,7 +18,7 @@ import fs from 'fs';
import path from 'path'; import path from 'path';
import { test, expect } from './inspectorTest'; import { test, expect } from './inspectorTest';
const emptyHTML = new URL('file://' + path.join(__dirname, '..', 'assets', 'empty.html')).toString(); const emptyHTML = new URL('file://' + path.join(__dirname, '..', '..', 'assets', 'empty.html')).toString();
const launchOptions = (channel: string) => { const launchOptions = (channel: string) => {
return channel ? `headless=False, channel="${channel}"` : 'headless=False'; return channel ? `headless=False, channel="${channel}"` : 'headless=False';
}; };

View file

@ -18,7 +18,7 @@ import fs from 'fs';
import path from 'path'; import path from 'path';
import { test, expect } from './inspectorTest'; import { test, expect } from './inspectorTest';
const emptyHTML = new URL('file://' + path.join(__dirname, '..', 'assets', 'empty.html')).toString(); const emptyHTML = new URL('file://' + path.join(__dirname, '..', '..', 'assets', 'empty.html')).toString();
test('should print the correct imports and context options', async ({ runCLI }) => { test('should print the correct imports and context options', async ({ runCLI }) => {
const cli = runCLI([emptyHTML]); const cli = runCLI([emptyHTML]);

View file

@ -14,11 +14,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest } from '../config/browserTest'; import { contextTest } from '../../config/browserTest';
import type { Page } from 'playwright-core'; import type { Page } from 'playwright-core';
import * as path from 'path'; import * as path from 'path';
import type { Source } from '../../packages/playwright-core/src/server/supplements/recorder/recorderTypes'; import type { Source } from '../../../packages/playwright-core/src/server/supplements/recorder/recorderTypes';
import { CommonFixtures, TestChildProcess } from '../config/commonFixtures'; import { CommonFixtures, TestChildProcess } from '../../config/commonFixtures';
export { expect } from '@playwright/test'; export { expect } from '@playwright/test';
type CLITestArgs = { type CLITestArgs = {
@ -28,7 +28,7 @@ type CLITestArgs = {
runCLI: (args: string[]) => CLIMock; runCLI: (args: string[]) => CLIMock;
}; };
const playwrightToAutomateInspector = require('../../packages/playwright-core/lib/inProcessFactory').createInProcessPlaywright(); const playwrightToAutomateInspector = require('../../../packages/playwright-core/lib/inProcessFactory').createInProcessPlaywright();
export const test = contextTest.extend<CLITestArgs>({ export const test = contextTest.extend<CLITestArgs>({
recorderPageGetter: async ({ context, toImpl, mode }, run, testInfo) => { recorderPageGetter: async ({ context, toImpl, mode }, run, testInfo) => {
@ -186,7 +186,7 @@ class CLIMock {
constructor(childProcess: CommonFixtures['childProcess'], browserName: string, channel: string | undefined, headless: boolean | undefined, args: string[], executablePath: string | undefined) { constructor(childProcess: CommonFixtures['childProcess'], browserName: string, channel: string | undefined, headless: boolean | undefined, args: string[], executablePath: string | undefined) {
const nodeArgs = [ const nodeArgs = [
'node', 'node',
path.join(__dirname, '..', '..', 'packages', 'playwright-core', 'lib', 'cli', 'cli.js'), path.join(__dirname, '..', '..', '..', 'packages', 'playwright-core', 'lib', 'cli', 'cli.js'),
'codegen', 'codegen',
...args, ...args,
`--browser=${browserName}`, `--browser=${browserName}`,

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
it('should have an errors object', async ({ playwright }) => { it('should have an errors object', async ({ playwright }) => {
expect(String(playwright.errors.TimeoutError)).toContain('TimeoutError'); expect(String(playwright.errors.TimeoutError)).toContain('TimeoutError');

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
it('should log @smoke', async ({ browserType }) => { it('should log @smoke', async ({ browserType }) => {
const log = []; const log = [];

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import fs from 'fs'; import fs from 'fs';
async function checkFeatures(name: string, context: any, server: any) { async function checkFeatures(name: string, context: any, server: any) {

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
import fs from 'fs'; import fs from 'fs';
it('should be able to save file', async ({ contextFactory, headless, browserName }, testInfo) => { it('should be able to save file', async ({ contextFactory, headless, browserName }, testInfo) => {

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as it, expect } from './config/browserTest'; import { contextTest as it, expect } from '../config/browserTest';
function getPermission(page, name) { function getPermission(page, name) {
return page.evaluate(name => navigator.permissions.query({ name }).then(result => result.state), name); return page.evaluate(name => navigator.permissions.query({ name }).then(result => result.state), name);

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should inherit user agent from browser context @smoke', async function({ browser, server }) { it('should inherit user agent from browser context @smoke', async function({ browser, server }) {
const context = await browser.newContext({ const context = await browser.newContext({

View file

@ -19,7 +19,7 @@ import http from 'http';
import path from 'path'; import path from 'path';
import net from 'net'; import net from 'net';
import { contextTest, expect } from './config/browserTest'; import { contextTest, expect } from '../config/browserTest';
import type { Page, Browser } from 'playwright-core'; import type { Page, Browser } from 'playwright-core';
class OutOfProcessPlaywrightServer { class OutOfProcessPlaywrightServer {
@ -27,7 +27,7 @@ class OutOfProcessPlaywrightServer {
private _receivedPortPromise: Promise<string>; private _receivedPortPromise: Promise<string>;
constructor(port: number, proxyPort: number) { constructor(port: number, proxyPort: number) {
this._driverProcess = childProcess.fork(path.join(__dirname, '..', 'packages', 'playwright-core', 'lib', 'cli', 'cli.js'), ['run-server', '--port', port.toString()], { this._driverProcess = childProcess.fork(path.join(__dirname, '..', '..', 'packages', 'playwright-core', 'lib', 'cli', 'cli.js'), ['run-server', '--port', port.toString()], {
stdio: 'pipe', stdio: 'pipe',
detached: true, detached: true,
env: { env: {

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { playwrightTest as it, expect } from './config/browserTest'; import { playwrightTest as it, expect } from '../config/browserTest';
import socks from 'socksv5'; import socks from 'socksv5';
import net from 'net'; import net from 'net';

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { browserTest as it, expect } from './config/browserTest'; import { browserTest as it, expect } from '../config/browserTest';
it('should work @smoke', async ({ contextFactory, server }) => { it('should work @smoke', async ({ contextFactory, server }) => {
const context = await contextFactory(); const context = await contextFactory();

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { contextTest as test, expect } from './config/browserTest'; import { contextTest as test, expect } from '../config/browserTest';
import fs from 'fs'; import fs from 'fs';
test('wpt accname', async ({ page, asset, server, browserName }) => { test('wpt accname', async ({ page, asset, server, browserName }) => {

View file

@ -15,9 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { expect, browserTest } from './config/browserTest'; import { expect, browserTest } from '../config/browserTest';
import { PNG } from 'pngjs'; import { PNG } from 'pngjs';
import { verifyViewport } from './config/utils'; import { verifyViewport } from '../config/utils';
browserTest.describe('page screenshot', () => { browserTest.describe('page screenshot', () => {
browserTest.skip(({ browserName, headless }) => browserName === 'firefox' && !headless, 'Firefox headed produces a different image.'); browserTest.skip(({ browserName, headless }) => browserName === 'firefox' && !headless, 'Firefox headed produces a different image.');

View file

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 475 B

View file

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 333 B

View file

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

View file

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 301 B

View file

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 200 B

View file

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 296 B

Some files were not shown because too many files have changed in this diff Show more