chore: group tests under tests/ (1) (#13081)
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const browser = await browserType.launch();
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 }) {
|
||||
const page1 = await browser.newPage();
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
await context.addInitScript(() => window['temp'] = 123);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) {
|
||||
const context = await browser.newContext({
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { attachFrame, verifyViewport } from './config/utils';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
import { attachFrame, verifyViewport } from '../config/utils';
|
||||
|
||||
it('should create new context @smoke', async function({ browser }) {
|
||||
expect(browser.contexts().length).toBe(0);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
expect(await context.cookies()).toEqual([]);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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.fail(browserName === 'chromium' && !headless);
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { attachFrame } from './config/utils';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
import { attachFrame } from '../config/utils';
|
||||
|
||||
it('should bypass CSP meta tag @smoke', async ({ browser, server }) => {
|
||||
// Make sure CSP prohibits addScriptTag.
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
|
||||
it.describe('device', () => {
|
||||
it.skip(({ browserName }) => browserName === 'firefox');
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 }) => {
|
||||
const context = await contextFactory({
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
let bindingSource;
|
||||
|
|
@ -19,8 +19,8 @@ import http from 'http';
|
|||
import zlib from 'zlib';
|
||||
import fs from 'fs';
|
||||
import { pipeline } from 'stream';
|
||||
import { contextTest as it, expect } from './config/browserTest';
|
||||
import { suppressCertificateWarning } from './config/utils';
|
||||
import { contextTest as it, expect } from '../config/browserTest';
|
||||
import { suppressCertificateWarning } from '../config/utils';
|
||||
|
||||
it.skip(({ mode }) => mode !== 'default');
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const context = await browser.newContext({ locale: 'fr-CH' });
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const page = await context.newPage();
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const context = await browser.newContext();
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { attachFrame, chromiumVersionLessThan } from './config/utils';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
import { attachFrame, chromiumVersionLessThan } from '../config/utils';
|
||||
|
||||
it('should not be visible in context.pages', async ({ contextFactory }) => {
|
||||
const context = await contextFactory();
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
|
||||
it.use({
|
||||
launchOptions: async ({ launchOptions }, use) => {
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const context = await browser.newContext();
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const context = await browser.newContext({
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
import fs from 'fs';
|
||||
|
||||
it('should capture local storage', async ({ contextFactory }) => {
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 }) => {
|
||||
await page.setContent(`<span>span1</span><div><span>target</span></div>`);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const func = () => new Date(1479579154987).toString();
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { attachFrame } from './config/utils';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
import { attachFrame } from '../config/utils';
|
||||
|
||||
it('should work', async ({ browser, server }) => {
|
||||
{
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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.skip(({ browserName }) => browserName === 'firefox');
|
||||
|
|
@ -15,9 +15,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest as it, expect } from './config/browserTest';
|
||||
import { browserTest } from './config/browserTest';
|
||||
import { verifyViewport } from './config/utils';
|
||||
import { contextTest as it, expect } from '../config/browserTest';
|
||||
import { browserTest } from '../config/browserTest';
|
||||
import { verifyViewport } from '../config/utils';
|
||||
|
||||
it('should get the proper default viewport size', async ({ page, server }) => {
|
||||
await verifyViewport(page, 1280, 720);
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
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.skip(!!channel, 'We skip browser download when testing a channel');
|
||||
|
|
@ -18,10 +18,10 @@
|
|||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
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 { expect, playwrightTest as test } from './config/browserTest';
|
||||
import { parseTrace, suppressCertificateWarning } from './config/utils';
|
||||
import { expect, playwrightTest as test } from '../config/browserTest';
|
||||
import { parseTrace, suppressCertificateWarning } from '../config/utils';
|
||||
import formidable from 'formidable';
|
||||
|
||||
test.slow(true, 'All connect tests are slow');
|
||||
|
|
@ -14,11 +14,11 @@
|
|||
* 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 path from 'path';
|
||||
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 brokenDriver = path.join(__dirname, 'assets', 'selenium-grid', 'broken-selenium-driver.js');
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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.skip(({ mode }) => mode !== 'default');
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const browser = await browserType.launch();
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
import os from 'os';
|
||||
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.fail(browserName === 'webkit', 'no shared array buffer on webkit');
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
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.
|
||||
// Otherwise, a browser launched for other tests in this worker will affect the expectations.
|
||||
|
|
@ -15,12 +15,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest as test, expect } from '../config/browserTest';
|
||||
import { playwrightTest } from '../config/browserTest';
|
||||
import { contextTest as test, expect } from '../../config/browserTest';
|
||||
import { playwrightTest } from '../../config/browserTest';
|
||||
import http from 'http';
|
||||
import fs from 'fs';
|
||||
import { getUserAgent } from '../../packages/playwright-core/lib/utils/utils';
|
||||
import { suppressCertificateWarning } from '../config/utils';
|
||||
import { getUserAgent } from '../../../packages/playwright-core/lib/utils/utils';
|
||||
import { suppressCertificateWarning } from '../../config/utils';
|
||||
|
||||
test('should create a worker from a service worker', async ({ page, server }) => {
|
||||
const [worker] = await Promise.all([
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 }) {
|
||||
await page.coverage.startCSSCoverage();
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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');
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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.skip(mode !== 'default');
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest as it, expect } from '../config/browserTest';
|
||||
import { contextTest as it, expect } from '../../config/browserTest';
|
||||
|
||||
it.use({
|
||||
launchOptions: async ({ launchOptions }, use) => {
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest as it, expect } from '../config/browserTest';
|
||||
import { browserTest } from '../config/browserTest';
|
||||
import { contextTest as it, expect } from '../../config/browserTest';
|
||||
import { browserTest } from '../../config/browserTest';
|
||||
|
||||
it('should work', async function({ page }) {
|
||||
const client = await page.context().newCDPSession(page);
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 path from 'path';
|
||||
|
||||
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { playwrightTest as it, expect } from './config/browserTest';
|
||||
import { ParsedComponentSelector, parseComponentSelector } from '../packages/playwright-core/src/server/injected/componentUtils';
|
||||
import { playwrightTest as it, expect } from '../config/browserTest';
|
||||
import { ParsedComponentSelector, parseComponentSelector } from '../../packages/playwright-core/src/server/injected/componentUtils';
|
||||
|
||||
const parse = parseComponentSelector;
|
||||
const serialize = (parsed: ParsedComponentSelector) => {
|
||||
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { playwrightTest as it, expect } from './config/browserTest';
|
||||
import { parseCSS, serializeSelector as serialize } from '../packages/playwright-core/lib/server/common/cssParser';
|
||||
import { playwrightTest as it, expect } from '../config/browserTest';
|
||||
import { parseCSS, serializeSelector as serialize } from '../../packages/playwright-core/lib/server/common/cssParser';
|
||||
|
||||
const parse = (selector: string) => {
|
||||
return parseCSS(selector, new Set(['text', 'not', 'has', 'react', 'scope', 'right-of', 'is'])).selector;
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { playwrightTest as it, expect } from './config/browserTest';
|
||||
import { verifyViewport } from './config/utils';
|
||||
import { playwrightTest as it, expect } from '../config/browserTest';
|
||||
import { verifyViewport } from '../config/utils';
|
||||
import fs from 'fs';
|
||||
|
||||
it('context.cookies() should work @smoke', async ({ server, launchPersistent, defaultSameSiteCookieValue }) => {
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 path from 'path';
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 path from 'path';
|
||||
import crypto from 'crypto';
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 path from 'path';
|
||||
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest as it, browserTest, expect } from './config/browserTest';
|
||||
import { attachFrame } from './config/utils';
|
||||
import { contextTest as it, browserTest, expect } from '../config/browserTest';
|
||||
import { attachFrame } from '../config/utils';
|
||||
|
||||
it('should think that it is focused by default', async ({ page }) => {
|
||||
expect(await page.evaluate('document.hasFocus()')).toBe(true);
|
||||
|
Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 475 B |
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 333 B |
|
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
|
@ -15,7 +15,7 @@
|
|||
* 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.skip(headless && browserName !== 'firefox', 'headless browsers, except firefox, do not request favicons');
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 }) => {
|
||||
const browser = await browserType.launch({
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const context = await contextFactory();
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
import fs from 'fs';
|
||||
import http from 'http';
|
||||
import type { APIRequestContext } from 'playwright-core';
|
||||
import { expect, playwrightTest } from './config/browserTest';
|
||||
import { expect, playwrightTest } from '../config/browserTest';
|
||||
|
||||
export type GlobalFetchFixtures = {
|
||||
request: APIRequestContext;
|
||||
|
|
@ -17,8 +17,8 @@
|
|||
import http from 'http';
|
||||
import os from 'os';
|
||||
import * as util from 'util';
|
||||
import { getPlaywrightVersion } from '../packages/playwright-core/lib/utils/utils';
|
||||
import { expect, playwrightTest as it } from './config/browserTest';
|
||||
import { getPlaywrightVersion } from '../../packages/playwright-core/lib/utils/utils';
|
||||
import { expect, playwrightTest as it } from '../config/browserTest';
|
||||
|
||||
it.skip(({ mode }) => mode !== 'default');
|
||||
|
||||
|
|
@ -15,13 +15,13 @@
|
|||
* 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 fs from 'fs';
|
||||
import http2 from 'http2';
|
||||
import type { BrowserContext, BrowserContextOptions } from 'playwright-core';
|
||||
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') {
|
||||
const harPath = testInfo.outputPath(outputPath);
|
||||
|
|
@ -48,7 +48,7 @@ it('should have version and creator', async ({ contextFactory, server }, testInf
|
|||
const log = await getLog();
|
||||
expect(log.version).toBe('1.2');
|
||||
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) => {
|
||||
|
|
@ -500,8 +500,8 @@ it('should contain http2 for http2 requests', async ({ contextFactory, browserNa
|
|||
it.fixme(browserName === 'webkit' && platform === 'win32');
|
||||
|
||||
const server = http2.createSecureServer({
|
||||
key: await fs.promises.readFile(path.join(__dirname, '..', 'utils', 'testserver', 'key.pem')),
|
||||
cert: await fs.promises.readFile(path.join(__dirname, '..', 'utils', 'testserver', 'cert.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')),
|
||||
});
|
||||
server.on('stream', stream => {
|
||||
stream.respond({
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
import pixelmatch from 'pixelmatch';
|
||||
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 }) => {
|
||||
const browserContext = await browserType.launchPersistentContext(await createUserDataDir(), { headless: false });
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 e;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
let error = null;
|
||||
|
|
@ -18,7 +18,7 @@ import path from 'path';
|
|||
import fs from 'fs';
|
||||
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) => {
|
||||
return channel ? `Headless = false,\n Channel = "${channel}",` : `Headless = false,`;
|
||||
};
|
||||
|
|
@ -18,7 +18,7 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
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) => {
|
||||
return channel ? `.setHeadless(false)\n .setChannel("${channel}")` : '.setHeadless(false)';
|
||||
};
|
||||
|
|
@ -18,7 +18,7 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
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) => {
|
||||
return channel ? `headless: false,\n channel: '${channel}'` : 'headless: false';
|
||||
|
|
@ -18,7 +18,7 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
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) => {
|
||||
return channel ? `headless=False, channel="${channel}"` : 'headless=False';
|
||||
};
|
||||
|
|
@ -18,7 +18,7 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
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) => {
|
||||
return channel ? `headless=False, channel="${channel}"` : 'headless=False';
|
||||
};
|
||||
|
|
@ -18,7 +18,7 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
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 }) => {
|
||||
const cli = runCLI([emptyHTML]);
|
||||
|
|
@ -14,11 +14,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest } from '../config/browserTest';
|
||||
import { contextTest } from '../../config/browserTest';
|
||||
import type { Page } from 'playwright-core';
|
||||
import * as path from 'path';
|
||||
import type { Source } from '../../packages/playwright-core/src/server/supplements/recorder/recorderTypes';
|
||||
import { CommonFixtures, TestChildProcess } from '../config/commonFixtures';
|
||||
import type { Source } from '../../../packages/playwright-core/src/server/supplements/recorder/recorderTypes';
|
||||
import { CommonFixtures, TestChildProcess } from '../../config/commonFixtures';
|
||||
export { expect } from '@playwright/test';
|
||||
|
||||
type CLITestArgs = {
|
||||
|
|
@ -28,7 +28,7 @@ type CLITestArgs = {
|
|||
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>({
|
||||
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) {
|
||||
const nodeArgs = [
|
||||
'node',
|
||||
path.join(__dirname, '..', '..', 'packages', 'playwright-core', 'lib', 'cli', 'cli.js'),
|
||||
path.join(__dirname, '..', '..', '..', 'packages', 'playwright-core', 'lib', 'cli', 'cli.js'),
|
||||
'codegen',
|
||||
...args,
|
||||
`--browser=${browserName}`,
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
expect(String(playwright.errors.TimeoutError)).toContain('TimeoutError');
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 }) => {
|
||||
const log = [];
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
import fs from 'fs';
|
||||
|
||||
async function checkFeatures(name: string, context: any, server: any) {
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browserTest as it, expect } from './config/browserTest';
|
||||
import { browserTest as it, expect } from '../config/browserTest';
|
||||
import fs from 'fs';
|
||||
|
||||
it('should be able to save file', async ({ contextFactory, headless, browserName }, testInfo) => {
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest as it, expect } from './config/browserTest';
|
||||
import { contextTest as it, expect } from '../config/browserTest';
|
||||
|
||||
function getPermission(page, name) {
|
||||
return page.evaluate(name => navigator.permissions.query({ name }).then(result => result.state), name);
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 }) {
|
||||
const context = await browser.newContext({
|
||||
|
|
@ -19,7 +19,7 @@ import http from 'http';
|
|||
import path from 'path';
|
||||
import net from 'net';
|
||||
|
||||
import { contextTest, expect } from './config/browserTest';
|
||||
import { contextTest, expect } from '../config/browserTest';
|
||||
import type { Page, Browser } from 'playwright-core';
|
||||
|
||||
class OutOfProcessPlaywrightServer {
|
||||
|
|
@ -27,7 +27,7 @@ class OutOfProcessPlaywrightServer {
|
|||
private _receivedPortPromise: Promise<string>;
|
||||
|
||||
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',
|
||||
detached: true,
|
||||
env: {
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* 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 net from 'net';
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* 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 }) => {
|
||||
const context = await contextFactory();
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { contextTest as test, expect } from './config/browserTest';
|
||||
import { contextTest as test, expect } from '../config/browserTest';
|
||||
import fs from 'fs';
|
||||
|
||||
test('wpt accname', async ({ page, asset, server, browserName }) => {
|
||||
|
|
@ -15,9 +15,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { expect, browserTest } from './config/browserTest';
|
||||
import { expect, browserTest } from '../config/browserTest';
|
||||
import { PNG } from 'pngjs';
|
||||
import { verifyViewport } from './config/utils';
|
||||
import { verifyViewport } from '../config/utils';
|
||||
|
||||
browserTest.describe('page screenshot', () => {
|
||||
browserTest.skip(({ browserName, headless }) => browserName === 'firefox' && !headless, 'Firefox headed produces a different image.');
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 475 B |
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 333 B |
|
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |