-
Notifications
You must be signed in to change notification settings - Fork 158
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
OP-326: New content elements #506
Conversation
jkindly
commented
Jul 8, 2024
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Related tickets | OP-326 |
License | MIT |
public function findByNamePart(string $phrase): array | ||
{ | ||
return $this->createQueryBuilder('o') | ||
->andWhere('o.name LIKE :name') |
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.
Couldn't we really do this in another way? LIKE %% has incredible bad performance...
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 agree, but there is already exact the same method in block, collection and pages. I just copied this one to the media. I'm not sure what we can change here. I was looking for a solution and didn't find anything special, except Elasticsearch or something similar. Maybe you have some idea?
@@ -131,6 +131,30 @@ public function iFillTheNameIfItIsEmpty(string $name): void | |||
$this->resolveCurrentPage()->fillNameIfItIsEmpty($name); | |||
} | |||
|
|||
/** | |||
* @When I click on Add button in Content elements section |
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.
"Content" by capital "C"?
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.
Yes, because it is name of the section, not single content element, so I think it should be capitalized.
{ | ||
Assert::isInstanceOf($this->getDriver(), ChromeDriver::class); | ||
|
||
$addButton = $this->getElement('content_elements_add_button'); | ||
$addButton->click(); | ||
|
||
$addButton->waitFor(3, function (): bool { | ||
return $this->hasElement('content_elements_textarea'); | ||
$addButton->waitFor(2, function (): bool { |
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 hope it is 2 ms, not 2 s 🙏
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.
It's seconds. All behat tests are written like this, even in Sylius core. I changed all occurrences to lower ones.