Skip to content

Commit

Permalink
Merge pull request #24 from ing-bank/fix/retryViaCmd
Browse files Browse the repository at this point in the history
Fix/retry via cmd
  • Loading branch information
psupriya15 authored Sep 2, 2024
2 parents 7134112 + bb0aa30 commit a42122f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Engine/src/main/java/com/ing/engine/cli/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void createStandaloneReport() {

static void reRun() {
try {
Control.call(true);
Control.call();
} catch (UnCaughtException ex) {
Logger.getLogger(CLI.class.getName()).log(Level.SEVERE, null, ex);
}
Expand Down Expand Up @@ -115,7 +115,7 @@ static void executeWith(Map<String, Option> execution) {
}
if (execution.containsKey(Op.RUN)) {
try {
Control.call(true);
Control.call();
} catch (UnCaughtException ex) {
Logger.getLogger(CLI.class.getName()).log(Level.SEVERE, null, ex);
}
Expand Down
5 changes: 3 additions & 2 deletions Engine/src/main/java/com/ing/engine/commands/Assertions.java
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,12 @@ public void assertVariable() throws RuntimeException {
if (strAns.equals(strTemp[1])) {
System.out.println("Condition '" + Input + "' is true ");
Report.updateTestLog("assertVariable",
"Variable matched with Provided data", Status.PASS);
"Variable value matches with provided data "+strTemp[1], Status.PASSNS);

} else {
System.out.println("Condition '" + Input + "' is false ");
throw new Exception("Variable did not match with provided data");
Report.updateTestLog("assertVariable",
"Variable value is "+strAns+" but expected value is "+strTemp[1], Status.FAILNS);
}
} catch (Exception ex) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, ex);
Expand Down
14 changes: 5 additions & 9 deletions Engine/src/main/java/com/ing/engine/core/Control.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.ing.engine.constants.FilePath;
import com.ing.engine.constants.SystemDefaults;
import com.ing.engine.drivers.PlaywrightDriver;
import com.ing.engine.drivers.WebDriverFactory;
import com.ing.engine.execution.exception.UnCaughtException;
import com.ing.engine.execution.run.ProjectRunner;

Expand Down Expand Up @@ -42,13 +41,11 @@ public class Control {

private static PlaywrightDriver playwrightDriver;

private static void start(Boolean quit) {
private static void start() {
do {
Control control = new Control();
control.startRun();
control.resetAll();
if(quit)
System.exit(0);
} while (exe.retryExecution());
ConsoleReport.reset();

Expand All @@ -57,15 +54,15 @@ private static void start(Boolean quit) {
public static void call(Project project) throws UnCaughtException {
RunManager.init();
exe = ProjectRunner.load(project);
start(false);
start();
}

public static void call(Boolean quit) throws UnCaughtException {
public static void call() throws UnCaughtException {
RunManager.init();
if (exe == null) {
exe = ProjectRunner.load(RunManager.getGlobalSettings().getProjectPath());
}
start(quit);
start();
}

public static Project getCurrentProject() {
Expand Down Expand Up @@ -213,8 +210,7 @@ public static void main(String[] args) throws UnCaughtException {
if (args != null && args.length > 0) {
LookUp.exe(args);
} else {
if( Arrays.asList(args).contains("quit"))
call(true);
call();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ private String getBatRCommand() {
if (os.contains("windows")) {
return "Run.bat";
}
return "Run.command";
return "./Run.command";
}

private void getAzDoYaml() {
Expand Down

0 comments on commit a42122f

Please sign in to comment.