Skip to content
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

[Behat] Changed navigation to UDW from Subitems in "Content can be moved to trash from root location" test #1184

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

mnocon
Copy link
Member

@mnocon mnocon commented Jan 9, 2020

Question Answer
Tickets https://jira.ez.no/browse/EZP-31283
Bug fix? yes
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

This is a tricky one, so a longer explanaition is needed 😉

Tests are failing with:

  @javascript @common

  Scenario: Content can be moved to trash from root location                         # vendor/ezsystems/ezplatform-admin-ui/features/standard/ContentManagement.feature:99

    Given I navigate to content "Test Article Manage" of type "Article" in root path # EzSystems\EzPlatformAdminUi\Behat\BusinessContext\NavigationContext::iNavigateToContentInRoot()

      There's no subitem Test Article Manage on Sub-item list

      Failed asserting that false is true.

(source: https://travis-ci.com/ezsystems/ezplatform-page-builder/jobs/273793371)

What we know (from the log):

    │  [2020-01-09 09:38:17] app.ERROR: Starting Step I go to "Content structure" in Content tab
    │  [2020-01-09 09:38:20] app.ERROR: Ending Step I go to "Content structure" in Content tab
    │  [2020-01-09 09:38:20] app.ERROR: Starting Step going to trash there is "Landing page" "VersionsLandingPage" on list
    │  [2020-01-09 09:38:21] app.ERROR: Ending Step going to trash there is "Landing page" "VersionsLandingPage" on list
    │  [2020-01-09 09:38:21] app.ERROR: Ending Scenario "Landing Page can be sent to Trash"
    │  [2020-01-09 09:38:22] app.ERROR: Starting Scenario "Changes can be discarded while creating new Content Type Group"
    │  [2020-01-09 09:38:22] app.ERROR: Starting Step I am logged as "admin"
    │  [2020-01-09 09:38:24] ezrecommendation.ERROR: Recommendation login event notification error: cURL error 1: Protocol "/api/https" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
    │  [2020-01-09 09:38:25] app.ERROR: Ending Step I am logged as "admin"
    │  [2020-01-09 09:38:25] app.ERROR: Starting Step I go to "Content Types" in "Admin" tab
    │  [2020-01-09 09:38:27] app.ERROR: Ending Step I navigate to content "Test Article Manage" of type "Article" in root path

So, there are two Scenarios running in parallel:

These are facts, here comes what I think is happening:
Imagine there are 12 items on subitems list, and the one we're searching for is the eleventh:
Zrzut ekranu 2020-01-10 o 12 46 03
Zrzut ekranu 2020-01-10 o 12 46 38

It's not present on the first result page, it should be visible on the second one. But if I do following steps:

  • open a new browser tab and delete one of the items visible in first page in Subitems
  • go back to original tab and switch to second page in Subitems

The result is:
Zrzut ekranu 2020-01-10 o 12 48 53
Assuming I don't know that the subitems list has been modified when I was searching for an item (the tests don't know that) the item I'm searching for is not found in all displayed pages (it reality it's displayed in page one).

In this scenario I've decided to switch navigation to UDW, where such issue should not occur.
Here are 15 jobs where this Scenario has been run (on EE Demo) and all of them passed: https://github.com/ezsystems/ezplatform-page-builder/pull/467 . This is not a bullet-proof solution, the same problem could appear again in the future - I have some ideas how to handle that, but I'm afraid it could increase the time required to run tests.

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@mnocon mnocon changed the title [WIP] [Behat] Changed navigation to UDW from Subitems to avoid concurrency … [Behat] Changed navigation to UDW from Subitems in "Content can be moved to trash from root location" test Jan 10, 2020
Copy link
Member

@micszo micszo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, indeed tricky! 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants