Skip to content

Commit

Permalink
Swicth to Panther
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Jun 24, 2024
1 parent 34f9445 commit ef956d0
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 35 deletions.
47 changes: 27 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
symfony: [^5.4, ^6.4]
sylius: [~1.10.0, ~1.11.0, ~1.12.0]
node: [18.x]
mysql: [5.7]
php: ["7.4", "8.0", "8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4"]
sylius: ["~1.10.0", "~1.11.0", "~1.12.0", "~1.13.0"]
node: ["20.x"]
mysql: ["8.0"]

exclude:
-
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:

-
name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node }}"

Expand All @@ -180,29 +180,20 @@ jobs:
name: Run webserver
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)

-
name: Run Chrome Headless
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-features=Translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 https://127.0.0.1 > /dev/null 2>&1 &

-
name: Get Composer cache directory
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

-
name: Cache Composer
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
-
name: Configure global composer
if: matrix.symfony != ''
run: composer global config --no-plugins allow-plugins.symfony/flex true

-
name: Restrict Sylius version
if: matrix.sylius != ''
Expand All @@ -229,14 +220,18 @@ jobs:
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

-
name: Install Behat driver
run: vendor/bin/bdi browser:google-chrome drivers

-
name: Get Yarn cache directory
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

-
name: Cache Yarn
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
Expand All @@ -257,14 +252,26 @@ jobs:
name: Prepare test application assets
run: |
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && yarn build)
(cd tests/Application && yarn build:prod)
-
name: Prepare test application cache
run: (cd tests/Application && bin/console cache:warmup -vvv)

-
name: Load fixtures in test application
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
-
name: Validate composer.json
run: composer validate --ansi --strict

-
name: Validate database schema
run: (cd tests/Application && bin/console doctrine:schema:validate)

-
name: Run security check
run: symfony security:check

-
name: Run PHPUnit
Expand All @@ -276,7 +283,7 @@ jobs:

-
name: Upload Behat logs
uses: codecov/codecov-action@v3
uses: actions/upload-artifact@v3
if: failure()
with:
name: Behat logs
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/etc/build/*
!/etc/build/.gitignore
drivers

/tests/Application/yarn.lock

Expand Down
35 changes: 33 additions & 2 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ imports:
- tests/Behat/Resources/suites.yaml

default:
formatters:
pretty:
verbose: true
paths: false
snippets: false

extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
Robertfausk\Behat\PantherExtension: ~

FriendsOfBehat\MinkDebugExtension:
directory: etc/build
Expand All @@ -15,14 +22,32 @@ 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: panther
sessions:
symfony:
symfony: ~
chrome_headless:
chromedriver:
chrome:
api_url: http://127.0.0.1:9222
validate_certificate: false
chrome_headless_second_session:
chrome:
api_url: http://127.0.0.1:9222
validate_certificate: false
panther:
panther:
options:
webServerDir: "%paths.base%/tests/Application/public"
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
show_auto: false

FriendsOfBehat\SymfonyExtension:
Expand All @@ -31,3 +56,9 @@ default:
class: Tests\FluxSE\SyliusPayumStripePlugin\Application\Kernel

FriendsOfBehat\VariadicExtension: ~

FriendsOfBehat\SuiteSettingsExtension:
paths:
- "features"

SyliusLabs\SuiteTagsExtension: ~
30 changes: 17 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,34 @@
"require-dev": {
"ext-json": "*",
"behat/behat": "^3.7",
"behat/mink": "^1.9",
"dbrekelmans/bdi": "^1.3",
"dmore/behat-chrome-extension": "^1.4",
"dmore/chrome-mink-driver": "^2.8",
"friends-of-behat/mink": "^1.9",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0",
"friends-of-behat/mink-extension": "^2.4",
"friends-of-behat/mink-extension": "^2.5",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.1",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"phpspec/phpspec": "^7.0",
"phpspec/phpspec": "^7.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^9.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"sylius-labs/coding-standard": "^4.0",
"symfony/browser-kit": "^5.4|^6.0",
"symfony/debug-bundle": "^5.4|^6.0",
"symfony/dotenv": "^5.4|^6.0",
"symfony/http-client": "^5.4|^6.0",
"symfony/intl": "^5.4|^6.0",
"symfony/runtime": "^5.4|^6.0",
"symfony/web-profiler-bundle": "^5.4|^6.0",
"robertfausk/behat-panther-extension": "^1.1",
"sylius-labs/coding-standard": "^4.2",
"sylius-labs/suite-tags-extension": "^0.2.0",
"symfony/browser-kit": "^5.4|^6.4",
"symfony/debug-bundle": "^5.4|^6.4",
"symfony/dotenv": "^5.4|^6.4",
"symfony/http-client": "^5.4|^6.4",
"symfony/intl": "^5.4|^6.4",
"symfony/runtime": "^5.4|^6.4",
"symfony/web-profiler-bundle": "^5.4|^6.4",
"symfony/webpack-encore-bundle": "^1|^2"
},
"autoload": {
Expand All @@ -66,8 +69,9 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": false,
"phpstan/extension-installer": false,
"symfony/flex": false,
"symfony/thanks": true,
"symfony/runtime": true
}
Expand Down

0 comments on commit ef956d0

Please sign in to comment.