-
Notifications
You must be signed in to change notification settings - Fork 47
EZEE-1517: Add new scenarios for the content-on-the-fly-prototype-bundle bundle #875
EZEE-1517: Add new scenarios for the content-on-the-fly-prototype-bundle bundle #875
Conversation
{ | ||
if ($baseElement == null) { | ||
$baseElement = $this->getSession()->getPage(); | ||
} | ||
$elements = $this->findAllWithWait($selector, $baseElement); | ||
foreach ($elements as $element) { | ||
if ($textSelector != null) { | ||
$elementText = $this->findWithWait($textSelector, $element)->getText(); | ||
try { | ||
$elementText = $this->findWithWait($textSelector, $element)->getText(); |
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.
findWithWait can throw Exceptions if element does not exist or is not visible - in this case IMHO next elements from the list should be processed (if no matching element is found this function returns "false" anyway).
@@ -226,8 +226,17 @@ public function clickActionBar($button) | |||
*/ | |||
public function clickEditActionBar($button) | |||
{ | |||
$this->clickElementByText($button, '.ez-editactionbar-container .ez-action', '.action-label'); | |||
$this->waitWhileLoading(); | |||
$actionBarElements = $this->findAllWithWait('.ez-editactionbar-container .ez-action .action-label'); |
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.
This change has been made because in some cases the previous approach was not efficient:
If elements have been found using the main selector and weren't visible, the spin function waited the whole timeout for them to become visible (and only then processing the next item in array). This resulted in a huge execution time of this step (clicking the button took ca. 60 seconds, now it's much faster).
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'm ok with this, however given the v2 efforts it's not optimal that we aim to reuse methods from this bundle in others. We had BehatBundle for that, but it's been deprecated so maybe we need to have a discussion on the layout of behat code across packages. /cc @bdunogier
@andrerom Currently the PlatformUI Context must be reused, as it contains all the useful methods (findWithWait, clickElementByClass etc.), it would be nice to extract them to a separate Context (and in this bundle leave only those that interact with the Platform part). Discussion about the layout of behat code looks like a good idea. |
merged, @mnocon please proceed on getting approval on the other PRs. |
Thanks, will do that |
JIRA Ticket: https://jira.ez.no/browse/EZEE-1517
Corresponding PRs:
Content on the Fly (main one) - ezsystems/content-on-the-fly-prototype-bundle#34
StudioUI - https://github.com/ezsystems/StudioUIBundle/pull/782
Small changes here, required by "Content on the fly" PR: