diff --git a/src/qqq/components/horseshoe/NavBar.tsx b/src/qqq/components/horseshoe/NavBar.tsx
index f2aefb4..fd7cfac 100644
--- a/src/qqq/components/horseshoe/NavBar.tsx
+++ b/src/qqq/components/horseshoe/NavBar.tsx
@@ -251,7 +251,7 @@ function NavBar({absolute, light, isMini}: Props): JSX.Element
{
pageHeader &&
-
+
{pageHeader}
diff --git a/src/qqq/components/misc/SavedViews.tsx b/src/qqq/components/misc/SavedViews.tsx
index 81237ea..59dcc07 100644
--- a/src/qqq/components/misc/SavedViews.tsx
+++ b/src/qqq/components/misc/SavedViews.tsx
@@ -405,7 +405,7 @@ function SavedViews({qController, metaData, tableMetaData, currentSavedView, tab
}
{
- hasStorePermission &&
+ hasStorePermission && currentSavedView != null &&
}
{
- hasStorePermission &&
-
+ hasStorePermission && currentSavedView != null &&
+
}
{
- hasDeletePermission &&
+ hasStorePermission && currentSavedView != null &&
-
@@ -2157,6 +2274,13 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
setTableProcesses(ProcessUtils.getProcessesForTable(metaData, tableName)); // these are the ones to show in the dropdown
setAllTableProcesses(ProcessUtils.getProcessesForTable(metaData, tableName, true)); // these include hidden ones (e.g., to find the bulks)
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // now that we know the table - build a default view - initially, only used by SavedViews component, for showing if there's anything to be saved. //
+ // but also used when user selects new-view from the view menu //
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ const newDefaultView = buildTableDefaultView(tableMetaData);
+ setTableDefaultView(newDefaultView);
+
setPageState("loadedMetaData");
})();
}
@@ -2171,13 +2295,6 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
(async () =>
{
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // now that we know the table - build a default view - initially, only used by SavedViews component, for showing if there's anything to be saved. //
- // but also used when user selects new-view from the view menu //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- const newDefaultView = buildTableDefaultView();
- setTableDefaultView(newDefaultView);
-
//////////////////////////////////////////////////////////////////////////////////////////////
// once we've loaded meta data, let's check the location to see if we should open a process //
//////////////////////////////////////////////////////////////////////////////////////////////
@@ -2255,7 +2372,7 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
/////////////////////////////////////////////////////////////////////////////////////////////
// make sure that we clear out any currently saved view - we're no longer in such a state. //
/////////////////////////////////////////////////////////////////////////////////////////////
- doSetCurrentSavedView(null);
+ doClearCurrentSavedView();
}
catch(e)
{
@@ -2331,68 +2448,32 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
console.log("page state is loadedView - going to preparingGrid...");
setPageState("preparingGrid");
- (async () =>
+ //////////////////////////////////////////////////////////////////////////////////////////////////////
+ // check if any new columns have been added to the table since last time this view was activated... //
+ // or if anything in the view is no longer in the table //
+ //////////////////////////////////////////////////////////////////////////////////////////////////////
+ reconcileCurrentTableMetaDataWithView(view, "initialPageLoad");
+
+ ////////////////////////////////////////////////////////////////////////////////////////
+ // this ref may not be defined on the initial render, so, make this call in a timeout //
+ ////////////////////////////////////////////////////////////////////////////////////////
+ setTimeout(() =>
{
- const visibleJoinTables = getVisibleJoinTables();
+ // @ts-ignore
+ basicAndAdvancedQueryControlsRef?.current?.ensureAllFilterCriteriaAreActiveQuickFilters(view.queryFilter, "defaultFilterLoaded")
+ });
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // todo - we used to be able to set "warnings" here (i think, like, for if a field got deleted from a table... //
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // setWarningAlert(models.warning);
+ console.log("finished preparing grid, going to page state ready");
+ setPageState("ready");
- ////////////////////////////////////////////////////////////////////////////////////////
- // this ref may not be defined on the initial render, so, make this call in a timeout //
- ////////////////////////////////////////////////////////////////////////////////////////
- setTimeout(() =>
- {
- // @ts-ignore
- basicAndAdvancedQueryControlsRef?.current?.ensureAllFilterCriteriaAreActiveQuickFilters(view.queryFilter, "defaultFilterLoaded")
- });
+ ////////////////////////////////////////////
+ // if we need a variant, show that prompt //
+ ////////////////////////////////////////////
+ if (tableMetaData?.usesVariants && !tableVariant)
+ {
+ promptForTableVariantSelection();
+ }
- //////////////////////////////////////////////////////////////////////////////////////////////////
- // make sure that any if any sort columns are from a join table, that the join table is visible //
- // todo - figure out what this is, see if still needed, etc...
- //////////////////////////////////////////////////////////////////////////////////////////////////
- /*
- let resetColumnSortModel = false;
- for (let i = 0; i < columnSortModel.length; i++)
- {
- const gridSortItem = columnSortModel[i];
- if (gridSortItem.field.indexOf(".") > -1)
- {
- const tableName = gridSortItem.field.split(".")[0];
- if (!visibleJoinTables?.has(tableName))
- {
- columnSortModel.splice(i, 1);
- setColumnSortModel(columnSortModel);
- // todo - need to setQueryFilter?
- resetColumnSortModel = true;
- i--;
- }
- }
- }
-
- if (resetColumnSortModel && latestQueryId > 0)
- {
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // let the next render (since columnSortModel is watched below) build the filter, using the new columnSort //
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
- return;
- }
- */
-
- console.log("finished preparing grid, going to page state ready");
- setPageState("ready");
-
- ////////////////////////////////////////////
- // if we need a variant, show that prompt //
- ////////////////////////////////////////////
- if (tableMetaData?.usesVariants && !tableVariant)
- {
- promptForTableVariantSelection();
- return;
- }
- })();
return (getLoadingScreen());
}
@@ -2584,13 +2665,13 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
-
+
{pageLoadingState.isLoading() && ""}
{pageLoadingState.isLoadingSlow() && "Loading..."}
{pageLoadingState.isNotLoading() && getPageHeader(tableMetaData, visibleJoinTables, tableVariant)}
-
+
{
@@ -2622,37 +2703,31 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
*/}
- {alertContent ? (
-
-
- {
- setAlertContent(null);
- }}
- >
- {alertContent}
-
-
- ) : (
- ""
- )}
+ {
+ alertContent ? (
+
+ setAlertContent(null)}>{alertContent}
+
+ ) : null
+ }
{
(tableLabel && showSuccessfullyDeletedAlert) ? (
- setShowSuccessfullyDeletedAlert(false)}>{`${tableLabel} successfully deleted`}
+
+ setShowSuccessfullyDeletedAlert(false)}>{`${tableLabel} successfully deleted`}
+
) : null
}
{
(successAlert) ? (
- setSuccessAlert(null)}>{successAlert}
+ setSuccessAlert(null)}>{successAlert}
) : null
}
{
(warningAlert) ? (
- warning} sx={{mb: 3}} onClose={() => setWarningAlert(null)}>{warningAlert}
+ warning} sx={{mt: 1.5, mb: 0.5}} onClose={() => setWarningAlert(null)}>{warningAlert}
) : null
}
@@ -2700,11 +2775,8 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
}
}}
localeText={{
- toolbarFilters: "Filter", // label on the filters button. we prefer singular (1 filter has many "conditions" in it).
- toolbarFiltersLabel: "", // setting these 3 to "" turns off the "Show Filters" and "Hide Filters" tooltip (which can get in the way of the actual filters panel)
- toolbarFiltersTooltipShow: "",
- toolbarFiltersTooltipHide: "",
- toolbarFiltersTooltipActive: count => count !== 1 ? `${count} conditions` : `${count} condition`
+ columnMenuSortAsc: "Sort ascending",
+ columnMenuSortDesc: "Sort descending",
}}
pinnedColumns={pinnedColumns}
onPinnedColumnsChange={handlePinnedColumnsChange}
diff --git a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QSeleniumLib.java b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QSeleniumLib.java
index 10781d7..afdda0b 100755
--- a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QSeleniumLib.java
+++ b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QSeleniumLib.java
@@ -63,6 +63,11 @@ public class QSeleniumLib
private boolean autoHighlight = false;
+ //////////////////////////////////////////////////////////////////////////////////////
+ // useful to use on a WebElement, in a call like: .findElement(QSeleniumLib.PARENT) //
+ //////////////////////////////////////////////////////////////////////////////////////
+ public static final By PARENT = By.xpath("./..");
+
/*******************************************************************************
@@ -245,6 +250,18 @@ public class QSeleniumLib
+ /*******************************************************************************
+ **
+ *******************************************************************************/
+ public void moveMouseCursorToElement(WebElement element)
+ {
+ Actions actions = new Actions(driver);
+ actions.moveToElement(element);
+ actions.perform();
+ }
+
+
+
/*******************************************************************************
**
*******************************************************************************/
diff --git a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QueryScreenLib.java b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QueryScreenLib.java
index 9b08715..c69b883 100644
--- a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QueryScreenLib.java
+++ b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/lib/QueryScreenLib.java
@@ -57,6 +57,29 @@ public class QueryScreenLib
+ /*******************************************************************************
+ **
+ *******************************************************************************/
+ public void clickAdvancedFilterClearIcon()
+ {
+ qSeleniumLib.moveMouseCursorToElement(qSeleniumLib.waitForSelector(".filterBuilderButton"));
+ qSeleniumLib.waitForSelector(".filterBuilderXIcon BUTTON").click();
+ qSeleniumLib.waitForSelectorContaining("BUTTON", "Yes").click();
+ }
+
+
+
+ /*******************************************************************************
+ **
+ *******************************************************************************/
+ public void clickQuickFilterClearIcon(String fieldName)
+ {
+ qSeleniumLib.moveMouseCursorToElement(qSeleniumLib.waitForSelector("#quickFilter\\." + fieldName));
+ qSeleniumLib.waitForSelector("#quickFilter\\." + fieldName + "+span button").click();
+ }
+
+
+
/*******************************************************************************
**
*******************************************************************************/
@@ -97,6 +120,16 @@ public class QueryScreenLib
+ /*******************************************************************************
+ **
+ *******************************************************************************/
+ public void assertQuickFilterButtonDoesNotIndicateActiveFilter(String fieldName)
+ {
+ qSeleniumLib.waitForSelectorToNotExist("#quickFilter\\." + fieldName + ".filterActive");
+ }
+
+
+
/*******************************************************************************
**
*******************************************************************************/
@@ -132,7 +165,26 @@ public class QueryScreenLib
/*******************************************************************************
**
*******************************************************************************/
- public void addQueryFilterInput(QSeleniumLib qSeleniumLib, int index, String fieldLabel, String operator, String value, String booleanOperator)
+ public void assertSavedViewNameOnScreen(String savedViewName)
+ {
+ qSeleniumLib.waitForSelectorContaining("H3", savedViewName);
+ }
+
+
+
+ /*******************************************************************************
+ **
+ *******************************************************************************/
+ public WebElement waitForDataGridCellContaining(String containingText)
+ {
+ return qSeleniumLib.waitForSelectorContaining("DIV.MuiDataGrid-cell", containingText);
+ }
+
+
+ /*******************************************************************************
+ **
+ *******************************************************************************/
+ public void addAdvancedQueryFilterInput(QSeleniumLib qSeleniumLib, int index, String fieldLabel, String operator, String value, String booleanOperator)
{
if(index > 0)
{
diff --git a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/DashboardTableWidgetExportTest.java b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/DashboardTableWidgetExportTest.java
index f9d4779..23ad722 100755
--- a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/DashboardTableWidgetExportTest.java
+++ b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/DashboardTableWidgetExportTest.java
@@ -26,6 +26,7 @@ import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import com.kingsrook.qqq.frontend.materialdashboard.selenium.lib.QBaseSeleniumTest;
+import com.kingsrook.qqq.frontend.materialdashboard.selenium.lib.QSeleniumLib;
import com.kingsrook.qqq.frontend.materialdashboard.selenium.lib.javalin.QSeleniumJavalin;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Test;
@@ -89,7 +90,7 @@ public class DashboardTableWidgetExportTest extends QBaseSeleniumTest
// click the export button //
/////////////////////////////
qSeleniumLib.waitForSelector("#SampleTableWidget h6")
- .findElement(By.xpath("./.."))
+ .findElement(QSeleniumLib.PARENT)
.findElement(By.cssSelector("button"))
.click();
diff --git a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenFilterInUrlAdvancedModeTest.java b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenFilterInUrlAdvancedModeTest.java
similarity index 88%
rename from src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenFilterInUrlAdvancedModeTest.java
rename to src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenFilterInUrlAdvancedModeTest.java
index 23ccaed..0c42219 100755
--- a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenFilterInUrlAdvancedModeTest.java
+++ b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenFilterInUrlAdvancedModeTest.java
@@ -19,7 +19,7 @@
* along with this program. If not, see .
*/
-package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests;
+package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests.query;
import java.net.URLEncoder;
@@ -98,6 +98,16 @@ public class QueryScreenFilterInUrlAdvancedModeTest extends QBaseSeleniumTest
qSeleniumLib.waitForSelector("input[value=\"1701\"]");
qSeleniumLib.waitForSelector("input[value=\"74656\"]");
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // click the x to remove a condition from the filter (in the on-screen preview) //
+ // reload the page first, so filter-panel won't be up (clicking backdrop doesn't seem to be closing it like it should...) //
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ qSeleniumLib.gotoAndWaitForBreadcrumbHeaderToContain("/peopleApp/greetingsApp/person?filter=" + URLEncoder.encode(filterJSON, StandardCharsets.UTF_8), "Person");
+ qSeleniumLib.highlightElement(qSeleniumLib.waitForSelectorContaining(".advancedQueryString DIV DIV", "1701"));
+ qSeleniumLib.moveMouseCursorToElement(qSeleniumLib.waitForSelectorContaining(".advancedQueryString DIV DIV", "1701"));
+ qSeleniumLib.waitForSelector(".advancedQueryPreviewX-0 button").click();
+ queryScreenLib.assertNoFilterButtonBadge(1);
+
//////////////////////////////////////
// an IN for a possible-value field //
//////////////////////////////////////
@@ -162,8 +172,7 @@ public class QueryScreenFilterInUrlAdvancedModeTest extends QBaseSeleniumTest
////////////////
// remove one //
////////////////
- qSeleniumLib.tryMultiple(3, () -> qSeleniumLib.waitForSelector(".filterBuilderXIcon BUTTON").click());
- qSeleniumLib.waitForSelectorContaining("BUTTON", "Yes").click();
+ queryScreenLib.clickAdvancedFilterClearIcon();
queryScreenLib.assertNoFilterButtonBadge(1);
// qSeleniumLib.waitForever();
diff --git a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenFilterInUrlBasicModeTest.java b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenFilterInUrlBasicModeTest.java
similarity index 94%
rename from src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenFilterInUrlBasicModeTest.java
rename to src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenFilterInUrlBasicModeTest.java
index d2a5f9e..acd6ed2 100755
--- a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenFilterInUrlBasicModeTest.java
+++ b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenFilterInUrlBasicModeTest.java
@@ -19,7 +19,7 @@
* along with this program. If not, see .
*/
-package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests;
+package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests.query;
import java.net.URLEncoder;
@@ -147,11 +147,15 @@ public class QueryScreenFilterInUrlBasicModeTest extends QBaseSeleniumTest
qSeleniumLib.waitForSelector("input[value=\"starts with\"]");
qSeleniumLib.waitForSelector("input[value=\"Dar\"]");
- ////////////////
- // remove one //
- ////////////////
- // todo! qSeleniumLib.waitForSelectorContaining(".MuiIcon-root", "close").click();
- // todo! assertQuickFilterButtonBadge(1);
+ ////////////////////////////////
+ // remove one, then the other //
+ ////////////////////////////////
+ qSeleniumLib.clickBackdrop();
+ queryScreenLib.clickQuickFilterClearIcon("createDate");
+ queryScreenLib.assertQuickFilterButtonIndicatesActiveFilter("firstName");
+ queryScreenLib.assertQuickFilterButtonDoesNotIndicateActiveFilter("createDate");
+ queryScreenLib.clickQuickFilterClearIcon("firstName");
+ queryScreenLib.assertQuickFilterButtonDoesNotIndicateActiveFilter("firstName");
// qSeleniumLib.waitForever();
}
diff --git a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenTest.java b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenTest.java
similarity index 92%
rename from src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenTest.java
rename to src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenTest.java
index 24d33d9..9a458f0 100755
--- a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/QueryScreenTest.java
+++ b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/QueryScreenTest.java
@@ -19,7 +19,7 @@
* along with this program. If not, see .
*/
-package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests;
+package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests.query;
import com.kingsrook.qqq.frontend.materialdashboard.selenium.lib.QBaseSeleniumTest;
@@ -70,7 +70,7 @@ public class QueryScreenTest extends QBaseSeleniumTest
// open the filter window, enter a value, wait for query to re-run //
/////////////////////////////////////////////////////////////////////
qSeleniumJavalin.beginCapture();
- queryScreenLib.addQueryFilterInput(qSeleniumLib, 0, "Id", "equals", "1", null);
+ queryScreenLib.addAdvancedQueryFilterInput(qSeleniumLib, 0, "Id", "equals", "1", null);
///////////////////////////////////////////////////////////////////
// assert that query & count both have the expected filter value //
@@ -86,14 +86,13 @@ public class QueryScreenTest extends QBaseSeleniumTest
///////////////////////////////////////
qSeleniumLib.waitForSeconds(1); // todo grr.
qSeleniumLib.waitForSelector(QQQMaterialDashboardSelectors.BREADCRUMB_HEADER).click();
- qSeleniumLib.waitForSelectorContaining(".filterBuilderCountBadge", "1");
+ queryScreenLib.assertFilterButtonBadge(1);
///////////////////////////////////////////////////////////////////
// click the 'x' clear icon, then yes, then expect another query //
///////////////////////////////////////////////////////////////////
qSeleniumJavalin.beginCapture();
- qSeleniumLib.tryMultiple(3, () -> qSeleniumLib.waitForSelector(".filterBuilderXIcon BUTTON").click());
- qSeleniumLib.waitForSelectorContaining("BUTTON", "Yes").click();
+ queryScreenLib.clickAdvancedFilterClearIcon();
////////////////////////////////////////////////////////////////////
// assert that query & count both no longer have the filter value //
@@ -121,8 +120,8 @@ public class QueryScreenTest extends QBaseSeleniumTest
queryScreenLib.clickFilterButton();
qSeleniumJavalin.beginCapture();
- queryScreenLib.addQueryFilterInput(qSeleniumLib, 0, "First Name", "contains", "Dar", "Or");
- queryScreenLib.addQueryFilterInput(qSeleniumLib, 1, "First Name", "contains", "Jam", "Or");
+ queryScreenLib.addAdvancedQueryFilterInput(qSeleniumLib, 0, "First Name", "contains", "Dar", "Or");
+ queryScreenLib.addAdvancedQueryFilterInput(qSeleniumLib, 1, "First Name", "contains", "Jam", "Or");
String expectedFilterContents0 = """
{"fieldName":"firstName","operator":"CONTAINS","values":["Dar"]}""";
diff --git a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/SavedViewsTest.java b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/SavedViewsTest.java
similarity index 91%
rename from src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/SavedViewsTest.java
rename to src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/SavedViewsTest.java
index 99e8702..17c37fb 100755
--- a/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/SavedViewsTest.java
+++ b/src/test/java/com/kingsrook/qqq/frontend/materialdashboard/selenium/tests/query/SavedViewsTest.java
@@ -19,7 +19,7 @@
* along with this program. If not, see .
*/
-package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests;
+package com.kingsrook.qqq.frontend.materialdashboard.selenium.tests.query;
import java.net.URLEncoder;
@@ -90,13 +90,13 @@ public class SavedViewsTest extends QBaseSeleniumTest
/////////////////////////////////////////////////////
qSeleniumLib.waitForSelectorContaining("LI", "Some People").click();
qSeleniumLib.waitForCondition("Current URL should have view id", () -> driver.getCurrentUrl().endsWith("/person/savedView/2"));
- qSeleniumLib.waitForSelectorContaining("BUTTON", "Some People");
+ queryScreenLib.assertSavedViewNameOnScreen("Some People");
//////////////////////////////
// click into a view screen //
//////////////////////////////
qSeleniumLib.waitForSeconds(1); // wait for the filters menu to fully disappear? if this doesn't work, try a different word to look for...
- qSeleniumLib.waitForSelectorContaining("DIV.MuiDataGrid-cell", "jdoe@kingsrook.com").click();
+ queryScreenLib.waitForDataGridCellContaining("jdoe@kingsrook.com").click();
qSeleniumLib.waitForSelectorContaining("H5", "Viewing Person: John Doe");
///////////////////////////////////////////////////
@@ -105,7 +105,7 @@ public class SavedViewsTest extends QBaseSeleniumTest
///////////////////////////////////////////////////
qSeleniumLib.waitForSelectorContaining("A", "Person").click();
qSeleniumLib.waitForCondition("Current URL should have View id", () -> driver.getCurrentUrl().endsWith("/person/savedView/2"));
- qSeleniumLib.waitForSelectorContaining("BUTTON", "Some People");
+ queryScreenLib.assertSavedViewNameOnScreen("Some People");
queryScreenLib.assertQuickFilterButtonIndicatesActiveFilter("firstName");
//////////////////////
@@ -123,7 +123,7 @@ public class SavedViewsTest extends QBaseSeleniumTest
//////////////////////////////
// click into a view screen //
//////////////////////////////
- qSeleniumLib.waitForSelectorContaining("DIV.MuiDataGrid-cell", "jdoe@kingsrook.com").click();
+ queryScreenLib.waitForDataGridCellContaining("jdoe@kingsrook.com").click();
qSeleniumLib.waitForSelectorContaining("H5", "Viewing Person: John Doe");
///////////////////////////////////////////////////////////////////////////////
@@ -133,7 +133,7 @@ public class SavedViewsTest extends QBaseSeleniumTest
qSeleniumJavalin.beginCapture();
qSeleniumLib.waitForSelectorContaining("A", "Person").click();
qSeleniumLib.waitForCondition("Current URL should have filter id", () -> driver.getCurrentUrl().endsWith("/person/savedView/2"));
- qSeleniumLib.waitForSelectorContaining("BUTTON", "Some People");
+ queryScreenLib.assertSavedViewNameOnScreen("Some People");
qSeleniumLib.waitForSelectorContaining("DIV", "Unsaved Changes");
CapturedContext capturedContext = qSeleniumJavalin.waitForCapturedPath("/data/person/query");
assertTrue(capturedContext.getBody().contains("Kelkhoff"));
@@ -143,16 +143,7 @@ public class SavedViewsTest extends QBaseSeleniumTest
// navigate to the table with a View in the URL //
//////////////////////////////////////////////////
String filter = """
- {
- "criteria":
- [
- {
- "fieldName": "id",
- "operator": "LESS_THAN",
- "values": [10]
- }
- ]
- }
+ {"criteria":[{"fieldName":"id", "operator":"LESS_THAN", "values":[10]}]}
""".replace('\n', ' ').replaceAll(" ", "");
qSeleniumLib.gotoAndWaitForBreadcrumbHeaderToContain("/peopleApp/greetingsApp/person?filter=" + URLEncoder.encode(filter, StandardCharsets.UTF_8), "Person");
qSeleniumLib.waitForSelectorContaining("BUTTON", "Save View As");
@@ -160,7 +151,7 @@ public class SavedViewsTest extends QBaseSeleniumTest
//////////////////////////////
// click into a view screen //
//////////////////////////////
- qSeleniumLib.waitForSelectorContaining("DIV.MuiDataGrid-cell", "jdoe@kingsrook.com").click();
+ queryScreenLib.waitForDataGridCellContaining("jdoe@kingsrook.com").click();
qSeleniumLib.waitForSelectorContaining("H5", "Viewing Person: John Doe");
/////////////////////////////////////////////////////////////////////////////////