Skip to content

Commit de1e63d

Browse files
authored
test: roll test runner 0.9.16 (#3998)
1 parent 2631e1a commit de1e63d

File tree

168 files changed

+190
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+190
-260
lines changed

package-lock.json

Lines changed: 19 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"ws": "^7.3.1"
5050
},
5151
"devDependencies": {
52-
"@playwright/test": "^0.9.6",
53-
"@playwright/test-runner": "^0.9.15",
52+
"@playwright/test": "^0.9.7",
53+
"@playwright/test-runner": "^0.9.16",
5454
"@types/debug": "^4.1.5",
5555
"@types/extract-zip": "^1.6.2",
5656
"@types/mime": "^2.0.3",
@@ -76,7 +76,7 @@
7676
"socksv5": "0.0.6",
7777
"ts-loader": "^8.0.3",
7878
"typescript": "^4.0.2",
79-
"webpack": "^4.44.1",
79+
"webpack": "^4.44.2",
8080
"webpack-cli": "^3.3.12",
8181
"yaml": "^1.10.0"
8282
}

src/client/page.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ import { ChromiumCoverage } from './chromiumCoverage';
3838
import { Waiter } from './waiter';
3939

4040
import * as fs from 'fs';
41+
import * as path from 'path';
4142
import * as util from 'util';
4243
import { Size, URLMatch, Headers, LifecycleEvent, WaitForEventOptions, SelectOption, SelectOptionOptions, FilePayload, WaitForFunctionOptions } from './types';
4344
import { evaluationScript, urlMatches } from './clientHelper';
4445
import { isString, isRegExp, isObject, mkdirIfNeeded, headersObjectToArray } from '../utils/utils';
4546

47+
const fsWriteFileAsync = util.promisify(fs.writeFile.bind(fs));
48+
const mkdirAsync = util.promisify(fs.mkdir);
49+
4650
type PDFOptions = Omit<channels.PagePdfParams, 'width' | 'height' | 'margin'> & {
4751
width?: string | number,
4852
height?: string | number,
@@ -56,8 +60,6 @@ type PDFOptions = Omit<channels.PagePdfParams, 'width' | 'height' | 'margin'> &
5660
};
5761
type Listener = (...args: any[]) => void;
5862

59-
const fsWriteFileAsync = util.promisify(fs.writeFile.bind(fs));
60-
6163
export class Page extends ChannelOwner<channels.PageChannel, channels.PageInitializer> {
6264
private _browserContext: BrowserContext;
6365
_ownedContext: BrowserContext | undefined;
@@ -581,8 +583,10 @@ export class Page extends ChannelOwner<channels.PageChannel, channels.PageInitia
581583
}
582584
const result = await this._channel.pdf(transportOptions);
583585
const buffer = Buffer.from(result.pdf, 'base64');
584-
if (options.path)
586+
if (options.path) {
587+
await mkdirAsync(path.dirname(options.path), { recursive: true });
585588
await fsWriteFileAsync(options.path, buffer);
589+
}
586590
return buffer;
587591
}
588592
}

src/trace/tracer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Tracer implements ContextListener {
4242
async onContextCreated(context: BrowserContext): Promise<void> {
4343
if (!context._options.recordTrace)
4444
return;
45-
const traceStorageDir = path.join(context._browser._options.artifactsPath!, '.playwright-shared');
45+
const traceStorageDir = path.join(context._browser._options.artifactsPath!, 'trace-resources');
4646
const traceFile = path.join(context._artifactsPath!, 'playwright.trace');
4747
const contextTracer = new ContextTracer(context, traceStorageDir, traceFile);
4848
this._contextTracers.set(context, contextTracer);
Binary file not shown.

0 commit comments

Comments
 (0)