Skip to content

Conversation

Nsinglaa
Copy link
Collaborator

Description

Types of changes

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@Nsinglaa Nsinglaa changed the title Ccfri 5574 cms selenium testing Ccfri 5574,5818 : Validlogin, delink organization cms selenium testing Sep 11, 2025
@Nsinglaa Nsinglaa changed the title Ccfri 5574,5818 : Validlogin, delink organization cms selenium testing Ccfri 5574,5818 : Validlogin, delink organization CMS Sep 11, 2025
* removed nest .git; track CCOFCMS_Seleniumas normal folder

* removed credentials
@trev-dev trev-dev force-pushed the ccfri-5574-CMS-Selenium-Testing branch from e3c3c38 to a0b4335 Compare September 12, 2025 00:07
@Nsinglaa
Copy link
Collaborator Author

@weskubo-cgi I have made the required changes as discussed yesterday.

  • Restructured the Selenium folder inside the test folder
  • Made the test cafe folder for the stale files inside the test folder
  • Updated .gitignore with config.properties, extend-reports, logs, test-output
  • Added sample config.properties

Copy link
Collaborator

@weskubo-cgi weskubo-cgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer lower case for folder names. E.g.
\test\selenium
\test\test-cafe

Copy link

Copy link
Collaborator

@weskubo-cgi weskubo-cgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some more comments. Most of these were picked up by SonarQube which you can install on Eclipse.


import ca.bc.gov.ecc.ccof.baseclass.BaseTest;

public class utlities extends BaseTest {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class names should start with an uppercase character. Your IDE should be warning about issues such as this. You would also look at installing SonarQube or a similar tool for additional static checking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved. Added SonarQube as per suggestion too

import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

public class readJsonFile {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class names should start with an uppercase character.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

import org.json.simple.parser.ParseException;

public class readJsonFile {
// static String recThree;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this code necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed . Still working on this file. Added a Comment

FileInputStream fis = new FileInputStream(propertyfile);
prop.load(fis);
String data = prop.getProperty(value);
System.out.println("data: " + data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using a logger here since you can control the level of logging.

JSONObject statuses = (JSONObject) jsonObject.get("statuses");

String recThree = (String) statuses.get("CCFRIRecThree");
System.out.println("CCFRIRecThree value is: " + recThree);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using a logger here since you can control the level of logging.

}
});
} catch (Exception e) {
System.out.println("[INFO] There is no folder for screenshots created yet, one will be created");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use a logger.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

try {
Files.delete(path);
} catch (IOException e) {
e.printStackTrace();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use a logger.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

}
}

public static String getScreenshot(WebDriver driver, String screenshotName) throws Exception {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenshotName is unused.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved


protected void clickIfPresent(WebElement element, String elementName, boolean isPresent) {

if (isPresent != true) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be !isPresent.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

import io.github.bonigarcia.wdm.WebDriverManager;

public class BaseTest {
protected static ExtentReports extent;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most (if not all) of these static values should also be final. And you can initialize them in a static block (https://www.baeldung.com/java-static-instance-initializer-blocks#static-block) instead of the setup() method (which isn't static).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants