Skip to content

Commit

Permalink
"Get random element from GroupElements" bug fixed
Browse files Browse the repository at this point in the history
Artifact directory was changed from "C:\TEMP\CyberCat"  to "[user_home]/CyberCat/"
  • Loading branch information
ubegun committed Jul 21, 2014
1 parent 1fd97d5 commit b1dde77
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CyberCat-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>org.cybercat.autotest</groupId>
<artifactId>cybercat-automation-core</artifactId>
<version>1.0-RC6</version>
<version>1.0-realise</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
Expand Down
6 changes: 3 additions & 3 deletions CyberCat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cybercat.autotest</groupId>
<artifactId>cybercat-automation-core</artifactId>
<version>1.0-RC8</version>
<version>1.0-realise</version>
<url>https://github.com/ubegun/Cybercat</url>
<packaging>jar</packaging>
<name>Webdriver Core for automation testing</name>
Expand All @@ -21,7 +21,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<automation.deps.output.folder>lib</automation.deps.output.folder>
<automation.test.package.name>org.cybercat.automation</automation.test.package.name>
<selenium.version>2.37.0</selenium.version>
<selenium.version>2.39.0</selenium.version>
<testng.version>6.8.5</testng.version>
<junit.version>4.10</junit.version>
<springframework.version>3.1.1.RELEASE</springframework.version>
Expand Down Expand Up @@ -213,7 +213,7 @@
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.8</version>
<version>0.9</version>
<configuration>
<message>Maven artifacts for ${project.artifactId} ${project.version}</message>
<!-- git commit message -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,12 @@ public final static synchronized AutomationMain getMainFactory(String env_proper
System.out.println("===============================Runtime properties===============================");
System.out.println("environment propery file:\t" + propertyFileName);
String basicArtifactsDir = System.getProperty("config.basicArtifactsDir");
System.out.println("artifacts directory:\t" + basicArtifactsDir);
System.out.println("Report title:\t\t"
+ System.getProperty("org.uncommons.reportng.title", "Cybercat sample"));
System.out.println("================================================================================");
if (StringUtils.isEmpty(propertyFileName)) {
System.setProperty("config.properties", env_properties);
}
try {
ConfigurationManager.initWorkDirectories(basicArtifactsDir);
System.out.println("artifacts directory:\t" + ConfigurationManager.initWorkDirectories(basicArtifactsDir));

} catch (Exception e) {
throw new AutomationFrameworkException("Model initialization exception.", e);
}
Expand All @@ -176,6 +173,8 @@ public final static synchronized AutomationMain getMainFactory(String env_proper
} catch (Exception e) {
throw new AutomationFrameworkException("Spring context initialization exception.", e);
}
System.out.println("Report title:\t\t" + System.getProperty("org.uncommons.reportng.title", "Cybercat sample"));
System.out.println("================================================================================");

}
return automationMain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ public void initXmlRepository() throws PageModelException {
*
* @throws PageModelException
*/
public static void initWorkDirectories(String basicDirPath) throws PageModelException {
public static String initWorkDirectories(String basicDirPath) throws PageModelException {

// set basic directory to store artifacts
WorkFolder.initWorkFolders(basicDirPath);
String baseDir = WorkFolder.initWorkFolders(basicDirPath);

WorkFolder[] folders = WorkFolder.values();
for (int i = 0; i < folders.length; i++) {
Expand All @@ -143,6 +143,7 @@ public static void initWorkDirectories(String basicDirPath) throws PageModelExce
throw new PageModelException("Model initialization exception.", e);
}
}
return baseDir;
}

public EventManager getEventManager() {
Expand Down Expand Up @@ -202,6 +203,7 @@ private Browser getLocalBrowser(Browsers browserType) throws PageObjectException
try {
browser = (Browser) context.getBean(browserType.name());
} catch (Exception e) {
e.printStackTrace();
log.error(browser.toString() + " browser is unsupported by your system.");
throw new PageObjectException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,13 @@
*/
package org.cybercat.automation.test;

import java.lang.reflect.Constructor;

import org.apache.log4j.Logger;
import org.cybercat.automation.AutomationFrameworkException;
import org.cybercat.automation.annotations.AnnotationBuilder;
import org.cybercat.automation.core.TestStepAspect;
import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;

/**
* @author Ubegun
*
*/
public abstract class AbstractFeature implements IVersionControl, IFeature{

private static Logger log = Logger.getLogger(AbstractFeature.class);

/**
* This is the only constructor available. It will be called to create your feature.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ public static long genGuid() {
return System.currentTimeMillis() * 10000 + (counter++);
}

/**
* This method generates positive random number
*/
public static int generateNumber(int ind) {
if(ind < 1)
return 0;
int index = rand.nextInt(ind) + 1;
log.info("Random value is " + index);
return index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public class WorkFolder {
public static final WorkFolder Report_Folder = new WorkFolder(Home, Paths.get("Report", "html"));
public static final WorkFolder Extensions_Relative = new WorkFolder(Home, Paths.get("extensions"));

private static Path BASIC_FOLDER = Paths.get("C:", "TEMP");
//Legacy
private static Path BASIC_FOLDER = Paths.get(System.getProperty("user.home"));

private Path path;

Expand All @@ -45,9 +46,10 @@ public class WorkFolder {
*
* @param basicFolderPath
*/
public static void initWorkFolders(String basicFolderPath) {
public static String initWorkFolders(String basicFolderPath) {
if (basicFolderPath != null)
BASIC_FOLDER = Paths.get(basicFolderPath);
return BASIC_FOLDER.toString();
}

private WorkFolder(Path... paths) {
Expand Down

0 comments on commit b1dde77

Please sign in to comment.