From 50a91c6b691b0e39ea09593772bd1df75189c5fc Mon Sep 17 00:00:00 2001 From: Markus Stoll Date: Fri, 24 May 2024 16:10:23 +0200 Subject: [PATCH 1/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13a6779c..1ab0270b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@

Documentation • - Playbook • + PlaybookBlogAPI Reference

From 96bec121d9918c085649438bc008a22d257b1583 Mon Sep 17 00:00:00 2001 From: Markus Stoll Date: Wed, 29 May 2024 09:45:50 +0200 Subject: [PATCH 2/4] fix: GUI test: make sure images are in the same color mode --- tests/ui/test_startpage.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ui/test_startpage.py b/tests/ui/test_startpage.py index 4ba5c722..1f2694bc 100644 --- a/tests/ui/test_startpage.py +++ b/tests/ui/test_startpage.py @@ -6,6 +6,7 @@ import pytest from diffimg import diff +from PIL import Image from selenium.webdriver.remote.webdriver import WebDriver from .helpers import ( @@ -33,6 +34,13 @@ def take_and_diff_snapshot( reference_screenshot_path = old_screenshots_folder / f"{name}-{browser_name}.png" if reference_screenshot_path.is_file(): + # make sure both are in the same color mode + im1 = Image.open(str(reference_screenshot_path)) + im2 = Image.open(str(diff_path)) + if im1.mode != im2.mode: + im1 = im1.convert("RGB") + im2 = im2.convert("RGB") + diff_ratio = diff( str(reference_screenshot_path), str(new_screenshot_path), From cc8e0bae4e5967e7a8561c7de4160020f9b3b33f Mon Sep 17 00:00:00 2001 From: Markus Stoll Date: Wed, 29 May 2024 09:47:59 +0200 Subject: [PATCH 3/4] fix: save after conversion --- tests/ui/test_startpage.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ui/test_startpage.py b/tests/ui/test_startpage.py index 1f2694bc..832017e7 100644 --- a/tests/ui/test_startpage.py +++ b/tests/ui/test_startpage.py @@ -40,6 +40,8 @@ def take_and_diff_snapshot( if im1.mode != im2.mode: im1 = im1.convert("RGB") im2 = im2.convert("RGB") + im1.save(str(reference_screenshot_path)) + im2.save(str(diff_path)) diff_ratio = diff( str(reference_screenshot_path), From a5e255afc67b76b7f75191c49ae5948805fcdb20 Mon Sep 17 00:00:00 2001 From: Markus Stoll Date: Wed, 29 May 2024 09:58:49 +0200 Subject: [PATCH 4/4] fix, wrong file converted.. --- tests/ui/test_startpage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ui/test_startpage.py b/tests/ui/test_startpage.py index 832017e7..6f0ba5f0 100644 --- a/tests/ui/test_startpage.py +++ b/tests/ui/test_startpage.py @@ -36,12 +36,12 @@ def take_and_diff_snapshot( if reference_screenshot_path.is_file(): # make sure both are in the same color mode im1 = Image.open(str(reference_screenshot_path)) - im2 = Image.open(str(diff_path)) + im2 = Image.open(str(new_screenshot_path)) if im1.mode != im2.mode: im1 = im1.convert("RGB") im2 = im2.convert("RGB") im1.save(str(reference_screenshot_path)) - im2.save(str(diff_path)) + im2.save(str(new_screenshot_path)) diff_ratio = diff( str(reference_screenshot_path),