Skip to content

Commit

Permalink
Improving sessionRestOperations fix #88 (#90)
Browse files Browse the repository at this point in the history
* Jenkinsfile to debug TjobN

* Change log and video name for ease its debugging

* Refactoring the test case to improve its maintainability

* Restoring Jenkinsfile

* Undo formatting changes done by IntelliJ
  • Loading branch information
augustocristian authored Mar 3, 2024
1 parent 0fbabc8 commit 19f111d
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ static void setupAll() { // 28 lines
FirefoxDriverManager.getInstance(firefox).setup();
}

String envUrl = System.getProperty("SUT_URL");
String envPort = System.getProperty("SUT_PORT");
String envTJobName = System.getProperty("tjob_name");
log.debug("Using URL {} PORT: {} TJOB: {}", envUrl, envPort, envTJobName);
String envUrl = System.getProperty("SUT_URL") != null ? System.getProperty("SUT_URL") : System.getenv("SUT_URL");
String envPort = System.getProperty("SUT_PORT") != null ? System.getProperty("SUT_PORT") : System.getenv("SUT_PORT");
String envTJobName = System.getProperty("tjob_name") != null ? System.getProperty("tjob_name") : System.getenv("tjob_name");
log.info("Using URL {} PORT: {} TJOB: {}", envUrl, envPort, envTJobName);
// Check if SUT_URL is defined in the environment variables
if ((envUrl != null) & (envPort != null)) {
TJOB_NAME = envTJobName;
Expand Down Expand Up @@ -383,4 +383,5 @@ public String getUserName(BrowserUser user, boolean goBack, String host) throws

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public ChromeUser(String userName, int timeOfWaitInSeconds, String testName, Str
log.info("Starting the configuration of the web browser");
log.debug(String.format("The Test names are: %s", testName));


LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable(BROWSER, ALL);
options.setCapability("goog:loggingPrefs", logPrefs);
Expand Down Expand Up @@ -80,12 +79,12 @@ public ChromeUser(String userName, int timeOfWaitInSeconds, String testName, Str
//CAPABILITIES FOR SELENOID RETORCH
selenoidOptions.put("enableVideo", true);
selenoidOptions.put("enableVNC", true);
selenoidOptions.put("name", testName + "_" + userIdentifier);
selenoidOptions.put("name", testName + "-" + userIdentifier);

DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yy-MM-dd-HH:mm");
LocalDateTime now = LocalDateTime.now();
String logName = dtf.format(now) + "-" + testName + "-" + userIdentifier + ".log";
String videoName = dtf.format(now) + "_" + testName + "_" + userIdentifier + ".mp4";
String logName = System.getProperty("tjob_name") + "-" + dtf.format(now) + "-" + testName + "-" + userIdentifier + ".log";
String videoName = System.getProperty("tjob_name") + "-" + dtf.format(now) + "-" + testName + "-" + userIdentifier + ".mp4";
log.debug("The data of this test would be stored into: video name " + videoName + " and the log is " + logName);

selenoidOptions.put("enableLog", true);
Expand Down
Loading

0 comments on commit 19f111d

Please sign in to comment.