From d0b74277e1643843a56777548ce9ddb5f1c97897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 3 Feb 2021 17:07:09 +0100 Subject: [PATCH 1/4] panther: enable the screenshot on failure feature --- symfony/panther/1.0/error-screenshots/.gitignore | 0 symfony/panther/1.0/manifest.json | 6 ++++++ symfony/phpunit-bridge/4.1/.env.test | 1 + 3 files changed, 7 insertions(+) create mode 100644 symfony/panther/1.0/error-screenshots/.gitignore diff --git a/symfony/panther/1.0/error-screenshots/.gitignore b/symfony/panther/1.0/error-screenshots/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/symfony/panther/1.0/manifest.json b/symfony/panther/1.0/manifest.json index a815d1d0..dae9e985 100644 --- a/symfony/panther/1.0/manifest.json +++ b/symfony/panther/1.0/manifest.json @@ -1,4 +1,10 @@ { + "copy-from-recipe": { + "error-screenshots/": "tests/error-screenshots/" + }, + "gitignore": [ + "/tests/error-screenshots/*.png" + ], "dockerfile": [ "# Chromium and ChromeDriver", "ENV PANTHER_NO_SANDBOX 1", diff --git a/symfony/phpunit-bridge/4.1/.env.test b/symfony/phpunit-bridge/4.1/.env.test index d0486867..7bbe2897 100644 --- a/symfony/phpunit-bridge/4.1/.env.test +++ b/symfony/phpunit-bridge/4.1/.env.test @@ -3,3 +3,4 @@ KERNEL_CLASS='App\Kernel' APP_SECRET='$ecretf0rt3st' SYMFONY_DEPRECATIONS_HELPER=999999 PANTHER_APP_ENV=panther +PANTHER_ERROR_SCREENSHOT_DIR=./tests/error-screenshots From 84f51e8d1ee08534dae8c3ff9d74fc49f792086e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 3 Feb 2021 18:14:14 +0100 Subject: [PATCH 2/4] better approach --- symfony/panther/1.0/error-screenshots/.gitignore | 0 symfony/panther/1.0/manifest.json | 6 ------ symfony/phpunit-bridge/3.3/manifest.json | 3 ++- 3 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 symfony/panther/1.0/error-screenshots/.gitignore diff --git a/symfony/panther/1.0/error-screenshots/.gitignore b/symfony/panther/1.0/error-screenshots/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/symfony/panther/1.0/manifest.json b/symfony/panther/1.0/manifest.json index dae9e985..a815d1d0 100644 --- a/symfony/panther/1.0/manifest.json +++ b/symfony/panther/1.0/manifest.json @@ -1,10 +1,4 @@ { - "copy-from-recipe": { - "error-screenshots/": "tests/error-screenshots/" - }, - "gitignore": [ - "/tests/error-screenshots/*.png" - ], "dockerfile": [ "# Chromium and ChromeDriver", "ENV PANTHER_NO_SANDBOX 1", diff --git a/symfony/phpunit-bridge/3.3/manifest.json b/symfony/phpunit-bridge/3.3/manifest.json index a2ed0cb4..bfb865df 100644 --- a/symfony/phpunit-bridge/3.3/manifest.json +++ b/symfony/phpunit-bridge/3.3/manifest.json @@ -8,7 +8,8 @@ "gitignore": [ ".phpunit", ".phpunit.result.cache", - "/phpunit.xml" + "/phpunit.xml", + "error-screenshots/" ], "aliases": ["simple-phpunit"] } From 0883b5786ccedaf26dee7fedfafe63911073382d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 3 Feb 2021 19:53:44 +0100 Subject: [PATCH 3/4] Finish the recipe --- symfony/panther/1.0/manifest.json | 2 +- symfony/panther/1.0/post-install.txt | 16 ++++++++++++++++ symfony/phpunit-bridge/5.1/phpunit.xml.dist | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 symfony/panther/1.0/post-install.txt diff --git a/symfony/panther/1.0/manifest.json b/symfony/panther/1.0/manifest.json index a815d1d0..ce11be6c 100644 --- a/symfony/panther/1.0/manifest.json +++ b/symfony/panther/1.0/manifest.json @@ -6,7 +6,7 @@ "ENV PANTHER_CHROME_ARGUMENTS='--disable-dev-shm-usage'", "RUN apk add --no-cache chromium chromium-chromedriver", "", - "# Firefox and GeckoDriver", + "# Firefox and geckodriver", "#ARG GECKODRIVER_VERSION=0.29.0", "#RUN apk add --no-cache firefox", "#RUN wget -q https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz; \\", diff --git a/symfony/panther/1.0/post-install.txt b/symfony/panther/1.0/post-install.txt new file mode 100644 index 00000000..1f93b829 --- /dev/null +++ b/symfony/panther/1.0/post-install.txt @@ -0,0 +1,16 @@ + + Finish Panther Installation + + + * Install ChromeDriver or geckodriver with + the package manager of your Operating System. + + Alternatively, use Browser Driver Installer: + + composer require --dev dbrekelmans/bdi + vendor/bin/bdi detect drivers + + This step is not necessary when using Docker. + + * To use Panther with PHPUnit, + uncomment the snippet registering the Panther extension in phpunit.xml.dist diff --git a/symfony/phpunit-bridge/5.1/phpunit.xml.dist b/symfony/phpunit-bridge/5.1/phpunit.xml.dist index 0c1b1d9d..0bd20c85 100644 --- a/symfony/phpunit-bridge/5.1/phpunit.xml.dist +++ b/symfony/phpunit-bridge/5.1/phpunit.xml.dist @@ -30,4 +30,11 @@ + + + From 4f36ae41f08e3aebcde96cfc1167a38c9a3b8c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 3 Feb 2021 21:51:39 +0100 Subject: [PATCH 4/4] update screenshot dir --- symfony/phpunit-bridge/3.3/manifest.json | 3 +-- symfony/phpunit-bridge/4.1/.env.test | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/symfony/phpunit-bridge/3.3/manifest.json b/symfony/phpunit-bridge/3.3/manifest.json index bfb865df..a2ed0cb4 100644 --- a/symfony/phpunit-bridge/3.3/manifest.json +++ b/symfony/phpunit-bridge/3.3/manifest.json @@ -8,8 +8,7 @@ "gitignore": [ ".phpunit", ".phpunit.result.cache", - "/phpunit.xml", - "error-screenshots/" + "/phpunit.xml" ], "aliases": ["simple-phpunit"] } diff --git a/symfony/phpunit-bridge/4.1/.env.test b/symfony/phpunit-bridge/4.1/.env.test index 7bbe2897..9e7162f0 100644 --- a/symfony/phpunit-bridge/4.1/.env.test +++ b/symfony/phpunit-bridge/4.1/.env.test @@ -3,4 +3,4 @@ KERNEL_CLASS='App\Kernel' APP_SECRET='$ecretf0rt3st' SYMFONY_DEPRECATIONS_HELPER=999999 PANTHER_APP_ENV=panther -PANTHER_ERROR_SCREENSHOT_DIR=./tests/error-screenshots +PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots