diff --git a/behat.yml.dist b/behat.yml.dist index 34be5d5..0ad047e 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -3,8 +3,15 @@ imports: - tests/Behat/Resources/suites.yml default: + formatters: + pretty: + verbose: true + paths: false + snippets: false + extensions: DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~ + Robertfausk\Behat\PantherExtension: ~ FriendsOfBehat\MinkDebugExtension: directory: etc/build @@ -15,32 +22,30 @@ default: files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/" base_url: "https://127.0.0.1:8080/" default_session: symfony - javascript_session: chrome_headless + javascript_session: chromedriver sessions: symfony: symfony: ~ - chrome_headless: + chromedriver: chrome: api_url: http://127.0.0.1:9222 validate_certificate: false - chrome: - selenium2: - browser: chrome - capabilities: - browserName: chrome - browser: chrome - version: "" - marionette: null # https://github.com/Behat/MinkExtension/pull/311 - chrome: - switches: - - "start-fullscreen" - - "start-maximized" - - "no-sandbox" - extra_capabilities: + chrome_headless_second_session: + chrome: + api_url: http://127.0.0.1:9222 + validate_certificate: false + panther: + panther: + manager_options: + connection_timeout_in_ms: 5000 + request_timeout_in_ms: 120000 + chromedriver_arguments: + - --log-path=etc/build/chromedriver.log + - --verbose + capabilities: + acceptSslCerts: true + acceptInsecureCerts: true unexpectedAlertBehaviour: accept - firefox: - selenium2: - browser: firefox show_auto: false FriendsOfBehat\SymfonyExtension: @@ -53,3 +58,5 @@ default: FriendsOfBehat\SuiteSettingsExtension: paths: - "features" + + SyliusLabs\SuiteTagsExtension: ~ diff --git a/composer.json b/composer.json index 9a4e7c5..86affa4 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ "require": { "php": "^8.2", "sylius/sylius": "^1.12", - "sylius/mailer-bundle": "^2.0", "symfony/webpack-encore-bundle": "^1.17" }, "require-dev": { "behat/behat": "^3.14", - "behat/mink-selenium2-driver": "1.6", + "behat/mink-selenium2-driver": "^1.6", + "dbrekelmans/bdi": "^1.1", "dmore/behat-chrome-extension": "^1.4", "dmore/chrome-mink-driver": "^2.9", "friends-of-behat/mink": "^1.10", @@ -30,19 +30,21 @@ "phpspec/phpspec": "^7.5", "phpstan/extension-installer": "^1.3", "phpstan/phpstan": "^1.10", - "phpstan/phpstan-doctrine": "^1.3", + "phpstan/phpstan-doctrine": "1.3.69", "phpstan/phpstan-strict-rules": "^1.5", "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^10.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", + "robertfausk/behat-panther-extension": "^1.1", "sylius-labs/coding-standard": "^4.3", + "sylius-labs/suite-tags-extension": "^0.2", "symfony/browser-kit": "^6.4", "symfony/debug-bundle": "^6.4", "symfony/dotenv": "^6.4", "symfony/flex": "^2.4", "symfony/intl": "^6.4", "symfony/web-profiler-bundle": "^6.4", - "vimeo/psalm": "^5.25" + "vimeo/psalm": "^5.9" }, "config": { "sort-packages": true, diff --git a/public/poll_payment.js b/public/poll_payment.js index f6dba75..26e8252 100644 --- a/public/poll_payment.js +++ b/public/poll_payment.js @@ -1,20 +1,19 @@ (function () { async function checkForCapturedPayment() { try { - const response = await fetch(window.paymentStatusUrl); - const data = await response.json(); + const response = await fetch(window.paymentStatusUrl) + const data = await response.json() if (data.captured) { - window.location.replace(window.afterUrl); + window.location.replace(window.afterUrl) return; } } catch (e) { - console.log(e); + console.log(e) } - setTimeout(checkForCapturedPayment, 5000); + setTimeout(checkForCapturedPayment, 5000) } - checkForCapturedPayment(); + checkForCapturedPayment() })(); - diff --git a/templates/Process/index.html.twig b/templates/Process/index.html.twig index 707fb1f..a9505bd 100644 --- a/templates/Process/index.html.twig +++ b/templates/Process/index.html.twig @@ -8,7 +8,9 @@ {% if redirectUrl %} -
{{ 'webgriffe_sylius_klarna.ui.return_to_klarna_checkout'|trans({'{redirectUrl}': redirectUrl})|raw }}
+ + {{ 'webgriffe_sylius_klarna.ui.return_to_klarna_checkout'|trans }} + {% endif %} {% endblock %} diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index f0131a8..3e200fb 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -1,6 +1,6 @@ ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], @@ -44,7 +44,7 @@ Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true], Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true], Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true], - Webgriffe\SyliusKlarnaPlugin\WebgriffeSyliusKlarnaPlugin::class => ['all' => true], + Webgriffe\SyliusPagolightPlugin\WebgriffeSyliusPagolightPlugin::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true], @@ -59,3 +59,8 @@ Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], ]; +if (class_exists(Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class)) { + $bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true]; +} + +return $bundles;