-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Api][Checkout] cover skipping payment steps in behat #11705
Conversation
AdamKasp
commented
Jul 31, 2020
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
License | MIT |
d59972b
to
4162c6b
Compare
808b5ed
to
4d279a3
Compare
82b97ac
to
e0d9e47
Compare
features/checkout/leaving_notes_on_order_during_checkout.feature
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Ui/Shop/Checkout/CheckoutShippingContext.php
Outdated
Show resolved
Hide resolved
$shippingMethodName = 'Free'; | ||
if ($shippingMethod !== null) { | ||
$shippingMethodName = $shippingMethod->getName(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add it? Shipping method shouldn't be null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because i reuse function iSelectShippingMethod
where ShippingMethod
can be null because function: iProceedSelectingBillingCountryAndShippingMethod
can have null as a agument
src/Sylius/Behat/Context/Ui/Shop/Checkout/CheckoutShippingContext.php
Outdated
Show resolved
Hide resolved
@@ -41,21 +42,25 @@ public function __construct( | |||
} | |||
|
|||
/** | |||
* @Given I have proceeded selecting :shippingMethodName shipping method | |||
* @When I proceed with :shippingMethodName shipping method | |||
* @Given I have proceeded selecting :shippingMethod shipping method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason you changed the implementation of steps in ui context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at one of the API steps, I needed to get shippingMethod
instead shipping method name
that implicated changes also in UI steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, but this shouldn't force changes in UI context, you can have it implemented @Given I have proceeded selecting :shippingMethodName shipping method
in UI context and @Given I have proceeded selecting :shippingMethod shipping method
in API context
src/Sylius/Behat/Resources/config/suites/api/checkout/checkout.yml
Outdated
Show resolved
Hide resolved
badf27b
to
bebcbc2
Compare
e1d9ea1
to
df96304
Compare
df96304
to
d32ff14
Compare
/** | ||
* @Then I should not see any information about payment method | ||
*/ | ||
public function iShouldNotSeeAnyInformationAboutPaymentMethod() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function iShouldNotSeeAnyInformationAboutPaymentMethod() | |
public function iShouldNotSeeAnyInformationAboutPaymentMethod(): void |
@@ -116,7 +117,7 @@ public function iProceedSelectingPaymentMethod($paymentMethodName) | |||
* @Given I have proceeded order with :shippingMethodName shipping method and :paymentMethodName payment | |||
* @When I proceed with :shippingMethodName shipping method and :paymentMethodName payment | |||
*/ | |||
public function iProceedOrderWithShippingMethodAndPayment($shippingMethodName, $paymentMethodName) | |||
public function iProceedOrderWithShippingMethodAndPayment(string $shippingMethodName, $paymentMethodName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function iProceedOrderWithShippingMethodAndPayment(string $shippingMethodName, $paymentMethodName) | |
public function iProceedOrderWithShippingMethodAndPayment(string $shippingMethodName, string $paymentMethodName): void |
Thank you, Adam! 🎉 |
This PR was merged into the 1.8-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | based on #11705 | License | MIT <!-- - Bug fixes must be submitted against the 1.7 branch (the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- fb50dab [Api] Fix failing steps