mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-22 23:28:44 +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();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user