-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4742 from GSadee/admin-payment-method
[Admin][PaymentMethod] Payment method features
- Loading branch information
Showing
29 changed files
with
1,047 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is part of the Sylius package. | ||
# (c) Paweł Jędrzejewski | ||
|
||
default: | ||
suites: | ||
ui_managing_payment_methods: | ||
contexts_as_services: | ||
- sylius.behat.context.hook.doctrine_orm | ||
|
||
- sylius.behat.context.setup.channel | ||
- sylius.behat.context.setup.payment | ||
- sylius.behat.context.setup.security | ||
|
||
- sylius.behat.context.transform.locale | ||
- sylius.behat.context.transform.payment_method | ||
- sylius.behat.context.transform.shared_storage | ||
|
||
- sylius.behat.context.ui.admin.managing_payment_methods | ||
filters: | ||
tags: "@managing_payment_methods && @ui" |
30 changes: 30 additions & 0 deletions
30
features/payment/managing_payment_methods/adding_payment_method.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@managing_payment_methods | ||
Feature: Adding a new payment method | ||
In order to pay for orders in different ways | ||
As an Administrator | ||
I want to add a new payment method to the registry | ||
|
||
Background: | ||
Given the store operates on a single channel in "France" | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Adding a new payment method | ||
Given I want to create a new payment method | ||
When I name it "Paypal Express Checkout" in "English (United States)" | ||
And I specify its code as "PEC" | ||
And I choose "Paypal Express Checkout" gateway | ||
And I add it | ||
Then I should be notified that it has been successfully created | ||
And the payment method "Paypal Express Checkout" should appear in the registry | ||
|
||
@ui | ||
Scenario: Adding a new payment method with description | ||
Given I want to create a new payment method | ||
When I name it "Paypal Express Checkout" in "English (United States)" | ||
And I specify its code as "PEC" | ||
And I choose "Paypal Express Checkout" gateway | ||
And I describe it as "Payment method Paypal Express Checkout" in "English (United States)" | ||
And I add it | ||
Then I should be notified that it has been successfully created | ||
And the payment method "Paypal Express Checkout" should appear in the registry |
16 changes: 16 additions & 0 deletions
16
features/payment/managing_payment_methods/browsing_payment_methods.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@managing_payment_methods | ||
Feature: Browsing payment methods | ||
In order to see all payment methods in the store | ||
As an Administrator | ||
I want to be able to browse payment methods | ||
|
||
Background: | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Browsing defined payment methods | ||
Given the store has a payment method "Offline" with a code "OFF" | ||
And the store has a payment method "PayPal Express Checkout" with a code "PEC" | ||
When I browse payment methods | ||
Then I should see 2 payment methods in the list | ||
And the payment method "PayPal Express Checkout" should be in the registry |
15 changes: 15 additions & 0 deletions
15
features/payment/managing_payment_methods/deleting_payment_method.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@managing_payment_methods | ||
Feature: Deleting payment methods | ||
In order to remove test, obsolete or incorrect payment methods | ||
As an Administrator | ||
I want to be able to delete a payment method | ||
|
||
Background: | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Deleted payment method should disappear from the registry | ||
Given the store has a payment method "Offline" with a code "offline" | ||
When I delete the "Offline" payment method | ||
Then I should be notified that it has been successfully deleted | ||
And this payment method should no longer exist in the registry |
47 changes: 47 additions & 0 deletions
47
features/payment/managing_payment_methods/editing_payment_method.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@managing_payment_methods | ||
Feature: Editing payment methods | ||
In order to change which payment methods are available in my store | ||
As an Administrator | ||
I want to be able to edit payment method | ||
|
||
Background: | ||
Given the store has a payment method "Offline" with a code "offline" | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Renaming the payment method | ||
Given I want to modify the "Offline" payment method | ||
When I rename it to "Cash on delivery" in "English (United States)" | ||
And I save my changes | ||
Then I should be notified that it has been successfully edited | ||
And this payment method name should be "Cash on delivery" | ||
|
||
@ui | ||
Scenario: Modifying payment method gateway | ||
Given I want to modify the "Offline" payment method | ||
When I choose "Paypal Express Checkout" gateway | ||
And I save my changes | ||
Then I should be notified that it has been successfully edited | ||
And this payment method gateway should be "paypal_express_checkout" | ||
|
||
@ui | ||
Scenario: Disabling payment method | ||
Given I want to modify the "Offline" payment method | ||
When I disable it | ||
And I save my changes | ||
Then I should be notified that it has been successfully edited | ||
And this payment method should be disabled | ||
|
||
@ui | ||
Scenario: Enabling payment method | ||
Given the payment method "Offline" is disabled | ||
And I want to modify the "Offline" payment method | ||
When I enable it | ||
And I save my changes | ||
Then I should be notified that it has been successfully edited | ||
And this payment method should be enabled | ||
|
||
@ui | ||
Scenario: Seeing disabled code field while editing payment method | ||
When I want to modify the "Offline" payment method | ||
Then the code field should be disabled |
20 changes: 20 additions & 0 deletions
20
features/payment/managing_payment_methods/payment_method_unique_code_validation.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@managing_payment_methods | ||
Feature: Payment method unique code validation | ||
In order to uniquely identify payment methods | ||
As an Administrator | ||
I want to be prevented from adding two payment methods with the same code | ||
|
||
Background: | ||
Given the store operates on a single channel in "France" | ||
And the store has a payment method "Offline" with a code "offline" | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Trying to add payment method with taken code | ||
Given I want to create a new payment method | ||
When I name it "Paypal Express Checkout" in "English (United States)" | ||
And I specify its code as "offline" | ||
And I choose "Offline" gateway | ||
And I try to add it | ||
Then I should be notified that payment method with this code already exists | ||
And there should still be only one payment method with code "offline" |
38 changes: 38 additions & 0 deletions
38
features/payment/managing_payment_methods/payment_method_validation.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@managing_payment_methods | ||
Feature: Payment method validation | ||
In order to avoid making mistakes when managing a payment method | ||
As an Administrator | ||
I want to be prevented from adding it without specifying required fields | ||
|
||
Background: | ||
Given the store operates on a single channel in "France" | ||
And the store has a payment method "Offline" with a code "offline" | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: Trying to add a new payment method without specifying its code | ||
Given I want to create a new payment method | ||
When I name it "Paypal Express Checkout" in "English (United States)" | ||
But I do not specify its code | ||
And I choose "Paypal Express Checkout" gateway | ||
And I add it | ||
Then I should be notified that code is required | ||
And the payment method with name "Paypal Express Checkout" should not be added | ||
|
||
@ui | ||
Scenario: Trying to add a new payment method without specifying its name | ||
Given I want to create a new payment method | ||
When I specify its code as "PEC" | ||
And I choose "Paypal Express Checkout" gateway | ||
But I do not name it | ||
And I add it | ||
Then I should be notified that name is required | ||
And the payment method with code "PEC" should not be added | ||
|
||
@ui | ||
Scenario: Trying to remove name from an existing payment method | ||
Given I want to modify the "Offline" payment method | ||
When I remove its name from "English (United States)" translation | ||
And I try to save my changes | ||
Then I should be notified that name is required | ||
And this payment method should still be named "Offline" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.