Skip to content

Commit

Permalink
Fix save XML modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrodjpl committed Apr 9, 2024
1 parent 5ec317e commit 6c04a1e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
33 changes: 10 additions & 23 deletions cws-test/src/test/java/jpl/cws/test/WebTestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion install/cws-ui/initiators.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
});*/
$("#saveXmlBtn").on("click", function(){
$("#saveMsg").modal();
$("#saveMsg").modal("show");
});
$("#saveConfirmBtn").on("click", function() {
Expand Down

0 comments on commit 6c04a1e

Please sign in to comment.