Skip to content
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

changes for test rail reporting #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sajithveluthattil
Copy link

@neofreko Added changes - To show the devices used for test execution via automation

Copy link
Collaborator

@afathonih afathonih left a comment

Choose a reason for hiding this comment

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

Once we extract that custom_test_device string, we are good with this PR.

@@ -74,6 +76,16 @@ public static TestRailArgs getNewTestRailListenerArgs() {
}
}

String deviceName = System.getProperty("testRail.device");
System.out.println("DEVICE IS"+deviceName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add colon, space and makes it sentence case to look nice.

if (deviceName != null) {
try {
args.primaryDevice = deviceName;
} catch(NumberFormatException ex) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this try-catch? Is it converting it to number?


// add the result
Map<String, Object> body = new HashMap<String, Object>();
body.put("status_id", getStatus(resultStatus));
body.put("comment",
new String(comment.toString().getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8));
body.put("elapsed", elapsed);

body.put("custom_test_device", 999);//comment added
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is hard-coded field name, let's move it as constant where it's easy to find. Or makes it as another argument with default value.

@@ -268,6 +270,7 @@ public void reportResult(List<Map<String, Object>> properties) {
body.put("comment", new String(comment.toString().getBytes(StandardCharsets.ISO_8859_1),
StandardCharsets.UTF_8));
body.put("elapsed", elapsed);
body.put("custom_test_device",999);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above:
Since this is hard-coded field name, let's move it as constant where it's easy to find. Or makes it as another argument with default value.

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