Skip to content

Commit 81a6068

Browse files
committed
Fix tests
1 parent 93c23ad commit 81a6068

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,15 @@ jobs:
204204
-
205205
name: Run Behat
206206
run: |
207+
echo "➡️ Running PDF-specific scenarios"
207208
if [ "${{ matrix.wkhtmltopdf }}" != "false" ]; then
208-
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_disabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun;
209+
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags='@pdf_enabled' || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags='@pdf_enabled' --rerun
209210
else
210-
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun;
211+
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags='@pdf_disabled' || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags='@pdf_disabled' --rerun
211212
fi
213+
214+
echo "➡️ Running all remaining scenarios (excluding PDF-specific)"
215+
vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags='~@pdf_enabled&&~@pdf_disabled' || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags='~@pdf_enabled&&~@pdf_disabled' --rerun
212216
213217
-
214218
name: Upload Behat logs

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ramsey/uuid": "^4.7",
1111
"sylius/grid-bundle": "^1.13",
1212
"sylius/resource-bundle": "^1.12",
13-
"sylius/sylius": "~2.0.0",
13+
"sylius/sylius": "2.0.5",
1414
"symfony/clock": "^6.4 || ^7.1",
1515
"symfony/config": "^6.4 || ^7.1",
1616
"symfony/console": "^6.4 || ^7.1",

features/managing_invoices/sending_invoice_when_order_is_paid.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Feature: Sending invoice when order is paid
2121
And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States"
2222
And I chose "Free" shipping method with "Cash on Delivery" payment
2323

24-
@ui
24+
@ui @pdf_enabled
2525
Scenario: Receiving an email containing invoice when the order is paid
2626
When the order "#00000666" has just been paid
2727
Then an email containing invoice generated for order "#00000666" should be sent to "sylius@example.com"
2828

29-
@ui
29+
@ui @pdf_enabled
3030
Scenario: Not receiving an email containing invoice when the order is not paid
3131
When the order "#00000667" was cancelled
3232
Then an email containing invoice generated for order "#00000667" should not be sent to "sylius@example.com"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="table-responsive">
2-
<table class="table">
2+
<table class="table" {{ sylius_test_html_attribute('invoice-items') }}>
33
{% hook 'table' %}
44
</table>
55
</div>

tests/Application/.env.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN=sync://
1414
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN=sync://
1515
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=sync://
1616
###< symfony/messenger ###
17+
18+
###> lexik/jwt-authentication-bundle ###
19+
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem
20+
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem
21+
###< lexik/jwt-authentication-bundle ###

tests/Behat/Page/Admin/Invoice/ShowPage.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getChannel(): string
145145

146146
public function download(): void
147147
{
148-
$this->getDocument()->clickLink('Download');
148+
$this->getElement('download_button')->click();
149149
}
150150

151151
public function resend(): void
@@ -165,7 +165,7 @@ public function isPaid(): bool
165165

166166
public function hasDownloadButton(): bool
167167
{
168-
return $this->getDocument()->hasLink('Download');
168+
return $this->hasElement('download_button');
169169
}
170170

171171
protected function getDefinedElements(): array
@@ -183,7 +183,8 @@ protected function getDefinedElements(): array
183183
'issued_at' => '[data-test-issued-at]',
184184
'paid' => '[data-test-invoice-is-paid]',
185185
'shop_billing_data' => '[data-test-shop-billing-data]',
186-
'table' => '.table',
186+
'table' => '[data-test-invoice-items]',
187+
'download_button' => '[data-test-download-button]',
187188
]);
188189
}
189190

0 commit comments

Comments
 (0)