[Admin][Behat] Adjust scenarios by using JS with back button

This commit is contained in:
Grzegorz Sadowski 2025-05-29 07:54:04 +02:00
parent ae503f8b81
commit b409a7b70c
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
3 changed files with 11 additions and 11 deletions

View file

@ -20,7 +20,7 @@ Feature: Being redirected to previous filtered page
And I delete the "FC Barcelona T-Shirt" product on filtered page
Then I should be redirected to the previous page of only enabled products
@no-api @ui
@no-api @ui @mink:chromedriver
Scenario: Being redirected to previous filtered page after cancelling editing a product
When I browse products
And I choose enabled filter
@ -29,7 +29,7 @@ Feature: Being redirected to previous filtered page
And I cancel my changes
Then I should be redirected to the previous page of only enabled products
@no-api @ui
@no-api @ui @mink:chromedriver
Scenario: Being redirected to previous filtered page with pagination after cancelling editing a product
When I browse products
And I choose enabled filter
@ -39,7 +39,7 @@ Feature: Being redirected to previous filtered page
And I cancel my changes
Then I should be redirected to the 2nd page of only enabled products
@no-api @ui
@no-api @ui @mink:chromedriver
Scenario: Being redirected to previous filtered page after cancelling creating a new product
When I browse products
And I choose enabled filter

View file

@ -11,11 +11,11 @@ Feature: Being redirected to previous filtered page
And this payment method has been disabled
And I am logged in as an administrator
@no-api @ui
Scenario: Being redirected to previous filtered page after cancelling creating a new payment method
@no-api @ui @mink:chromedriver
Scenario: Being redirected to previous filtered page after cancelling editing an existing payment method
When I browse payment methods
And I choose enabled filter
And I filter
And I want to create a new offline payment method
And I want to modify the "Offline" payment method
And I cancel my changes
Then I should be redirected to the previous page of only enabled payment methods

View file

@ -45,7 +45,7 @@ class UpdatePage extends SymfonyPage implements UpdatePageInterface
public function cancelChanges(): void
{
$this->getDocument()->find('css', '[data-test-cancel-changes-button]')->click();
$this->getElement('back_button')->click();
}
public function getValidationMessage(string $element): string
@ -89,10 +89,10 @@ class UpdatePage extends SymfonyPage implements UpdatePageInterface
protected function getDefinedElements(): array
{
return array_merge(
parent::getDefinedElements(),
['form' => 'form'],
);
return array_merge(parent::getDefinedElements(), [
'back_button' => '[data-test-cancel-changes-button]',
'form' => 'form'
]);
}
protected function waitForFormUpdate(): void