Skip to content

Commit 168aa5e

Browse files
Merge pull request #13988 from calixteman/issue13987
Avoid an error in integration test because of a locale different of en-US
2 parents d95f680 + 2b938c4 commit 168aa5e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/integration/test_utils.js

+16
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ exports.loadAndWait = (filename, selector) =>
1717
Promise.all(
1818
global.integrationSessions.map(async session => {
1919
const page = await session.browser.newPage();
20+
21+
// In order to avoid errors because of checks which depend on
22+
// a locale.
23+
await page.evaluateOnNewDocument(() => {
24+
Object.defineProperty(navigator, "language", {
25+
get() {
26+
return "en-US";
27+
},
28+
});
29+
Object.defineProperty(navigator, "languages", {
30+
get() {
31+
return ["en-US", "en"];
32+
},
33+
});
34+
});
35+
2036
await page.goto(
2137
`${global.integrationBaseUrl}?file=/test/pdfs/${filename}`
2238
);

0 commit comments

Comments
 (0)