Uploaded image for project: 'Magnolia Test Framework'
  1. Magnolia Test Framework
  2. MGNLTEST-165

contentApp.hasRow("yet-another-page") not working in time

XMLWordPrintable

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

       

       

        Acceptance criteria

              mduerig Michael Duerig
              cmeier Christoph Meier
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 1.5h
                    1.5h