-
Notifications
You must be signed in to change notification settings - Fork 2
Ccfri 5574,5818 : Validlogin, delink organization CMS #813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* removed nest .git; track CCOFCMS_Seleniumas normal folder * removed credentials
e3c3c38
to
a0b4335
Compare
@weskubo-cgi I have made the required changes as discussed yesterday.
|
There was a problem hiding this 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
...selenium/src/main/java/ca/bc/gov/educ/ccof/selenium/PageObjects/CRMSignInCredentialPage.java
Outdated
Show resolved
Hide resolved
test/selenium/src/main/java/ca/bc/gov/educ/ccof/selenium/PageObjects/DeleteApplicationPage.java
Outdated
Show resolved
Hide resolved
test/selenium/src/test/java/ca/bc/gov/educ/ccof/selenium/TestCases/DeleteApplication.java
Outdated
Show resolved
Hide resolved
test/selenium/src/test/java/ca/bc/gov/educ/ccof/selenium/TestCases/ValidLogin.java
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code necessary?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
screenshotName is unused.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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).
Description
Types of changes
Checklist
Further comments