Rework ShowPage and IndexPage in Shop/Product to DataAttributes#10953
Merged
GSadee merged 3 commits intoDec 20, 2019
Merged
Conversation
Contributor
Tomanhez
commented
Dec 17, 2019
| Q | A |
|---|---|
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| License | MIT |
ecfd04a to
45741ba
Compare
AdamKasp
reviewed
Dec 18, 2019
45741ba to
9c285da
Compare
GSadee
reviewed
Dec 18, 2019
9c285da to
90dbf81
Compare
455955b to
bccf93d
Compare
bccf93d to
4fa7f94
Compare
GSadee
reviewed
Dec 19, 2019
| Assert::notNull($products); | ||
|
|
||
| return null !== $products->find('css', sprintf('.sylius-product-name:contains("%s")', $productName)); | ||
| return $productName === $products->find('css', sprintf('[data-test-product-name="%s"]', $productName))->getText(); |
Member
There was a problem hiding this comment.
You can use here getElement method
Contributor
Author
d61f36e to
f44d19e
Compare
AdamKasp
reviewed
Dec 20, 2019
| public function isProductOnList(string $productName): bool | ||
| { | ||
| return null !== $this->getDocument()->find('css', sprintf('.sylius-product-name:contains("%s")', $productName)); | ||
| try{ |
Contributor
There was a problem hiding this comment.
why did you change it to try/catch block?
Contributor
Author
There was a problem hiding this comment.
when I replace getDocument() to getElement() and element will not exist, getElement throw exception, we can use hasElement if all element is defined like hasElement('product') but if we try hasElement('product', ['%productName% => $productName']) we get error
f44d19e to
08804b7
Compare
GSadee
approved these changes
Dec 20, 2019
Member
|
Thank you, Tomasz! 🥇 |
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.
