Skip to content

Commit

Permalink
Merge pull request #57 from MohabMohie/3.1.x
Browse files Browse the repository at this point in the history
3.1.x
  • Loading branch information
MohabMohie committed Sep 15, 2019
2 parents 70f781e + 87f997c commit 22944db
Show file tree
Hide file tree
Showing 13 changed files with 495 additions and 279 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.mohabmohie</groupId>
<artifactId>SHAFT_ENGINE</artifactId>
<version>3.1.20190902</version>
<version>3.1.20190915</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Selenium Hybrid Automation Framework for Testing [SHAFT]</description>
<url>https://github.com/MohabMohie/SHAFT_ENGINE</url>
Expand Down
201 changes: 142 additions & 59 deletions src/main/java/com/shaft/api/RestActions.java

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/main/java/com/shaft/cli/FileActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ private static void failAction(String actionName, String testData, String log) {
if (testData != null) {
message = message + " With the following test data [" + testData + "].";
}
ReportManager.log(message);
if ((log != null) && (!log.trim().equals(""))) {
ReportManager.attachAsStep("API Response", "Command Log", log);
ReportManager.log(message, Arrays.asList(Arrays.asList("API Response", "Command Log", log)));
} else {
ReportManager.log(message);

}
Assert.fail(message);
}
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/com/shaft/cli/TerminalActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ private void passAction(String actionName, String testData, String log) {
ReportManager.logDiscrete(message);
ReportManager.logDiscrete("CLI Response - Terminal Log:\n" + log);
} else {
ReportManager.log(message);
if ((log != null) && (!log.trim().equals(""))) {
ReportManager.attachAsStep("CLI Response", "Terminal Log", log);
ReportManager.log(message, Arrays.asList(Arrays.asList("CLI Response", "Terminal Log", log)));
} else {
ReportManager.log(message);

}
}
}
Expand All @@ -141,9 +143,10 @@ private void failAction(String actionName, String testData, String log) {
if (testData != null) {
message = message + " With the following test data [" + testData + "].";
}
ReportManager.log(message);
if ((log != null) && (!log.trim().equals(""))) {
ReportManager.attachAsStep("API Response", "Command Log", log);
ReportManager.log(message, Arrays.asList(Arrays.asList("API Response", "Command Log", log)));
} else {
ReportManager.log(message);
}
Assert.fail(message);
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/shaft/db/DatabaseActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.concurrent.Executors;

import org.testng.Assert;
Expand Down Expand Up @@ -63,9 +64,10 @@ private static void passAction(String actionName, String testData, String queryR
if (testData != null) {
message = message + " With the following test data [" + testData + "].";
}
ReportManager.log(message);
if (queryResult != null) {
ReportManager.attachAsStep("DB Response", "Query Result", queryResult);
ReportManager.log(message, Arrays.asList(Arrays.asList("DB Response", "Query Result", queryResult)));
} else {
ReportManager.log(message);
}
}

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/shaft/gui/browser/BrowserActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ private static void passAction(WebDriver driver, String actionName, String testD
message = message + " With the following test data [" + testData + "].";
}
if (driver != null) {
ScreenshotManager.captureScreenShot(driver, actionName, true);
ReportManager.log(message, Arrays.asList(ScreenshotManager.captureScreenShot(driver, actionName, true)));
} else {
ReportManager.log(message);
}
ReportManager.log(message);
}

private static void failAction(String actionName) {
Expand All @@ -68,9 +69,10 @@ private static void failAction(WebDriver driver, String actionName, String testD
message = message + " With the following test data [" + testData + "].";
}
if (driver != null) {
ScreenshotManager.captureScreenShot(driver, actionName, false);
ReportManager.log(message, Arrays.asList(ScreenshotManager.captureScreenShot(driver, actionName, false)));
} else {
ReportManager.log(message);
}
ReportManager.log(message);
Assert.fail(message);
}

Expand Down
Loading

0 comments on commit 22944db

Please sign in to comment.