Merge pull request #21275 from timvandermeij/integration-tests-optimize

Optimize runtime and memory usage of the integration tests
This commit is contained in:
Tim van der Meij 2026-05-17 20:41:43 +02:00 committed by GitHub
commit 2fb2bc13e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 7 deletions

View File

@ -268,13 +268,8 @@ function getSelector(id) {
}
async function getRect(page, selector) {
// In Chrome something is wrong when serializing a `DomRect`,
// so we extract the values and return them ourselves.
await page.waitForSelector(selector, { visible: true });
return page.$eval(selector, el => {
const { x, y, width, height } = el.getBoundingClientRect();
return { x, y, width, height };
});
return (await page.$(selector)).boundingBox();
}
function getQuerySelector(id) {

View File

@ -1403,6 +1403,10 @@ describe("PDF viewer", () => {
);
});
afterEach(async () => {
await closePages(pages);
});
it("keeps the content under the pinch centre fixed on the screen", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
@ -1610,6 +1614,10 @@ describe("PDF viewer", () => {
);
});
afterEach(async () => {
await closePages(pages);
});
it("Check that the top right corner of the annotation is centered vertically", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {

View File

@ -992,7 +992,7 @@ async function startBrowser({
// calls can run before events triggered by the previous protocol calls had
// a chance to be processed (essentially causing events to get lost). This
// value gives Chrome a more similar execution speed as Firefox.
options.slowMo = 5;
options.slowMo = 3;
// avoid crash
options.args = ["--no-sandbox", "--disable-setuid-sandbox"];