[MGNLTEST-165] contentApp.hasRow("yet-another-page") not working in time Created: 04/May/21  Updated: 19/Oct/21  Resolved: 20/Sep/21

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.2

Type: Bug Priority: Critical
Reporter: Christoph Meier Assignee: Michael Duerig
Resolution: Fixed Votes: 0
Labels: VN-Maintenance, shaky-test
Remaining Estimate: Not Specified
Time Spent: 1.5h
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by MGNLUI-6871 Grid row not updating reliably after ... Closed
Relates
relates to MGNLTEST-164 RenderedPage not reachable (or too late) Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: core-TF-features-bugs-improvements
Story Points: 8

 Description   

We have been using the contentApp#hasRow for assertions in several tests in PagesCoreFunctionalTests, AssetsCoreFunctionalTests (and maybe others too).

While this worked fine for some time, this changed recently.

It's possible that this is related to the fact that we had to change the version of ubuntu on AWS. The ubuntu version 18 we are using now has been reported to be significantly slower than previous versions.

Tests have been "fixed" / adjusted by doing assertions with selenium-independent assertions using the MagnoliaHttpClient (instead of the the RenderedPage).

Acceptance criteria

"Adjust" the test-fwk in a way that contentApp.hasRow("yet-another-page") again can be used as a trustworthy way to make assertions.
Make sure there is a self-test checking that the contentApp.hasRow("yet-another-page") works as expected.

Example test, which worked "before" and now fails, but which should work again from PagesCoreFunctionalTests):

    @Test
    @Fixture(fixtureFile = "website.lorem-ipsum.yaml", repository = "website")
    @Cleanup("website:/lorem-ipsum")
    void editPage(PageObjects expect) {
        loginAndOpenPagesApp(expect, Personas.ERIC);

        pagesApp.clickRow("Lorem ipsum")
                .hitAction("Edit page")
                .hitAction("Edit page properties");
        expect.form("Page properties")
                .setTextField("Page title (en)", "Summa cum laude")
                .save();

        pagesApp.openTab("Pages");
        assertTrue(pagesApp.hasRow("Summa cum laude"));
    }

Developers note

The issue simply spoken seems to be a timing issue. 
A fix may likely contain code which checks whether certain condition is already checked/true.
Such logic should go into the method of the page object where we have the failure - here this is ContentApp#hasRow.

In case you need to add "waiting" / "conditional waiting" - consider using the https://github.com/awaitility/awaitility framework.

 

Additional notes:

Here's a possible reason why Ubuntu 18 is "slower" than previous versions:
https://github.com/opencontainers/runc/pull/2921 (via Maxime).

 

 



 Comments   
Comment by Michael Duerig [ 20/Sep/21 ]

The fix for MGNLUI-6871  also fixes the issue described in this ticket.

Generated at Mon Feb 12 07:46:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.