Skip to content

Commit 78cfeab

Browse files
committed
Fix wkhtmltopdf behats
1 parent f71fa1c commit 78cfeab

File tree

8 files changed

+30
-178
lines changed

8 files changed

+30
-178
lines changed

.github/workflows/build.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
php: ["8.3"]
31-
symfony: ["^7.1"]
30+
php: ["8.2", "8.3"]
31+
symfony: ["^6.4", "^7.1"]
3232
sylius: ["2.0"]
3333
node: ["20.x"]
3434
mysql: ["8.4"]
35-
postgres: ["15.8"]
36-
# database: [ "mysql", "postgres" ]
37-
database: [ "mysql" ]
35+
database: ["mysql"]
3836
wkhtmltopdf: ["0.12.6-1"]
3937
state_machine_adapter: ["symfony_workflow"]
4038

@@ -48,6 +46,7 @@ jobs:
4846
database: "mysql"
4947
wkhtmltopdf: "0.12.6-1"
5048
state_machine_adapter: "winzou_state_machine"
49+
5150
-
5251
php: "8.3"
5352
symfony: "^7.1"
@@ -58,6 +57,16 @@ jobs:
5857
wkhtmltopdf: false
5958
state_machine_adapter: "symfony_workflow"
6059

60+
-
61+
php: "8.3"
62+
symfony: "^7.1"
63+
sylius: "2.0"
64+
node: "20.x"
65+
database: "postgres"
66+
postgres: "15.8"
67+
wkhtmltopdf: "0.12.6-1"
68+
state_machine_adapter: "symfony_workflow"
69+
6170
env:
6271
APP_ENV: test
6372
DATABASE_URL: ${{ matrix.database == 'mysql' && format('mysql://root:[email protected]/sylius?serverVersion={0}', matrix.mysql) || format('pgsql://postgres:[email protected]/sylius?serverVersion={0}', matrix.postgres) }}
@@ -251,7 +260,12 @@ jobs:
251260

252261
-
253262
name: Run Behat
254-
run: vendor/bin/behat --colors --strict --no-interaction -f progress
263+
run: |
264+
if [ "${{ matrix.wkhtmltopdf }}" != "false" ]; then
265+
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_disabled"
266+
else
267+
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled"
268+
fi
255269
256270
-
257271
name: Upload Behat logs

features/pdf_generation_disabled/being_unable_to_download_credit_memo_as_pdf_file.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ Feature: Being unable to download a credit memo as PDF file
1616
And 1st "Mr. Meeseeks T-Shirt" product from order "#00000022" has already been refunded with "Space money" payment
1717
And I am logged in as an administrator
1818

19-
@ui
19+
@ui @pdf_disabled
2020
Scenario: Being unable to download a credit memo from credit memos index page
2121
When I browse credit memos
2222
Then I should not be able to download the 1st credit memo
2323

24-
@ui
24+
@ui @pdf_disabled
2525
Scenario: Being unable to download a credit memo from credit memo details page
2626
When I browse the details of the only credit memo generated for order "#00000022"
2727
Then I should not be able to download the credit memo
2828

29-
@ui
29+
@ui @pdf_disabled
3030
Scenario: Being unable to download a credit memo from order show page
3131
When I view the summary of the order "#00000022"
3232
Then I should not be able to download the 1st order's credit memo

features/pdf_generation_disabled/being_unable_to_download_credit_memo_on_customer_order_view.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Feature: Being unable to download a credit memo on customer order view
1717
And this order is already paid
1818
And 1st "Angel T-Shirt" product from order "#00000666" has already been refunded with "Cash on Delivery" payment
1919

20-
@ui
20+
@ui @pdf_disabled
2121
Scenario: Being unable to download a credit memo on customer order view
2222
When I view the summary of the order "#00000666"
2323
Then I should not be able to download the first credit memo

features/pdf_generation_enabled/downloading_credit_memo_as_pdf_file.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ Feature: Downloading credit memo as pdf file
1616
And 1st "Mr. Meeseeks T-Shirt" product from order "#00000022" has already been refunded with "Space money" payment
1717
And I am logged in as an administrator
1818

19-
@ui
19+
@ui @pdf_enabled
2020
Scenario: Downloading credit memo from credit memos index page
2121
When I browse credit memos
2222
And I download 1st credit memo
2323
Then a pdf file should be successfully downloaded
2424

25-
@ui
25+
@ui @pdf_enabled
2626
Scenario: Downloading credit memo from credit memo details page
2727
When I browse the details of the only credit memo generated for order "#00000022"
2828
And I download it
2929
Then a pdf file should be successfully downloaded
3030

31-
@ui
31+
@ui @pdf_enabled
3232
Scenario: Downloading credit memo from order show page
3333
When I view the summary of the order "#00000022"
3434
And I download 1st order's credit memo

features/pdf_generation_enabled/downloading_credit_memo_on_customer_order_view.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Feature: Downloading credit memo on customer order view
1717
And this order is already paid
1818
And 1st "Angel T-Shirt" product from order "#00000666" has already been refunded with "Cash on Delivery" payment
1919

20-
@ui
20+
@ui @pdf_enabled
2121
Scenario: Downloading credit memo from customer order view
2222
When I view the summary of the order "#00000666"
2323
And I download the first credit memo

features/pdf_generation_enabled/saving_credit_memos_on_server_during_generation.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Feature: Saving credit memos on server during generation
1515
And the order "#00000022" is already paid
1616
And I am logged in as an administrator
1717

18-
@application
18+
@application @pdf_enabled
1919
Scenario: Having credit memo saved on the server after the refund is made
2020
When I refund all units of "#00000022" order with "Space money" payment method
2121
Then the credit memo for "#00000022" order should be saved on the server

src/Resources/config/app/twig_hooks/admin/credit_memo/show.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ sylius_twig_hooks:
4141
'sylius_refund.admin.credit_memos.content.header.title_block.actions':
4242
download:
4343
template: '@SyliusRefundPlugin/credit_memos/content/header/title_block/actions/download.html.twig'
44+
enabled: '%sylius_refund.pdf_generator.enabled%'
4445
priority: 100
4546

4647
'sylius_refund.admin.credit_memos.content.sections':

src/templates/order/admin/credit_memo/details.html.twig

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)