-
Task
-
Resolution: Fixed
-
Neutral
-
None
Please see code in info.magnolia.functionaltests.PagesCoreFunctionalTests#publishDeletionSinglePage for more detail
@Test @Fixture(fixtureFile = "website.lorem-ipsum.yaml", repository = "website") @Cleanup("website:/lorem-ipsum") @ImplicitWaitTimeout(seconds = 30) void publishDeletionSinglePage(PageObjects expect) { loginAndOpenPagesApp(expect, Personas.PETER); // TODO: remove this method once MGNLCE-214 is resolved pagesApp.selectRowByPath("/lorem-ipsum") .hitAction("Publish"); // This assert to make sure it is availabe on public instance assertNotEquals(HttpStatus.SC_NOT_FOUND, getStatusOfDirectPublicPage("lorem-ipsum")); pagesApp.clickRow("Lorem ipsum") .hitAction("Delete page"); expect.alert().confirm(); pagesApp.selectRowByPath("/lorem-ipsum") .hitAction("Publish deletion"); assertFalse(pagesApp.hasRow("lorem-ipsum"));// Will be failed this step assertEquals(HttpStatus.SC_NOT_FOUND, getStatusOfDirectPublicPage("lorem-ipsum")); }
As a matter of fact, hasRow(...) returns even faster than the implicit wait timeout because internally it temporarily drops it to 500ms. The goal behind this was to respond faster when it is valid that an element is not there, instead of waiting for the whole timeout.
In this case, however, publishing usually requiring a few seconds to complete, this clearly doesn't work.
Here we can't rely on increasing implicit wait time until we catch ElementNotFoundException, rather we could use an ExpectedCondition and rely on explicit wait time, for instance we could have a method
boolean notHasRow(String itemCaption, ViewType viewType) { return newWebDriverWait(driver).until(ExpectedConditions.invisibilityOfElementLocated(byGridRowItem(itemCaption, viewType))); }
- mentioned in
-
Page Loading...