[Behat] Refactor API clients#13832
Merged
Merged
Conversation
lchrusciel
reviewed
Apr 6, 2022
Contributor
There was a problem hiding this comment.
Nice to be able to spot it, but perhaps we should extract separate context for it? May be done in separate PR
a3f5e35 to
69834bd
Compare
69834bd to
dac2677
Compare
GSadee
reviewed
Apr 12, 2022
e6250ea to
985ad9a
Compare
985ad9a to
56dc7af
Compare
Zales0123
reviewed
Apr 13, 2022
| public function iBrowseExchangeRatesOfTheStore(): void | ||
| { | ||
| $this->client->index(); | ||
| $this->client->index('exchange-rates',); |
Contributor
There was a problem hiding this comment.
Extra comma, here and below 💃
| public function theFirstProductOnTheListShouldHave(string $field, string $value): void | ||
| { | ||
| $products = $this->responseChecker->getCollection($this->client->getLastResponse()); | ||
| $response = $this->sharedStorage->has('response') ? $this->sharedStorage->get('response') : $this->client->getLastResponse(); |
Contributor
There was a problem hiding this comment.
It's 3 times in the class, could be extracted to the private function
| <argument type="service" id="test.client" /> | ||
| <argument type="service" id="sylius.behat.shared_storage" /> | ||
| <argument>%sylius.api.authorization_header%</argument> | ||
| </service> |
Contributor
There was a problem hiding this comment.
Changes in this file are just beautiful 🎉
Zales0123
approved these changes
Apr 13, 2022
Contributor
|
Thank you Adam & Grzegorz! 🎉 |
lchrusciel
added a commit
that referenced
this pull request
Apr 14, 2022
… a separate class (GSadee) This PR was merged into the 1.10-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | after #13832 | License | MIT To avoid potential problems with defining resources names using API client, I've extracted available resources to one class in Behat. <!-- - Bug fixes must be submitted against the 1.10 or 1.11 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 ------- 864e61c [Behat][API] Extract resources names from contexts to a separate class f16d93c [Behat][API] Extract providing last response to private method in ManagingProductsContext
GSadee
added a commit
that referenced
this pull request
Oct 10, 2022
…Milek) This PR was merged into the 1.12 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.12 <!-- see the comment below --> | | Bug fix? | no | | New feature? | no | | BC breaks? | no | | Deprecations? | no <!-- don't forget to update the UPGRADE-*.md file --> | | License | MIT | <!-- - Bug fixes must be submitted against the 1.11 branch - Features and deprecations must be submitted against the 1.12 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 --> Related to [PR](#13832) and [PR](#13869) Commits ------- 3610c30 [API][Behat] Add note about behat client changes
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With many API clients, we have problems with getting the last response, now we have only 2 clients: shop and admin.