Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

EZEE-1517: Add new scenarios for the content-on-the-fly-prototype-bundle bundle #875

Merged
merged 1 commit into from
Jul 5, 2017
Merged

EZEE-1517: Add new scenarios for the content-on-the-fly-prototype-bundle bundle #875

merged 1 commit into from
Jul 5, 2017

Conversation

mnocon
Copy link
Member

@mnocon mnocon commented Jun 9, 2017

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:

  • new step (to switch UDW tab)
  • changed visibility of some methods
  • added two small improvements.

{
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();
Copy link
Member Author

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');
Copy link
Member Author

@mnocon mnocon Jun 12, 2017

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).

@mnocon mnocon changed the title [WIP] EZEE-1517: Add new scenarios for the content-on-the-fly-prototype-bundle bundle EZEE-1517: Add new scenarios for the content-on-the-fly-prototype-bundle bundle Jun 14, 2017
Copy link
Contributor

@andrerom andrerom left a 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

@mnocon
Copy link
Member Author

mnocon commented Jun 28, 2017

@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.

@andrerom andrerom merged commit d821998 into ezsystems:master Jul 5, 2017
@andrerom
Copy link
Contributor

andrerom commented Jul 5, 2017

merged, @mnocon please proceed on getting approval on the other PRs.

@mnocon
Copy link
Member Author

mnocon commented Jul 5, 2017

Thanks, will do that

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants