Merge pull request #16078 from MaximKhlobystov/clipping-images-whiteboard-tests

test: clip the reference images in the whiteboard drawing tests
This commit is contained in:
Anton Georgiev 2022-12-05 13:21:20 -05:00 committed by GitHub
commit fc32f5b2e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 60 additions and 13 deletions

View File

@ -21,10 +21,22 @@ class DrawEllipse extends MultiUsers {
await this.modPage.page.mouse.move(wbBox.x + 0.7 * wbBox.width, wbBox.y + 0.7 * wbBox.height);
await this.modPage.page.mouse.up();
await expect(this.modPage.page).toHaveScreenshot('moderator1-ellipse.png', { maxDiffPixels: 2000 });
const clipObj = {
x: wbBox.x,
y: wbBox.y,
width: wbBox.width,
height: wbBox.height,
};
await this.modPage2.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await expect(this.modPage2.page).toHaveScreenshot('moderator2-ellipse.png', { maxDiffPixels: 2000 });
await expect(this.modPage.page).toHaveScreenshot('moderator1-ellipse.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
await expect(this.modPage2.page).toHaveScreenshot('moderator2-ellipse.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
}
}

View File

@ -21,10 +21,22 @@ class DrawLine extends MultiUsers {
await this.modPage.page.mouse.move(wbBox.x + 0.7 * wbBox.width, wbBox.y + 0.7 * wbBox.height);
await this.modPage.page.mouse.up();
await expect(this.modPage.page).toHaveScreenshot('moderator1-line.png', { maxDiffPixels: 2000 });
const clipObj = {
x: wbBox.x,
y: wbBox.y,
width: wbBox.width,
height: wbBox.height,
};
await this.modPage2.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await expect(this.modPage2.page).toHaveScreenshot('moderator2-line.png', { maxDiffPixels: 2000 });
await expect(this.modPage.page).toHaveScreenshot('moderator1-line.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
await expect(this.modPage2.page).toHaveScreenshot('moderator2-line.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
}
}

View File

@ -21,11 +21,22 @@ class DrawRectangle extends MultiUsers {
await this.modPage.page.mouse.move(wbBox.x + 0.7 * wbBox.width, wbBox.y + 0.7 * wbBox.height);
await this.modPage.page.mouse.up();
await this.modPage.waitForSelector(e.wbDrawnRectangle);
await expect(this.modPage.page).toHaveScreenshot('moderator1-rectangle.png', { maxDiffPixels: 2000 });
const clipObj = {
x: wbBox.x,
y: wbBox.y,
width: wbBox.width,
height: wbBox.height,
};
await this.modPage2.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await expect(this.modPage2.page).toHaveScreenshot('moderator2-rectangle.png', { maxDiffPixels: 2000 });
await expect(this.modPage.page).toHaveScreenshot('moderator1-rectangle.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
await expect(this.modPage2.page).toHaveScreenshot('moderator2-rectangle.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
}
}

View File

@ -21,10 +21,22 @@ class DrawTriangle extends MultiUsers {
await this.modPage.page.mouse.move(wbBox.x + 0.7 * wbBox.width, wbBox.y + 0.7 * wbBox.height);
await this.modPage.page.mouse.up();
await expect(this.modPage.page).toHaveScreenshot('moderator1-triangle.png', { maxDiffPixels: 2000 });
const clipObj = {
x: wbBox.x,
y: wbBox.y,
width: wbBox.width,
height: wbBox.height,
};
await this.modPage2.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await expect(this.modPage2.page).toHaveScreenshot('moderator2-triangle.png', { maxDiffPixels: 2000 });
await expect(this.modPage.page).toHaveScreenshot('moderator1-triangle.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
await expect(this.modPage2.page).toHaveScreenshot('moderator2-triangle.png', {
maxDiffPixels: 1000,
clip: clipObj,
});
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 49 KiB