Skip to content

Commit

Permalink
chore: roll @playwright/test to 0.9.6 (#3977)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman authored Sep 25, 2020
1 parent 49bcf6e commit 970b011
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 140 deletions.
173 changes: 51 additions & 122 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"ws": "^7.3.1"
},
"devDependencies": {
"@playwright/test-runner": "^0.9.1",
"@playwright/test": "^0.9.6",
"@playwright/test-runner": "^0.9.10",
"@types/debug": "^4.1.5",
"@types/extract-zip": "^1.6.2",
"@types/mime": "^2.0.3",
Expand All @@ -72,7 +73,6 @@
"ncp": "^2.0.0",
"node-stream-zip": "^1.11.3",
"pkg": "^4.4.9",
"pwt": "^0.9.1",
"socksv5": "0.0.6",
"ts-loader": "^8.0.3",
"typescript": "^4.0.2",
Expand Down
18 changes: 10 additions & 8 deletions test/playwright.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ import { TestServer } from '../utils/testserver';
import { Connection } from '../lib/client/connection';
import { Transport } from '../lib/protocol/transport';
import { installCoverageHooks } from './coverage';
import { fixtures as baseFixtures } from '@playwright/test-runner';
import { fixtures as baseFixtures, config } from '@playwright/test-runner';
import assert from 'assert';
import { expect } from '@playwright/test';
export { expect } from '@playwright/test';
export { config } from '@playwright/test-runner';

const mkdtempAsync = util.promisify(fs.mkdtemp);
const removeFolderAsync = util.promisify(require('rimraf'));
Expand Down Expand Up @@ -83,7 +86,6 @@ export const beforeEach = fixtures.beforeEach;
export const afterEach = fixtures.afterEach;
export const beforeAll = fixtures.beforeAll;
export const afterAll = fixtures.afterAll;
export const expect = fixtures.expect;

export const options = {
CHROMIUM: (parameters: PlaywrightParameters) => parameters.browserName === 'chromium',
Expand Down Expand Up @@ -127,7 +129,7 @@ const getExecutablePath = browserName => {
return process.env.WKPATH;
};

defineWorkerFixture('defaultBrowserOptions', async ({ browserName, testConfig }, runTest) => {
defineWorkerFixture('defaultBrowserOptions', async ({ browserName }, runTest) => {
const executablePath = getExecutablePath(browserName);
if (executablePath)
console.error(`Using executable at ${executablePath}`);
Expand All @@ -136,7 +138,7 @@ defineWorkerFixture('defaultBrowserOptions', async ({ browserName, testConfig },
slowMo: options.SLOW_MO,
headless: options.HEADLESS,
executablePath,
artifactsPath: testConfig.outputDir,
artifactsPath: config.outputDir,
});
});

Expand Down Expand Up @@ -261,9 +263,9 @@ defineWorkerFixture('expectedSSLError', async ({browserName, platform}, runTest)
});

defineTestFixture('testOutputDir', async ({ testInfo }, runTest) => {
const relativePath = path.relative(testInfo.config.testDir, testInfo.file).replace(/\.spec\.[jt]s/, '');
const relativePath = path.relative(config.testDir, testInfo.file).replace(/\.spec\.[jt]s/, '');
const sanitizedTitle = testInfo.title.replace(/[^\w\d]+/g, '_');
const testOutputDir = path.join(testInfo.config.outputDir, relativePath, sanitizedTitle);
const testOutputDir = path.join(config.outputDir, relativePath, sanitizedTitle);
await fs.promises.mkdir(testOutputDir, { recursive: true });
await runTest(testOutputDir);
const files = await fs.promises.readdir(testOutputDir);
Expand All @@ -274,9 +276,9 @@ defineTestFixture('testOutputDir', async ({ testInfo }, runTest) => {
}
});

defineTestFixture('context', async ({ browser, testOutputDir, testConfig }, runTest) => {
defineTestFixture('context', async ({ browser, testOutputDir }, runTest) => {
const contextOptions: BrowserContextOptions = {
relativeArtifactsPath: path.relative(testConfig.outputDir, testOutputDir),
relativeArtifactsPath: path.relative(config.outputDir, testOutputDir),
recordTrace: !!options.TRACING,
recordVideos: !!options.TRACING,
};
Expand Down
Loading

0 comments on commit 970b011

Please sign in to comment.