From 6c04a1e51f0c6284301386ee62999c2d3ca00e07 Mon Sep 17 00:00:00 2001 From: Joshua Rodriguez Date: Tue, 9 Apr 2024 11:02:25 -0700 Subject: [PATCH] Fix save XML modal --- .../test/java/jpl/cws/test/WebTestUtil.java | 33 ++++++------------- .../cws/test/integration/ui/LoadTestIT.java | 2 ++ install/cws-ui/initiators.ftl | 2 +- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java b/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java index fa227def..7e25380a 100644 --- a/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java +++ b/cws-test/src/test/java/jpl/cws/test/WebTestUtil.java @@ -296,36 +296,23 @@ public void enableWorkers(String procDef) { // wait.until(ExpectedConditions.elementToBeClickable(By.id("pv-"+procDef))); sleep(5000); WebElement enable = findElById("pv-"+procDef); - String elementHTML = enable.getAttribute("outerHTML"); + // String elementHTML = enable.getAttribute("outerHTML"); JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("arguments[0].scrollIntoViewIfNeeded();", enable); - TakesScreenshot screenshot = (TakesScreenshot)driver; - //Saving the screenshot in desired location - File source = screenshot.getScreenshotAs(OutputType.FILE); - //Path to the location to save screenshot - try{FileUtils.copyFile(source, new File("/tmp/Before-"+procDef+".png"));} +// TakesScreenshot screenshot = (TakesScreenshot)driver; +// //Saving the screenshot in desired location +// File source = screenshot.getScreenshotAs(OutputType.FILE); +// //Path to the location to save screenshot +// try{FileUtils.copyFile(source, new File("/tmp/Before-"+procDef+".png"));} -catch(IOException e) { - e.printStackTrace(); -} - System.out.println("Src attribute is: "+ elementHTML); +// catch(IOException e) { +// e.printStackTrace(); +// } + // System.out.println("Src attribute is: "+ elementHTML); sleep(5000); - // Point point = enable.getLocation(); - // int xCoord = point.getX(); - // int yCoord = point.getY(); - // js.executeScript("arguments[0].scroll(arguments[1], arguments[2]);", enable, xCoord, yCoord - 50); - // sleep(5000); - - -File source2 = screenshot.getScreenshotAs(OutputType.FILE); - try{FileUtils.copyFile(source2, new File("/tmp/After-"+procDef+".png"));} - -catch(IOException e) { - e.printStackTrace(); -} enable.click(); sleep(1000); diff --git a/cws-test/src/test/java/jpl/cws/test/integration/ui/LoadTestIT.java b/cws-test/src/test/java/jpl/cws/test/integration/ui/LoadTestIT.java index 196bd15f..71312a4a 100644 --- a/cws-test/src/test/java/jpl/cws/test/integration/ui/LoadTestIT.java +++ b/cws-test/src/test/java/jpl/cws/test/integration/ui/LoadTestIT.java @@ -56,6 +56,8 @@ public void runLargeLoadTest() throws IOException { // run 1000 models, 5 at a time (across 3 workers ideally) runStartLoadTest(); + System.out.println("TEST CASES: " + Integer.toString(testCasesCompleted)); + if (Integer.toString(testCasesCompleted).equals("1")) { scriptPass = true; } else { diff --git a/install/cws-ui/initiators.ftl b/install/cws-ui/initiators.ftl index ff73050e..7b837818 100644 --- a/install/cws-ui/initiators.ftl +++ b/install/cws-ui/initiators.ftl @@ -198,7 +198,7 @@ });*/ $("#saveXmlBtn").on("click", function(){ - $("#saveMsg").modal(); + $("#saveMsg").modal("show"); }); $("#saveConfirmBtn").on("click", function() {