Skip to content

Commit

Permalink
Update puppeteer (#2507)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Aug 15, 2024
1 parent a732f51 commit 74ee5f0
Show file tree
Hide file tree
Showing 5 changed files with 1,314 additions and 4,071 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
grpcweb-server:
build:
Expand Down
1 change: 0 additions & 1 deletion examples/Container/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
container-frontend:
build:
Expand Down
13 changes: 11 additions & 2 deletions testassets/InteropTestsGrpcWebWebsite/Tests/custom-environment.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
const JestPuppeteerEnvironment = require("jest-environment-puppeteer").TestEnvironment;

// expect-puppeteer requires jest's expect to be on the global object.
// If the global object isn't populated then there is a null reference error in expect-puppeteer.
global.expect = require('expect').expect;
const expect = require('expect-puppeteer').expect;

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

// Workaround puppeteer bug: https://github.com/argos-ci/jest-puppeteer/issues/586
if (this.global.context.isIncognito === undefined) {
this.global.context.isIncognito = () => false;
}

console.log('Calling gRPC-Web client app');

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

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

// Get test names
// Get test names.
this.global.__GRPC_WEB_TEST_NAMES__ = await page.evaluate(() => getTestNames('GrpcWeb'));
this.global.__GRPC_WEB_TEXT_TEST_NAMES__ = await page.evaluate(() => getTestNames('GrpcWebText'));
}
Expand Down
Loading

0 comments on commit 74ee5f0

Please sign in to comment.