Skip to content

Commit

Permalink
Merge pull request #13988 from calixteman/issue13987
Browse files Browse the repository at this point in the history
Avoid an error in integration test because of a locale different of en-US
  • Loading branch information
timvandermeij authored Sep 8, 2021
2 parents d95f680 + 2b938c4 commit 168aa5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/integration/test_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ exports.loadAndWait = (filename, selector) =>
Promise.all(
global.integrationSessions.map(async session => {
const page = await session.browser.newPage();

// In order to avoid errors because of checks which depend on
// a locale.
await page.evaluateOnNewDocument(() => {
Object.defineProperty(navigator, "language", {
get() {
return "en-US";
},
});
Object.defineProperty(navigator, "languages", {
get() {
return ["en-US", "en"];
},
});
});

await page.goto(
`${global.integrationBaseUrl}?file=/test/pdfs/${filename}`
);
Expand Down

0 comments on commit 168aa5e

Please sign in to comment.