Skip to content

Commit dc8ecc5

Browse files
Merge pull request #2822 from dpfaffenbauer/behat-tests
[Behat] fix tests
2 parents 254d063 + d29ec67 commit dc8ecc5

24 files changed

+154
-59
lines changed

.github/workflows/behat_ui.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
PIMCORE_INSTALL_MYSQL_DATABASE: "coreshop_test"
3737
PIMCORE_INSTALL_MYSQL_PORT: "3306"
3838
PANTHER_EXTERNAL_BASE_URI: "http://localhost:9080/index_test.php"
39-
PANTHER_CHROME_ARGUMENTS: "--disable-dev-shm-usage"
39+
PANTHER_CHROME_ARGUMENTS: "--disable-dev-shm-usage --guest"
4040
PANTHER_DEVTOOLS: "0"
4141
PIMCORE_KERNEL_CLASS: 'Kernel'
4242
PIMCORE_WRITE_TARGET_STATICROUTES: 'settings-store'
@@ -127,7 +127,7 @@ jobs:
127127
run: symfony server:start --port=9080 --dir=public --daemon --no-tls
128128

129129
- name: Run Behat
130-
run: vendor/bin/behat --strict --no-interaction -vvv --config behat.yml.dist -p ui
130+
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist -p ui
131131

132132
- name: Upload Logs
133133
uses: actions/upload-artifact@v4

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"phpstan/phpstan-symfony": "^1.3.2",
124124
"phpstan/phpstan-webmozart-assert": "^1.2.4",
125125
"phpunit/phpunit": "^9.5",
126-
"robertfausk/behat-panther-extension": "^1.0",
126+
"robertfausk/behat-panther-extension": "^1.2",
127127
"symfony/panther": "^2.1",
128128
"symplify/easy-coding-standard": "^11.1",
129129
"vimeo/psalm": "^4.10"

etc/_scripts/behat

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

etc/_setup/install

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

etc/suites/application

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

src/CoreShop/Behat/Element/Frontend/Account/RegisterElement.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
namespace CoreShop\Behat\Element\Frontend\Account;
2020

2121
use Behat\Mink\Exception\ElementNotFoundException;
22+
use CoreShop\Behat\Service\DriverHelper;
2223
use FriendsOfBehat\PageObjectExtension\Element\Element;
2324

2425
final class RegisterElement extends Element implements RegisterElementInterface
@@ -44,6 +45,8 @@ public function checkValidationMessageFor(string $element, string $message): boo
4445
public function register(): void
4546
{
4647
$this->getElement('create_account_button')->press();
48+
49+
DriverHelper::waitForPageToLoad($this->getSession());
4750
}
4851

4952
public function getEmail(): string

src/CoreShop/Behat/Page/Frontend/AbstractFrontendPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace CoreShop\Behat\Page\Frontend;
2020

21-
use FriendsOfBehat\PageObjectExtension\Page\SymfonyPage;
21+
use CoreShop\Behat\Page\SymfonyPage;
2222

2323
abstract class AbstractFrontendPage extends SymfonyPage implements FrontendPageInterface
2424
{

src/CoreShop/Behat/Page/Frontend/Account/ChangePasswordPage.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
use Behat\Mink\Exception\ElementNotFoundException;
2222
use CoreShop\Behat\Page\Frontend\AbstractFrontendPage;
23+
use CoreShop\Behat\Service\DriverHelper;
2324

2425
class ChangePasswordPage extends AbstractFrontendPage implements ChangePasswordPageInterface
2526
{
@@ -57,6 +58,8 @@ public function specifyConfirmationPassword(string $password): void
5758
public function save(): void
5859
{
5960
$this->getElement('save_changes')->click();
61+
62+
DriverHelper::waitForPageToLoad($this->getSession());
6063
}
6164

6265
protected function getDefinedElements(): array

src/CoreShop/Behat/Page/Frontend/Account/ChangeProfilePage.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
use Behat\Mink\Exception\ElementNotFoundException;
2222
use CoreShop\Behat\Page\Frontend\AbstractFrontendPage;
23+
use CoreShop\Behat\Service\DriverHelper;
2324

2425
class ChangeProfilePage extends AbstractFrontendPage implements ChangeProfilePageInterface
2526
{
@@ -62,6 +63,8 @@ public function specifyConfirmationEmail(?string $email = null): void
6263
public function save(): void
6364
{
6465
$this->getElement('save_changes')->click();
66+
67+
DriverHelper::waitForPageToLoad($this->getSession());
6568
}
6669

6770
protected function getDefinedElements(): array

src/CoreShop/Behat/Page/Frontend/Account/LoginPage.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
namespace CoreShop\Behat\Page\Frontend\Account;
2020

2121
use CoreShop\Behat\Page\Frontend\AbstractFrontendPage;
22+
use CoreShop\Behat\Service\DriverHelper;
2223

2324
class LoginPage extends AbstractFrontendPage implements LoginPageInterface
2425
{
@@ -35,6 +36,8 @@ public function hasValidationErrorWith(string $message): bool
3536
public function logIn(): void
3637
{
3738
$this->getElement('login_button')->click();
39+
40+
DriverHelper::waitForPageToLoad($this->getSession());
3841
}
3942

4043
public function specifyPassword(string $password): void

0 commit comments

Comments
 (0)