Skip to content

Commit ecf164d

Browse files
author
christopher.mbaike
committed
Added git ignore file
1 parent 01cc4f7 commit ecf164d

File tree

14 files changed

+687
-0
lines changed

14 files changed

+687
-0
lines changed

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
23+
# Logs and databases #
24+
######################
25+
*.log
26+
*.sql
27+
*.sqlite
28+
29+
# OS generated files #
30+
######################
31+
.DS_Store
32+
.DS_Store?
33+
._*
34+
.Spotlight-V100
35+
.Trashes
36+
ehthumbs.db
37+
Thumbs.db
38+
39+
# IntelliJ #
40+
############
41+
*.iml
42+
*.ipr
43+
*.iws
44+
.idea
45+
46+
# Maven #
47+
#########
48+
**/target/*
49+
50+
# Other IDE's#
51+
##############
52+
\.classpath
53+
\.project
54+
\.settings
55+
\.dorsync
56+
/nbactions.xml
57+
58+
# Binary Downloads #
59+
####################
60+
**/selenium_standalone_binaries/
61+
**/selenium_standalone_zips/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# BDDWebDriverFramework

pom.xml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.techboy.selenium</groupId>
8+
<artifactId>com.techboy.selenium</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
14+
<selenium.version>2.45.0</selenium.version>
15+
<spring.framework.version>4.2.3.RELEASE</spring.framework.version>
16+
<browser>firefox</browser>
17+
<browser>chrome</browser>
18+
<threads>1</threads>
19+
<remote>false</remote>
20+
<seleniumGridURL/>
21+
<platform/>
22+
<browserVersion/>
23+
<proxyEnabled>false</proxyEnabled>
24+
<proxyHost/>
25+
<proxyPort/>
26+
<maven.compiler.source>1.8</maven.compiler.source>
27+
<maven.compiler.target>1.8</maven.compiler.target>
28+
<overwrite.binaries>true</overwrite.binaries>
29+
<junit.version>4.12</junit.version>
30+
</properties>
31+
32+
<dependencies>
33+
<dependency>
34+
<groupId>org.seleniumhq.selenium</groupId>
35+
<artifactId>selenium-java</artifactId>
36+
<version>${selenium.version}</version>
37+
<scope>test</scope>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>org.springframework</groupId>
42+
<artifactId>spring-context</artifactId>
43+
<version>${spring.framework.version}</version>
44+
<scope>test</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.slf4j</groupId>
48+
<artifactId>slf4j-log4j12</artifactId>
49+
<version>1.7.12</version>
50+
<scope>test</scope>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.slf4j</groupId>
54+
<artifactId>slf4j-api</artifactId>
55+
<version>1.7.7</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.springframework</groupId>
59+
<artifactId>spring-test</artifactId>
60+
<version>${spring.framework.version}</version>
61+
<scope>test</scope>
62+
</dependency>
63+
<dependency>
64+
<groupId>javax.inject</groupId>
65+
<artifactId>javax.inject</artifactId>
66+
<version>1</version>
67+
<scope>test</scope>
68+
</dependency>
69+
<dependency>
70+
<groupId>junit</groupId>
71+
<artifactId>junit</artifactId>
72+
<version>${junit.version}</version>
73+
</dependency>
74+
</dependencies>
75+
76+
<profiles>
77+
<profile>
78+
<id>standard</id>
79+
<activation>
80+
<activeByDefault>true</activeByDefault>
81+
</activation>
82+
<build>
83+
<plugins>
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-compiler-plugin</artifactId>
87+
<configuration>
88+
<source>${maven.compiler.source}</source>
89+
<target>${maven.compiler.target}</target>
90+
</configuration>
91+
<version>2.3.2</version>
92+
</plugin>
93+
<plugin>
94+
<groupId>com.lazerycode.selenium</groupId>
95+
<artifactId>driver-binary-downloader-maven-plugin</artifactId>
96+
<version>1.0.7</version>
97+
<configuration>
98+
<rootStandaloneServerDirectory>${standalone.binary.root.folder}</rootStandaloneServerDirectory>
99+
<downloadedZipFileDirectory>${project.basedir}/src/test/resources/selenium_standalone_zips</downloadedZipFileDirectory>
100+
<customRepositoryMap>${project.basedir}/src/test/resources/RepositoryMap.xml</customRepositoryMap>
101+
<overwriteFilesThatExist>${overwrite.binaries}</overwriteFilesThatExist>
102+
</configuration>
103+
<executions>
104+
<execution>
105+
<goals>
106+
<goal>selenium</goal>
107+
</goals>
108+
</execution>
109+
</executions>
110+
</plugin>
111+
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-failsafe-plugin</artifactId>
115+
<version>2.18.1</version>
116+
<configuration>
117+
<parallel>methods</parallel>
118+
<threadCount>${threads}</threadCount>
119+
<systemPropertyVariables>
120+
<browser>${browser}</browser>
121+
<screenshotDirectory>${project.build.directory}/screenshots</screenshotDirectory>
122+
<remoteDriver>${remote}</remoteDriver>
123+
<gridURL>${seleniumGridURL}</gridURL>
124+
<desiredPlatform>${platform}</desiredPlatform>
125+
<desiredBrowserVersion>${browserVersion}</desiredBrowserVersion>
126+
<proxyEnabled>${proxyEnabled}</proxyEnabled>
127+
<proxyHost>${proxyHost}</proxyHost>
128+
<proxyPort>${proxyPort}</proxyPort>
129+
<!--Set properties passed in by the driver binary downloader-->
130+
<phantomjs.binary.path>${phantomjs.binary.path}</phantomjs.binary.path>
131+
<webdriver.chrome.driver>${webdriver.chrome.driver}</webdriver.chrome.driver>
132+
<webdriver.ie.driver>${webdriver.ie.driver}</webdriver.ie.driver>
133+
<webdriver.opera.driver>${webdriver.opera.driver}</webdriver.opera.driver>
134+
</systemPropertyVariables>
135+
</configuration>
136+
<executions>
137+
<execution>
138+
<goals>
139+
<goal>integration-test</goal>
140+
<goal>verify</goal>
141+
</goals>
142+
</execution>
143+
</executions>
144+
</plugin>
145+
</plugins>
146+
</build>
147+
</profile>
148+
</profiles>
149+
150+
151+
</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.techboy.selenium.beanconfig;
2+
3+
import org.springframework.context.annotation.Condition;
4+
import org.springframework.context.annotation.ConditionContext;
5+
import org.springframework.core.type.AnnotatedTypeMetadata;
6+
7+
/**
8+
* Created by christopher on 01/12/15.
9+
*/
10+
public class BeanCondition {
11+
12+
public static class FirefoxCondition implements Condition{
13+
private final String browser="";
14+
@Override
15+
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
16+
return browser.contentEquals("firefox")||browser.contentEquals("");
17+
}
18+
19+
}
20+
public static class ChromeCondition implements Condition{
21+
private final String browser = "chrome";
22+
23+
@Override
24+
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
25+
return browser.contentEquals("chrome");
26+
}
27+
28+
}
29+
30+
public static class IECondition implements Condition{
31+
private final String browser = "IE";
32+
33+
@Override
34+
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
35+
return browser.contentEquals("IE");
36+
}
37+
38+
}
39+
40+
41+
42+
43+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package com.techboy.selenium.beanconfig;
2+
3+
import com.techboy.selenium.browserdriver.BrowserDriverExtended;
4+
import com.techboy.selenium.config.BrowserCapabilities;
5+
import com.techboy.selenium.config.BrowserThread;
6+
import org.openqa.selenium.Proxy;
7+
import org.springframework.context.annotation.Bean;
8+
import org.springframework.context.annotation.ComponentScan;
9+
import org.springframework.context.annotation.Conditional;
10+
import org.springframework.context.annotation.Configuration;
11+
12+
import static org.openqa.selenium.Proxy.ProxyType.MANUAL;
13+
14+
/**
15+
* Created by christopher on 01/12/2015.
16+
*/
17+
18+
@ComponentScan(basePackageClasses = {Beans.class})
19+
@Configuration
20+
public class Beans {
21+
22+
private final boolean proxyEnabled = Boolean.getBoolean("proxyEnabled");
23+
private final String proxyHostname = System.getProperty("proxyHost");
24+
private final Integer proxyPort = Integer.getInteger("proxyPort");
25+
private final String proxyDetails = String.format("%s:%d", proxyHostname, proxyPort);
26+
27+
28+
29+
@Bean
30+
public Proxy proxy() {
31+
Proxy proxy = null;
32+
if (proxyEnabled) {
33+
proxy = new Proxy();
34+
proxy.setProxyType(MANUAL);
35+
proxy.setHttpProxy(proxyDetails);
36+
proxy.setSslProxy(proxyDetails);
37+
}
38+
return new Proxy();
39+
}
40+
@Bean
41+
@Conditional(BeanCondition.FirefoxCondition.class)
42+
public BrowserDriverExtended.FirefoxDriverExtended firefox(){
43+
return new BrowserDriverExtended.FirefoxDriverExtended(BrowserCapabilities.newInstance().getFirefoxCapabilities());
44+
}
45+
46+
47+
@Bean
48+
@Conditional(BeanCondition.ChromeCondition.class)
49+
public BrowserDriverExtended.ChromeDriverExtended chrome(){
50+
return new BrowserDriverExtended.ChromeDriverExtended(BrowserCapabilities.newInstance().getChromeCapabilities());
51+
}
52+
/*
53+
@Bean
54+
public BrowserDriverExtended.InternetExplorerDriverExtended internetExplorer(){
55+
return new BrowserDriverExtended.InternetExplorerDriverExtended(BrowserCapabilities.newInstance().getIECapabilities(proxy()));
56+
}*/
57+
58+
59+
@Bean(name = "test")
60+
public BrowserThread browserThread(){
61+
return new BrowserThread();
62+
}
63+
64+
65+
66+
67+
68+
69+
70+
}

0 commit comments

Comments
 (0)