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

await expected conditions after tab delete #1601

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/org/labkey/test/tests/TabTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import org.junit.experimental.categories.Category;
import org.labkey.test.BaseWebDriverTest;
import org.labkey.test.Locator;
import org.labkey.test.WebDriverWrapper;
import org.labkey.test.categories.Daily;
import org.labkey.test.components.BodyWebPart;
import org.labkey.test.components.labkey.PortalTab;
import org.labkey.test.util.Ext4Helper;
import org.labkey.test.util.LabKeyExpectedConditions;
Expand All @@ -30,6 +30,7 @@
import org.openqa.selenium.WebElement;

import java.util.List;
import java.util.NoSuchElementException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand Down Expand Up @@ -114,14 +115,23 @@ private void doTabManagementTests()
String tab2Delete = "RENAMED TAB 1";
portalHelper.activateTab(tab2Delete);
portalHelper.deleteTab("Test Tab 2");
List<BodyWebPart> bodyparts = portalHelper.getBodyWebParts();
assertTrue("Webparts failed to load after tab delete while on page", bodyparts != null && bodyparts.size() > 0);
assertEquals("Wrong tab selected after tab deletion", tab2Delete, getText(PortalHelper.Locators.activeTab().containing(tab2Delete)).replace(Locator.NBSP, " ").trim());
WebDriverWrapper.waitFor(()-> portalHelper.getBodyWebParts().size() > 0,
"Webparts failed to load after tab delete while on page", 2000);
WebDriverWrapper.waitFor(()-> {
try
{
return getText(PortalHelper.Locators.activeTab())
.replace(Locator.NBSP, " ").equals(tab2Delete);
}catch (NoSuchElementException retry)
{
return false;
}
}, "Wrong tab selected after tab deletion", 2000);

//Delete tab while on the Tab
portalHelper.deleteTab(tab2Delete);
bodyparts = portalHelper.getBodyWebParts();
assertTrue("Webparts failed to load after tab delete", bodyparts != null && bodyparts.size() > 0);
WebDriverWrapper.waitFor(()-> portalHelper.getBodyWebParts().size() > 0,
"Webparts failed to load after tab delete while on page", 2000);
}

@LogMethod
Expand Down