Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
test: update screencast test to actually require red color (#4745)
Dmitry Gozman9bbabaaa749b
diff --git a/test/screencast.spec.ts b/test/screencast.spec.tsindex 19ee716f25..4e9ee89571 100644--- a/test/screencast.spec.ts+++ b/test/screencast.spec.ts@@ -90,25 +90,26 @@ export class VideoPlayer {}function almostRed(r, g, b, alpha) {- expect(g).toBeLessThan(50);- expect(b).toBeLessThan(50);+ expect(r).toBeGreaterThan(185);+ expect(g).toBeLessThan(70);+ expect(b).toBeLessThan(70);expect(alpha).toBe(255);}function almostBlack(r, g, b, alpha) {- expect(r).toBeLessThan(30);- expect(g).toBeLessThan(30);- expect(b).toBeLessThan(30);+ expect(r).toBeLessThan(70);+ expect(g).toBeLessThan(70);+ expect(b).toBeLessThan(70);expect(alpha).toBe(255);}-function almostGrey(r, g, b, alpha) {+function almostGray(r, g, b, alpha) {expect(r).toBeGreaterThan(70);expect(g).toBeGreaterThan(70);expect(b).toBeGreaterThan(70);- expect(r).toBeLessThan(130);- expect(g).toBeLessThan(130);- expect(b).toBeLessThan(130);+ expect(r).toBeLessThan(185);+ expect(g).toBeLessThan(185);+ expect(b).toBeLessThan(185);expect(alpha).toBe(255);}@@ -286,12 +287,13 @@ describe('screencast', suite => {{const pixels = videoPlayer.seekLastFrame().data;- expectAll(pixels, almostGrey);+ expectAll(pixels, almostGray);}});- it('should capture css transformation', (test, { headful }) => {+ it('should capture css transformation', (test, { headful, browserName, platform }) => {test.fixme(headful, 'Fails on headful');+ test.fixme(browserName === 'webkit' && platform === 'win32', 'Fails on headful');}, async ({browser, server, testInfo}) => {const size = { width: 320, height: 240 };// Set viewport equal to screencast frame size to avoid scaling.@@ -385,11 +387,11 @@ describe('screencast', suite => {}{const pixels = videoPlayer.seekLastFrame({x: 300, y: 0}).data;- expectAll(pixels, almostGrey);+ expectAll(pixels, almostGray);}{const pixels = videoPlayer.seekLastFrame({x: 0, y: 200}).data;- expectAll(pixels, almostGrey);+ expectAll(pixels, almostGray);}{const pixels = videoPlayer.seekLastFrame({x: 300, y: 200}).data;