Skip to content

Commit 74ee5f0

Browse files
authored
Update puppeteer (#2507)
1 parent a732f51 commit 74ee5f0

File tree

5 files changed

+1314
-4071
lines changed

5 files changed

+1314
-4071
lines changed

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
grpcweb-server:
43
build:

examples/Container/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
container-frontend:
43
build:

testassets/InteropTestsGrpcWebWebsite/Tests/custom-environment.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
const JestPuppeteerEnvironment = require("jest-environment-puppeteer").TestEnvironment;
2+
3+
// expect-puppeteer requires jest's expect to be on the global object.
4+
// If the global object isn't populated then there is a null reference error in expect-puppeteer.
5+
global.expect = require('expect').expect;
26
const expect = require('expect-puppeteer').expect;
37

48
class CustomEnvironment extends JestPuppeteerEnvironment {
59
// Load page and get test names to run
610
async setup() {
711
await super.setup();
812

13+
// Workaround puppeteer bug: https://github.com/argos-ci/jest-puppeteer/issues/586
14+
if (this.global.context.isIncognito === undefined) {
15+
this.global.context.isIncognito = () => false;
16+
}
17+
918
console.log('Calling gRPC-Web client app');
1019

1120
var page = this.global.page;
1221
await page.goto('http://localhost:8081', { waitUntil: 'networkidle0' });
1322

14-
// Wait for Blazor to finish loading
23+
// Wait for Blazor to finish loading.
1524
await expect(page).toMatchTextContent('gRPC-Web interop tests');
1625

17-
// Get test names
26+
// Get test names.
1827
this.global.__GRPC_WEB_TEST_NAMES__ = await page.evaluate(() => getTestNames('GrpcWeb'));
1928
this.global.__GRPC_WEB_TEXT_TEST_NAMES__ = await page.evaluate(() => getTestNames('GrpcWebText'));
2029
}

0 commit comments

Comments
 (0)