Skip to content

Commit

Permalink
Add Behat scenarios reproducing the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Dec 3, 2020
1 parent 2fd8004 commit 22521e7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ Feature: Trying to onboard more than one PayPal seller
Scenario: Trying to onboard second PayPal seller
When I try to create a new payment method with "PayPal" gateway factory
Then I should be notified that I cannot onboard more than one PayPal seller

@ui
Scenario: Being able to create different payment methods
When I want to create a new offline payment method
Then I should not be notified that I cannot onboard more than one PayPal seller
19 changes: 19 additions & 0 deletions tests/Behat/Context/Admin/ManagingPaymentMethodsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace Tests\Sylius\PayPalPlugin\Behat\Context\Admin;

use Behat\Behat\Context\Context;
use Behat\Mink\Exception\ElementNotFoundException;
use Sylius\Behat\Exception\NotificationExpectationMismatchException;
use Sylius\Behat\NotificationType;
use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
use Sylius\Behat\Page\Admin\PaymentMethod\CreatePageInterface;
Expand Down Expand Up @@ -67,4 +69,21 @@ public function iShouldBeNotifiedThatICannotOnboardMoreThanOnePayPalSeller(): vo
NotificationType::failure()
);
}

/**
* @Then I should not be notified that I cannot onboard more than one PayPal seller
*/
public function iShouldNotBeNotifiedThatICannotOnboardMoreThanOnePayPalSeller(): void
{
try {
$this->notificationChecker->checkNotification(
'You cannot onboard more than one PayPal seller!',
NotificationType::failure()
);
} catch (NotificationExpectationMismatchException|ElementNotFoundException $exception) {
return;
}

throw new \DomainException('Step should fail');
}
}

0 comments on commit 22521e7

Please sign in to comment.