From b738d832a89c3cb8a3b7af21a5fd79735d97153d Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Thu, 14 May 2020 20:00:44 +0200 Subject: [PATCH 1/4] (#145) Reduced matching confidence for drag & drop result --- index.e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.e2e.spec.ts b/index.e2e.spec.ts index c346ce8f..5c1b994f 100644 --- a/index.e2e.spec.ts +++ b/index.e2e.spec.ts @@ -78,7 +78,7 @@ describe("E2E drag & drop demo", () => { await mouse.drag(down(500)); await mouse.move(right(100)); await mouse.leftClick(); - const dest = await screen.find("moved_trash.png"); + const dest = await screen.find("moved_trash.png", {confidence: 0.95}); expect(Math.abs(dest.left - expected.left)).toBeLessThanOrEqual(maxDiff); expect(Math.abs(dest.top - expected.top)).toBeLessThanOrEqual(maxDiff); expect(Math.abs(dest.width - expected.width)).toBeLessThanOrEqual(maxDiff); From be7f6f375a45da67188f14f018ce6f3eb123e71a Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Thu, 14 May 2020 21:01:51 +0200 Subject: [PATCH 2/4] (#145) Added Jest --runInBand option --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1fd0b9a2..222cdf34 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "scripts": { "clean": "rm -rf dist", "compile": "npm run clean && tsc -p .", - "test": "jest", - "coverage": "jest --coverage", + "test": "jest --runInBand", + "coverage": "jest --coverage --runInBand", "lint": "tslint -p tsconfig.json", "watch": "tsc -w -p .", "publish-next": "npm publish --tag next", From c69a0e1d086211ab2bbbdf7a8775c2124112b079 Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Thu, 14 May 2020 21:31:53 +0200 Subject: [PATCH 3/4] (#145) Reverted reduced confidence value --- index.e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.e2e.spec.ts b/index.e2e.spec.ts index 5c1b994f..c346ce8f 100644 --- a/index.e2e.spec.ts +++ b/index.e2e.spec.ts @@ -78,7 +78,7 @@ describe("E2E drag & drop demo", () => { await mouse.drag(down(500)); await mouse.move(right(100)); await mouse.leftClick(); - const dest = await screen.find("moved_trash.png", {confidence: 0.95}); + const dest = await screen.find("moved_trash.png"); expect(Math.abs(dest.left - expected.left)).toBeLessThanOrEqual(maxDiff); expect(Math.abs(dest.top - expected.top)).toBeLessThanOrEqual(maxDiff); expect(Math.abs(dest.width - expected.width)).toBeLessThanOrEqual(maxDiff); From 83e636dd9810e4a91a2c92efdda07aa0f911c45f Mon Sep 17 00:00:00 2001 From: Simon Hofmann Date: Thu, 14 May 2020 21:40:08 +0200 Subject: [PATCH 4/4] (#145) Use waitFor instead of find --- index.e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.e2e.spec.ts b/index.e2e.spec.ts index c346ce8f..f44b4ac9 100644 --- a/index.e2e.spec.ts +++ b/index.e2e.spec.ts @@ -78,7 +78,7 @@ describe("E2E drag & drop demo", () => { await mouse.drag(down(500)); await mouse.move(right(100)); await mouse.leftClick(); - const dest = await screen.find("moved_trash.png"); + const dest = await screen.waitFor("moved_trash.png"); expect(Math.abs(dest.left - expected.left)).toBeLessThanOrEqual(maxDiff); expect(Math.abs(dest.top - expected.top)).toBeLessThanOrEqual(maxDiff); expect(Math.abs(dest.width - expected.width)).toBeLessThanOrEqual(maxDiff);