From 41efc97b5f7c341ef83f71b1427cca6225b9b044 Mon Sep 17 00:00:00 2001 From: Francis Hilaire Date: Thu, 26 Sep 2024 18:24:56 +0200 Subject: [PATCH] Handle Panther driver for Sylius 1.12 --- .../managing_payment_method.feature | 7 ++--- .../stripe_js/managing_payment_method.feature | 7 ++--- tests/Behat/Bug/PantherCookieSetter.php | 31 +++++++++++++++++++ tests/Behat/Resources/services.xml | 1 + tests/Behat/Resources/services/bug.xml | 10 ++++++ 5 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 tests/Behat/Bug/PantherCookieSetter.php create mode 100644 tests/Behat/Resources/services/bug.xml diff --git a/features/admin/stripe_checkout_session/managing_payment_method.feature b/features/admin/stripe_checkout_session/managing_payment_method.feature index ff5cfc4..d1552b8 100644 --- a/features/admin/stripe_checkout_session/managing_payment_method.feature +++ b/features/admin/stripe_checkout_session/managing_payment_method.feature @@ -6,11 +6,11 @@ Feature: Adding a new Stripe Checkout Session payment method Background: Given the store operates on a single channel in "United States" + And I am logged in as an administrator @ui @javascript Scenario: Adding a new stripe payment method using authorize - Given I am logged in as an administrator - And I want to create a new Stripe Checkout Session payment method + Given I want to create a new Stripe Checkout Session payment method When I name it "Stripe Checkout Session" in "English (United States)" And I specify its code as "stripe_sca_test" And I configure it with test stripe gateway data "TEST", "TEST" @@ -23,8 +23,7 @@ Feature: Adding a new Stripe Checkout Session payment method @ui @javascript Scenario: Adding a new stripe payment method not using authorize - Given I am logged in as an administrator - And I want to create a new Stripe Checkout Session payment method + Given I want to create a new Stripe Checkout Session payment method When I name it "Stripe Checkout Session" in "English (United States)" And I specify its code as "stripe_sca_test" And I configure it with test stripe gateway data "TEST", "TEST" diff --git a/features/admin/stripe_js/managing_payment_method.feature b/features/admin/stripe_js/managing_payment_method.feature index b20d79a..7ae29d8 100644 --- a/features/admin/stripe_js/managing_payment_method.feature +++ b/features/admin/stripe_js/managing_payment_method.feature @@ -6,11 +6,11 @@ Feature: Adding a new Stripe JS payment method Background: Given the store operates on a single channel in "United States" + And I am logged in as an administrator @ui @javascript Scenario: Adding a new stripe payment method using authorize - Given I am logged in as an administrator - And I want to create a new Stripe JS payment method + Given I want to create a new Stripe JS payment method When I name it "Stripe JS" in "English (United States)" And I specify its code as "stripe_sca_test" And I configure it with test stripe gateway data "TEST", "TEST" @@ -23,8 +23,7 @@ Feature: Adding a new Stripe JS payment method @ui @javascript Scenario: Adding a new stripe payment method not using authorize - Given I am logged in as an administrator - And I want to create a new Stripe JS payment method + Given I want to create a new Stripe JS payment method When I name it "Stripe JS" in "English (United States)" And I specify its code as "stripe_sca_test" And I configure it with test stripe gateway data "TEST", "TEST" diff --git a/tests/Behat/Bug/PantherCookieSetter.php b/tests/Behat/Bug/PantherCookieSetter.php new file mode 100644 index 0000000..0cf3c7f --- /dev/null +++ b/tests/Behat/Bug/PantherCookieSetter.php @@ -0,0 +1,31 @@ +minkSession->getDriver(); + + if ($driver instanceof PantherDriver) { + if (!$driver->isStarted()) { + $driver->start(); + } + } + + $this->decoratedCookieSetter->setCookie($name, $value); + } +} diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml index 27485e3..1b2a5c7 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -2,6 +2,7 @@ + diff --git a/tests/Behat/Resources/services/bug.xml b/tests/Behat/Resources/services/bug.xml new file mode 100644 index 0000000..5539df3 --- /dev/null +++ b/tests/Behat/Resources/services/bug.xml @@ -0,0 +1,10 @@ + + + + + + + + + +