Merge pull request #13988 from calixteman/issue13987

Avoid an error in integration test because of a locale different of en-US
This commit is contained in:
Tim van der Meij 2021-09-08 21:50:43 +02:00 committed by GitHub
commit 168aa5efb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}`
);