Skip to content

Commit be7a33d

Browse files
authored
Puppeteer E2E test: Bug fix (#25389)
* Puppeteer: Bug fix * Disable MacOS until a proper solution in #25386
1 parent dd998eb commit be7a33d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
strategy:
5959
fail-fast: false
6060
matrix:
61+
os: [ windows-latest, ubuntu-latest ]
6162
CI: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
62-
os: [ windows-latest, ubuntu-latest, macos-latest ]
6363
env:
6464
CI: ${{ matrix.CI }}
6565
FORCE_COLOR: 1

test/e2e/puppeteer.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,15 @@ async function preparePage( page, injection, build, errorMessages ) {
248248

249249
}
250250

251-
let text = ( await Promise.all( msg.args().map( arg => arg.executionContext().evaluate( arg => arg instanceof Error ? arg.message : arg, arg ) ) ) ).join( ' ' ); // https://github.com/puppeteer/puppeteer/issues/3397#issuecomment-434970058
251+
const args = await Promise.all( msg.args().map( async arg => {
252+
try {
253+
return await arg.executionContext().evaluate( arg => arg instanceof Error ? arg.message : arg, arg );
254+
} catch (e) { // Execution context might have been already destroyed
255+
return arg;
256+
}
257+
} ) );
258+
259+
let text = args.join( ' ' ); // https://github.com/puppeteer/puppeteer/issues/3397#issuecomment-434970058
252260

253261
text = text.trim();
254262
if ( text === '' ) return;

0 commit comments

Comments
 (0)