mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 13:20:43 +00:00
working bulk-edit test
This commit is contained in:
114
src/test/java/com/kingsrook/qqq/materialdashboard/tests/BulkEditTest.java
Executable file
114
src/test/java/com/kingsrook/qqq/materialdashboard/tests/BulkEditTest.java
Executable file
@ -0,0 +1,114 @@
|
||||
/*
|
||||
* QQQ - Low-code Application Framework for Engineers.
|
||||
* Copyright (C) 2021-2022. Kingsrook, LLC
|
||||
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
|
||||
* contact@kingsrook.com
|
||||
* https://github.com/Kingsrook/
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.kingsrook.qqq.materialdashboard.tests;
|
||||
|
||||
|
||||
import com.kingsrook.qqq.materialdashboard.lib.QBaseSeleniumTest;
|
||||
import com.kingsrook.qqq.materialdashboard.lib.javalin.QSeleniumJavalin;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Test for the scripts table
|
||||
*******************************************************************************/
|
||||
public class BulkEditTest extends QBaseSeleniumTest
|
||||
{
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Override
|
||||
protected void addJavalinRoutes(QSeleniumJavalin qSeleniumJavalin)
|
||||
{
|
||||
super.addJavalinRoutes(qSeleniumJavalin);
|
||||
addCommonRoutesForThisTest(qSeleniumJavalin);
|
||||
qSeleniumJavalin
|
||||
.withRouteToFile("/metaData/process/person.bulkEdit", "metaData/process/person.bulkEdit.json")
|
||||
.withRouteToFile("/processes/person.bulkEdit/init", "/processes/person.bulkEdit/init.json")
|
||||
.withRouteToFile("/processes/person.bulkEdit/74a03a7d-2f53-4784-9911-3a21f7646c43/step/edit", "/processes/person.bulkEdit/step/edit.json")
|
||||
.withRouteToFile("/processes/person.bulkEdit/74a03a7d-2f53-4784-9911-3a21f7646c43/step/review", "/processes/person.bulkEdit/step/review.json")
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
private void addCommonRoutesForThisTest(QSeleniumJavalin qSeleniumJavalin)
|
||||
{
|
||||
qSeleniumJavalin.withRouteToFile("/data/person/count", "data/person/count.json");
|
||||
qSeleniumJavalin.withRouteToFile("/data/person/query", "data/person/index.json");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
// @RepeatedTest(100)
|
||||
void test()
|
||||
{
|
||||
qSeleniumLib.gotoAndWaitForBreadcrumbHeader("/peopleApp/greetingsApp/person", "Person");
|
||||
qSeleniumLib.waitForSelectorContaining("button", "selection").click();
|
||||
qSeleniumLib.waitForSelectorContaining("li", "This page").click();
|
||||
qSeleniumLib.waitForSelectorContaining("div", "records on this page are selected");
|
||||
|
||||
qSeleniumLib.waitForSelectorContaining("button", "action").click();
|
||||
qSeleniumLib.waitForSelectorContaining("li", "bulk edit").click();
|
||||
|
||||
/////////////////
|
||||
// edit screen //
|
||||
/////////////////
|
||||
qSeleniumLib.waitForSelector("#bulkEditSwitch-firstName").click();
|
||||
qSeleniumLib.waitForSelector("input[name=firstName]").click();
|
||||
qSeleniumLib.waitForSelector("input[name=firstName]").sendKeys("John");
|
||||
qSeleniumLib.waitForSelectorContaining("button", "next").click();
|
||||
|
||||
///////////////////////
|
||||
// validation screen //
|
||||
///////////////////////
|
||||
qSeleniumLib.waitForSelectorContaining("span", "How would you like to proceed").click();
|
||||
qSeleniumLib.waitForSelectorContaining("button", "next").click();
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// need to change the result of the 'review' step this time //
|
||||
//////////////////////////////////////////////////////////////
|
||||
qSeleniumLib.waitForSelectorContaining("div", "Person Bulk Edit: Review").click();
|
||||
qSeleniumJavalin.clearRoutes();
|
||||
qSeleniumJavalin.stop();
|
||||
addCommonRoutesForThisTest(qSeleniumJavalin);
|
||||
qSeleniumJavalin.withRouteToFile("/processes/person.bulkEdit/74a03a7d-2f53-4784-9911-3a21f7646c43/step/review", "/processes/person.bulkEdit/step/review-result.json");
|
||||
qSeleniumJavalin.restart();
|
||||
qSeleniumLib.waitForSelectorContaining("button", "submit").click();
|
||||
|
||||
///////////////////
|
||||
// result screen //
|
||||
///////////////////
|
||||
qSeleniumLib.waitForSelectorContaining("div", "Person Bulk Edit: Result").click();
|
||||
qSeleniumLib.waitForSelectorContaining("button", "close").click();
|
||||
|
||||
// qSeleniumLib.waitForever();
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +1,23 @@
|
||||
{
|
||||
"values": {
|
||||
"firstName": "Kahhhhn",
|
||||
"valuesBeingUpdated": "First Name will be set to: Kahhhhn",
|
||||
"bulkEditEnabledFields": "firstName",
|
||||
"transactionLevel": "process",
|
||||
"tableName": "person",
|
||||
"recordsParam": "recordIds",
|
||||
"supportsFullValidation": true,
|
||||
"recordIds": "1,2,3,4,5",
|
||||
"queryFilterJSON": "{\"criteria\":[{\"fieldName\":\"id\",\"operator\":\"IN\",\"values\":[\"1\",\"2\",\"3\",\"4\",\"5\"]}]}"
|
||||
"sourceTable": "person",
|
||||
"extract": {
|
||||
"name": "com.kingsrook.qqq.backend.core.processes.implementations.etl.streamedwithfrontend.ExtractViaQueryStep",
|
||||
"codeType": "JAVA"
|
||||
},
|
||||
"recordCount": 5,
|
||||
"previewMessage": "This is a preview of the records that will be updated.",
|
||||
"transform": {
|
||||
"name": "com.kingsrook.qqq.backend.core.processes.implementations.bulk.edit.BulkEditTransformStep",
|
||||
"codeType": "JAVA"
|
||||
},
|
||||
"destinationTable": "person",
|
||||
"bulkEditEnabledFields": "firstName"
|
||||
},
|
||||
"processUUID": "74a03a7d-2f53-4784-9911-3a21f7646c43",
|
||||
"nextStep": "review"
|
||||
|
@ -0,0 +1,60 @@
|
||||
{
|
||||
"values": {
|
||||
"transactionLevel": "process",
|
||||
"tableName": "person",
|
||||
"recordsParam": "recordIds",
|
||||
"supportsFullValidation": true,
|
||||
"doFullValidation": true,
|
||||
"recordIds": "1,2,3,4,5",
|
||||
"sourceTable": "person",
|
||||
"extract": {
|
||||
"name": "com.kingsrook.qqq.backend.core.processes.implementations.etl.streamedwithfrontend.ExtractViaQueryStep",
|
||||
"codeType": "JAVA"
|
||||
},
|
||||
"validationSummary": [
|
||||
{
|
||||
"status": "OK",
|
||||
"count": 5,
|
||||
"message": "Person records will be edited.",
|
||||
"singularFutureMessage": "Person record will be edited.",
|
||||
"pluralFutureMessage": "Person records will be edited.",
|
||||
"singularPastMessage": "Person record was edited.",
|
||||
"pluralPastMessage": "Person records were edited."
|
||||
},
|
||||
{
|
||||
"status": "INFO",
|
||||
"message": "First name will be set to John"
|
||||
}
|
||||
],
|
||||
"recordCount": 5,
|
||||
"previewMessage": "This is a preview of the records that will be updated.",
|
||||
"transform": {
|
||||
"name": "com.kingsrook.qqq.backend.core.processes.implementations.bulk.edit.BulkEditTransformStep",
|
||||
"codeType": "JAVA"
|
||||
},
|
||||
"destinationTable": "person",
|
||||
"bulkEditEnabledFields": "firstName",
|
||||
"processResults": [
|
||||
{
|
||||
"status": "OK",
|
||||
"count": 5,
|
||||
"message": "Person records were edited.",
|
||||
"singularFutureMessage": "Person record will be edited.",
|
||||
"pluralFutureMessage": "Person records will be edited.",
|
||||
"singularPastMessage": "Person record was edited.",
|
||||
"pluralPastMessage": "Person records were edited."
|
||||
},
|
||||
{
|
||||
"status": "INFO",
|
||||
"message": "Mapping Exception Type was cleared out"
|
||||
}
|
||||
],
|
||||
"load": {
|
||||
"name": "com.kingsrook.qqq.backend.core.processes.implementations.etl.streamedwithfrontend.LoadViaUpdateStep",
|
||||
"codeType": "JAVA"
|
||||
},
|
||||
"basepullReadyToUpdateTimestamp": true
|
||||
},
|
||||
"processUUID": "74a03a7d-2f53-4784-9911-3a21f7646c43",
|
||||
"nextStep": "result"
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
{
|
||||
"values": {
|
||||
"transactionLevel": "process",
|
||||
"tableName": "person",
|
||||
"recordsParam": "recordIds",
|
||||
"supportsFullValidation": true,
|
||||
"doFullValidation": true,
|
||||
"recordIds": "1,2,3,4,5",
|
||||
"sourceTable": "person",
|
||||
"extract": {
|
||||
"name": "com.kingsrook.qqq.backend.core.processes.implementations.etl.streamedwithfrontend.ExtractViaQueryStep",
|
||||
"codeType": "JAVA"
|
||||
},
|
||||
"validationSummary": [
|
||||
{
|
||||
"status": "OK",
|
||||
"count": 5,
|
||||
"message": "Person records will be edited.",
|
||||
"singularFutureMessage": "Person record will be edited.",
|
||||
"pluralFutureMessage": "Person records will be edited.",
|
||||
"singularPastMessage": "Person record was edited.",
|
||||
"pluralPastMessage": "Person records were edited."
|
||||
},
|
||||
{
|
||||
"status": "INFO",
|
||||
"message": "First name will be set to John"
|
||||
}
|
||||
],
|
||||
"recordCount": 5,
|
||||
"previewMessage": "This is a preview of the records that will be updated.",
|
||||
"transform": {
|
||||
"name": "com.kingsrook.qqq.backend.core.processes.implementations.bulk.edit.BulkEditTransformStep",
|
||||
"codeType": "JAVA"
|
||||
},
|
||||
"destinationTable": "person",
|
||||
"bulkEditEnabledFields": "firstName"
|
||||
},
|
||||
"processUUID": "74a03a7d-2f53-4784-9911-3a21f7646c43",
|
||||
"nextStep": "review"
|
||||
}
|
Reference in New Issue
Block a user