File tree Expand file tree Collapse file tree
src/main/java/org/cybercat/automation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 <dependency >
4949 <groupId >org.cybercat.autotest</groupId >
5050 <artifactId >cybercat-automation-core</artifactId >
51- <version >1.0-RC6 </version >
51+ <version >1.0-realise </version >
5252 </dependency >
5353 <dependency >
5454 <groupId >org.testng</groupId >
Original file line number Diff line number Diff line change 44 <modelVersion >4.0.0</modelVersion >
55 <groupId >org.cybercat.autotest</groupId >
66 <artifactId >cybercat-automation-core</artifactId >
7- <version >1.0-RC8 </version >
7+ <version >1.0-realise </version >
88 <url >https://github.com/ubegun/Cybercat</url >
99 <packaging >jar</packaging >
1010 <name >Webdriver Core for automation testing</name >
2121 <project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
2222 <automation .deps.output.folder>lib</automation .deps.output.folder>
2323 <automation .test.package.name>org.cybercat.automation</automation .test.package.name>
24- <selenium .version>2.37 .0</selenium .version>
24+ <selenium .version>2.39 .0</selenium .version>
2525 <testng .version>6.8.5</testng .version>
2626 <junit .version>4.10</junit .version>
2727 <springframework .version>3.1.1.RELEASE</springframework .version>
213213 <plugin >
214214 <groupId >com.github.github</groupId >
215215 <artifactId >site-maven-plugin</artifactId >
216- <version >0.8 </version >
216+ <version >0.9 </version >
217217 <configuration >
218218 <message >Maven artifacts for ${project.artifactId} ${project.version} </message >
219219 <!-- git commit message -->
Original file line number Diff line number Diff line change @@ -157,15 +157,12 @@ public final static synchronized AutomationMain getMainFactory(String env_proper
157157 System .out .println ("===============================Runtime properties===============================" );
158158 System .out .println ("environment propery file:\t " + propertyFileName );
159159 String basicArtifactsDir = System .getProperty ("config.basicArtifactsDir" );
160- System .out .println ("artifacts directory:\t " + basicArtifactsDir );
161- System .out .println ("Report title:\t \t "
162- + System .getProperty ("org.uncommons.reportng.title" , "Cybercat sample" ));
163- System .out .println ("================================================================================" );
164160 if (StringUtils .isEmpty (propertyFileName )) {
165161 System .setProperty ("config.properties" , env_properties );
166162 }
167163 try {
168- ConfigurationManager .initWorkDirectories (basicArtifactsDir );
164+ System .out .println ("artifacts directory:\t " + ConfigurationManager .initWorkDirectories (basicArtifactsDir ));
165+
169166 } catch (Exception e ) {
170167 throw new AutomationFrameworkException ("Model initialization exception." , e );
171168 }
@@ -176,6 +173,8 @@ public final static synchronized AutomationMain getMainFactory(String env_proper
176173 } catch (Exception e ) {
177174 throw new AutomationFrameworkException ("Spring context initialization exception." , e );
178175 }
176+ System .out .println ("Report title:\t \t " + System .getProperty ("org.uncommons.reportng.title" , "Cybercat sample" ));
177+ System .out .println ("================================================================================" );
179178
180179 }
181180 return automationMain ;
Original file line number Diff line number Diff line change @@ -130,10 +130,10 @@ public void initXmlRepository() throws PageModelException {
130130 *
131131 * @throws PageModelException
132132 */
133- public static void initWorkDirectories (String basicDirPath ) throws PageModelException {
133+ public static String initWorkDirectories (String basicDirPath ) throws PageModelException {
134134
135135 // set basic directory to store artifacts
136- WorkFolder .initWorkFolders (basicDirPath );
136+ String baseDir = WorkFolder .initWorkFolders (basicDirPath );
137137
138138 WorkFolder [] folders = WorkFolder .values ();
139139 for (int i = 0 ; i < folders .length ; i ++) {
@@ -143,6 +143,7 @@ public static void initWorkDirectories(String basicDirPath) throws PageModelExce
143143 throw new PageModelException ("Model initialization exception." , e );
144144 }
145145 }
146+ return baseDir ;
146147 }
147148
148149 public EventManager getEventManager () {
@@ -202,6 +203,7 @@ private Browser getLocalBrowser(Browsers browserType) throws PageObjectException
202203 try {
203204 browser = (Browser ) context .getBean (browserType .name ());
204205 } catch (Exception e ) {
206+ e .printStackTrace ();
205207 log .error (browser .toString () + " browser is unsupported by your system." );
206208 throw new PageObjectException (e );
207209 }
Original file line number Diff line number Diff line change 1414 */
1515package org .cybercat .automation .test ;
1616
17- import java .lang .reflect .Constructor ;
18-
19- import org .apache .log4j .Logger ;
20- import org .cybercat .automation .AutomationFrameworkException ;
21- import org .cybercat .automation .annotations .AnnotationBuilder ;
22- import org .cybercat .automation .core .TestStepAspect ;
23- import org .springframework .aop .aspectj .annotation .AspectJProxyFactory ;
2417
2518/**
2619 * @author Ubegun
2720 *
2821 */
2922public abstract class AbstractFeature implements IVersionControl , IFeature {
3023
31- private static Logger log = Logger .getLogger (AbstractFeature .class );
32-
3324 /**
3425 * This is the only constructor available. It will be called to create your feature.
3526 */
Original file line number Diff line number Diff line change @@ -122,7 +122,12 @@ public static long genGuid() {
122122 return System .currentTimeMillis () * 10000 + (counter ++);
123123 }
124124
125+ /**
126+ * This method generates positive random number
127+ */
125128 public static int generateNumber (int ind ) {
129+ if (ind < 1 )
130+ return 0 ;
126131 int index = rand .nextInt (ind ) + 1 ;
127132 log .info ("Random value is " + index );
128133 return index ;
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ public class WorkFolder {
3636 public static final WorkFolder Report_Folder = new WorkFolder (Home , Paths .get ("Report" , "html" ));
3737 public static final WorkFolder Extensions_Relative = new WorkFolder (Home , Paths .get ("extensions" ));
3838
39- private static Path BASIC_FOLDER = Paths .get ("C:" , "TEMP" );
39+ //Legacy
40+ private static Path BASIC_FOLDER = Paths .get (System .getProperty ("user.home" ));
4041
4142 private Path path ;
4243
@@ -45,9 +46,10 @@ public class WorkFolder {
4546 *
4647 * @param basicFolderPath
4748 */
48- public static void initWorkFolders (String basicFolderPath ) {
49+ public static String initWorkFolders (String basicFolderPath ) {
4950 if (basicFolderPath != null )
5051 BASIC_FOLDER = Paths .get (basicFolderPath );
52+ return BASIC_FOLDER .toString ();
5153 }
5254
5355 private WorkFolder (Path ... paths ) {
You can’t perform that action at this time.
0 commit comments