Skip to content

Commit

Permalink
Merge pull request #9 from sreenigsd/Release_version_1.2
Browse files Browse the repository at this point in the history
Merging Release version 1.2 to Master
  • Loading branch information
sreenigsd authored Aug 27, 2020
2 parents 029a93c + 3bbbfdb commit 78810cd
Show file tree
Hide file tree
Showing 31 changed files with 723 additions and 282 deletions.
189 changes: 105 additions & 84 deletions Cheetah/pom.xml

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions Cheetah/src/main/java/base/Runner.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package base;


import java.io.IOException;

import com.gsd.sreenidhi.cheetah.engine.CheetahEngine;
import com.gsd.sreenidhi.cheetah.exception.CheetahException;

import cucumber.api.java.After;
import cucumber.api.java.Before;
import io.cucumber.java.*;



Expand All @@ -15,19 +17,22 @@ public static void main(String args[]) {
}

@Before
public void prepareScenario() throws Exception{
CheetahEngine.generateBase(CheetahEngine.props.getProperty("app.name"));
}
public void prepareScenario(io.cucumber.java.Scenario scenarioImpl) throws Exception{
CheetahEngine.generateBase(scenarioImpl, CheetahEngine.props.getProperty("app.name"));
}

@After
/**
* Embed a screenshot in test report if test is marked as failed
*/
public void processExecution(cucumber.api.Scenario scenarioImpl) throws Exception {
public void processExecution(io.cucumber.java.Scenario scenarioImpl) throws Exception {
CheetahEngine.processPostAction(scenarioImpl, CheetahEngine.props.getProperty("app.name"));
}


@AfterStep
public void processStep(io.cucumber.java.Scenario scenarioImpl) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, CheetahException, IOException {
CheetahEngine.afterStep(scenarioImpl);
}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void loadConfig(Object configurator, File configurationFile) throws Chee
dbConfigurator.setUsername(configRead.getString("username"));
dbConfigurator.setPassword(configRead.getString("password"));
dbConfigurator.setSchemaName(configRead.getString("schema-name"));
valid = false;
valid = true;
}catch(NullPointerException ex) {
valid = false;
Exception e = new NullPointerException("Missing required configurations. Please update your configurations and try again.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.touch.LongPressOptions;
import io.appium.java_client.touch.offset.PointOption;

/**
* @author Sreenidhi, Gundlupet
Expand Down Expand Up @@ -103,16 +105,27 @@ public static void scroll_up(By locator, int swipes, int power) throws CheetahEx

// To swipe from bottom to top
for (int x = 0; x < swipes; x = x + 1) {
PointOption startpo = new PointOption();
startpo.withCoordinates(startx, starty);

LongPressOptions startlpo = new LongPressOptions();
startlpo.withPosition(startpo);

PointOption endpo = new PointOption();
endpo.withCoordinates(endx, endy);


if ("ANDROID".equalsIgnoreCase(properties.getProperty("os.platform"))) {
// ((AndroidDriver)CheetahEngine.getDriverInstance()).swipe(startx,
// starty, endx, endy, power);
new TouchAction((AndroidDriver) CheetahEngine.getDriverInstance()).longPress(startx, starty)
.moveTo(endx, endy).release().perform();

new TouchAction((AndroidDriver) CheetahEngine.getDriverInstance()).longPress(startlpo)
.moveTo(endpo).release().perform();
} else {
// ((IOSDriver)CheetahEngine.getDriverInstance()).swipe(startx,
// starty, endx, endy, power);
new TouchAction((IOSDriver) CheetahEngine.getDriverInstance()).longPress(startx, starty)
.moveTo(endx, endy).release().perform();
new TouchAction((IOSDriver) CheetahEngine.getDriverInstance()).longPress(startlpo)
.moveTo(endpo).release().perform();
}
}

Expand Down Expand Up @@ -146,17 +159,27 @@ public static void scroll_down(By locator, int swipes, int power) throws Cheetah

// To swipe from top to bottom
for (int x = 0; x < swipes; x = x + 1) {

PointOption startpo = new PointOption();
startpo.withCoordinates(startx, starty);

LongPressOptions startlpo = new LongPressOptions();
startlpo.withPosition(startpo);

PointOption endpo = new PointOption();
endpo.withCoordinates(endx, endy);

if ("ANDROID".equalsIgnoreCase(properties.getProperty("os.platform"))) {
// ((AndroidDriver)
// CheetahEngine.getDriverInstance()).swipe(startx, starty, endx,
// endy, power);
new TouchAction((AndroidDriver) CheetahEngine.getDriverInstance()).longPress(startx, starty)
.moveTo(endx, endy).release().perform();
new TouchAction((AndroidDriver) CheetahEngine.getDriverInstance()).longPress(startlpo)
.moveTo(endpo).release().perform();
} else {
// ((IOSDriver) CheetahEngine.getDriverInstance()).swipe(startx,
// starty, endx, endy, power);
new TouchAction((IOSDriver) CheetahEngine.getDriverInstance()).longPress(startx, starty)
.moveTo(endx, endy).release().perform();
new TouchAction((IOSDriver) CheetahEngine.getDriverInstance()).longPress(startlpo)
.moveTo(endpo).release().perform();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.gsd.sreenidhi.cheetah.exception.CheetahException;
import com.gsd.sreenidhi.utils.jsonUtils;

import cucumber.api.DataTable;
import io.cucumber.datatable.DataTable;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import io.restassured.response.ValidatableResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.gsd.sreenidhi.cheetah.exception.CheetahException;
import com.gsd.sreenidhi.forms.Constants;

import au.com.bytecode.opencsv.CSVReader;
import com.opencsv.CSVReader;

/**
* @author Sreenidhi, Gundlupet
Expand Down Expand Up @@ -94,8 +94,7 @@ public int convertFile(String csvFileName, String xmlFileName, String delimiter)
false);
// ** Now using the OpenCSV **//

reader = new CSVReader(new FileReader(fu.getFile("INPUT", csvFileName).getAbsolutePath()),
delimiter.charAt(0));
reader = new CSVReader(new FileReader(fu.getFile("INPUT", csvFileName).getAbsolutePath()));

String[] nextLine;
int line = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.gsd.sreenidhi.cheetah.exception.CheetahException;
import com.gsd.sreenidhi.cheetah.reporting.ReportingBean;

import cucumber.api.Scenario;
import io.cucumber.java.Scenario;

/**
* @author Sreenidhi, Gundlupet
Expand Down Expand Up @@ -185,7 +185,7 @@ public static void updateScenario(Scenario scenario, ReportingBean bean) throws
connection = getConnection();
pstmt = connection.prepareStatement(transaction_SQL);
pstmt.setString(1, scenario.getName());
pstmt.setString(2, scenario.getStatus());
pstmt.setString(2, scenario.getStatus().toString());
pstmt.setString(3, bean.getTest_Page_URL());
pstmt.setString(4, bean.getTestStartTime().toString());
pstmt.setString(5, bean.getTestEndTime().toString());
Expand Down
Loading

0 comments on commit 78810cd

Please sign in to comment.