Skip to content

Commit c3ae8ff

Browse files
author
pavelw
committed
initial version
0 parents  commit c3ae8ff

File tree

86 files changed

+2906
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2906
-0
lines changed

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
ehthumbs.db
33+
Icon?
34+
Thumbs.db
35+
36+
# IntelliJ #
37+
############
38+
*.iml
39+
*.ipr
40+
*.iws
41+
.idea
42+
43+
# Maven #
44+
#########
45+
*/target/*
46+
47+
# Other IDE's#
48+
##############
49+
\.classpath
50+
\.project
51+
\.settings
52+
\.dorsync
53+
/nbactions.xml

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Get Base Simple Webdriver
2+
=========================
3+
4+
simple example of selenium webdriver usage, with a bit of page object model
5+
6+
- you need Base CRM account
7+
- modify LOGIN_EMAIL and LOGIN_PASSWORD in /getbase-simple-webdriver/src/test/java/com/pawelv/basecrm/Tests/Selenium2ExampleST.java
8+
9+
this project uses Selenium-Maven-Template, its readme below:
10+
11+
12+
Selenium-Maven-Template
13+
=======================
14+
15+
A maven template for Selenium that has the latest dependencies so that you can just check out and start writing tests in five easy steps.
16+
17+
18+
1. Open a terminal window/command prompt
19+
2. Clone this project.
20+
3. CD into project directory
21+
4. mvn clean install -U -Pselenium-tests
22+
5. mvn verify -Pselenium-tests
23+
24+
All dependencies should now be downloaded and the example google cheese test will have run successfully (Assuming you have Firefox installed in the default location)
25+
26+
### What should I know?
27+
28+
- To run any unit tests that test your Selenium framework you just need to ensure that all unit test file names end, or start with "test" and they will be run by step 4.
29+
- The maven surefire plugin has been used to create a profile with the id "selenium-tests" that configures surefire to pick up any java files that ends with the text "ST". This means that as long as all of your selenium test file names end with ST.java they will get picked up and run when you perform step 5.
30+
31+
### Anything else?
32+
33+
Yes you can specify which browser to use by using one of the following switches:
34+
35+
- -Dbrowser=firefox
36+
- -Dbrowser=chrome
37+
- -Dbrowser=ie
38+
- -Dbrowser=opera
39+
- -Dbrowser=htmlunit
40+
- -Dbrowser=ghostdriver
41+
42+
You don't need to worry about downloading the IEDriverServer, or chromedriver binaries, this project will do that for you automatically.
43+
44+
Not got PhantomJS? Don't worry that will be automatically downloaded for you as well!

RepositoryMap.xml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2+
<root>
3+
<windows>
4+
<driver id="internetexplorer">
5+
<version id="2.39.0">
6+
<bitrate sixtyfourbit="true">
7+
<filelocation>https://selenium.googlecode.com/files/IEDriverServer_x64_2.39.0.zip</filelocation>
8+
<hash>c7ffa258de34d0934120b269a5af76e14a62d2d4</hash>
9+
<hashtype>sha1</hashtype>
10+
</bitrate>
11+
<bitrate thirtytwobit="true">
12+
<filelocation>https://selenium.googlecode.com/files/IEDriverServer_Win32_2.39.0.zip</filelocation>
13+
<hash>71b8fad1dadc72a1b7e45ade3f5c3f72d4f02def</hash>
14+
<hashtype>sha1</hashtype>
15+
</bitrate>
16+
</version>
17+
</driver>
18+
<driver id="googlechrome">
19+
<version id="2.8">
20+
<bitrate thirtytwobit="true" sixtyfourbit="true">
21+
<filelocation>http://chromedriver.storage.googleapis.com/2.8/chromedriver_win32.zip</filelocation>
22+
<hash>2e5ec89661e528bf69f717953896d85896ca64db</hash>
23+
<hashtype>sha1</hashtype>
24+
</bitrate>
25+
</version>
26+
</driver>
27+
<driver id="phantomjs">
28+
<version id="1.9.2">
29+
<bitrate thirtytwobit="true" sixtyfourbit="true">
30+
<filelocation>https://phantomjs.googlecode.com/files/phantomjs-1.9.2-windows.zip</filelocation>
31+
<hash>5fcfb32d9df9e603a3980139026bc33d516dae01</hash>
32+
<hashtype>sha1</hashtype>
33+
</bitrate>
34+
</version>
35+
</driver>
36+
</windows>
37+
<linux>
38+
<driver id="googlechrome">
39+
<version id="2.8">
40+
<bitrate sixtyfourbit="true">
41+
<filelocation>http://chromedriver.storage.googleapis.com/2.8/chromedriver_linux64.zip</filelocation>
42+
<hash>33112f4484145bd0bb8100bac7670d8c45793a4b</hash>
43+
<hashtype>sha1</hashtype>
44+
</bitrate>
45+
<bitrate thirtytwobit="true">
46+
<filelocation>http://chromedriver.storage.googleapis.com/2.8/chromedriver_linux32.zip</filelocation>
47+
<hash>f3743b625e5466a82fb0e433611190588fa07357</hash>
48+
<hashtype>sha1</hashtype>
49+
</bitrate>
50+
</version>
51+
</driver>
52+
<driver id="phantomjs">
53+
<version id="1.9.2">
54+
<bitrate sixtyfourbit="true">
55+
<filelocation>https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2
56+
</filelocation>
57+
<hash>c78c4037d98fa893e66fc516214499c58228d2f9</hash>
58+
<hashtype>sha1</hashtype>
59+
</bitrate>
60+
<bitrate thirtytwobit="true">
61+
<filelocation>https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-i686.tar.bz2
62+
</filelocation>
63+
<hash>9ead5dd275f79eaced61ce63dbeca58be4d7f090</hash>
64+
<hashtype>sha1</hashtype>
65+
</bitrate>
66+
</version>
67+
</driver>
68+
</linux>
69+
<osx>
70+
<driver id="googlechrome">
71+
<version id="2.8">
72+
<bitrate thirtytwobit="true" sixtyfourbit="true">
73+
<filelocation>http://chromedriver.storage.googleapis.com/2.8/chromedriver_mac32.zip</filelocation>
74+
<hash>b44d4666d00531f9edc5f1e89534a789fb4ec162</hash>
75+
<hashtype>sha1</hashtype>
76+
</bitrate>
77+
</version>
78+
</driver>
79+
<driver id="phantomjs">
80+
<version id="1.9.2">
81+
<bitrate thirtytwobit="true" sixtyfourbit="true">
82+
<filelocation>https://phantomjs.googlecode.com/files/phantomjs-1.9.2-macosx.zip</filelocation>
83+
<hash>36357dc95c0676fb4972420ad25455f49a8f3331</hash>
84+
<hashtype>sha1</hashtype>
85+
</bitrate>
86+
</version>
87+
</driver>
88+
</osx>
89+
</root>

pom.xml

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright (c) 2010-2013 Lazery Attack - http://www.lazeryattack.com ~ http://www.lazerycode.com
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
22+
<groupId>com.lazerycode.selenium</groupId>
23+
<artifactId>maven-template</artifactId>
24+
<version>1.0-SNAPSHOT</version>
25+
<modelVersion>4.0.0</modelVersion>
26+
27+
<name>A Simple Base CRM test, using Selenium Maven Template</name>
28+
<description>uses Maven Template For Selenium</description>
29+
<url>http://www.lazerycode.com</url>
30+
31+
<licenses>
32+
<license>
33+
<name>Apache 2</name>
34+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
35+
<distribution>repo</distribution>
36+
<comments>A business-friendly OSS license</comments>
37+
</license>
38+
</licenses>
39+
40+
<properties>
41+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42+
<standalone.binary.root.folder>${project.basedir}/selenium_standalone_binaries</standalone.binary.root.folder>
43+
<browser>firefox</browser>
44+
<threads>1</threads>
45+
</properties>
46+
47+
<dependencies>
48+
<dependency>
49+
<groupId>org.seleniumhq.selenium</groupId>
50+
<artifactId>selenium-server</artifactId>
51+
<version>2.39.0</version>
52+
<scope>test</scope>
53+
<exclusions>
54+
<exclusion>
55+
<groupId>com.opera</groupId>
56+
<artifactId>operadriver</artifactId>
57+
</exclusion>
58+
</exclusions>
59+
</dependency>
60+
<dependency>
61+
<groupId>com.opera</groupId>
62+
<artifactId>operadriver</artifactId>
63+
<version>1.5</version>
64+
<scope>test</scope>
65+
<exclusions>
66+
<exclusion>
67+
<groupId>org.seleniumhq.selenium</groupId>
68+
<artifactId>selenium-remote-driver</artifactId>
69+
</exclusion>
70+
</exclusions>
71+
</dependency>
72+
<dependency>
73+
<groupId>com.github.detro.ghostdriver</groupId>
74+
<artifactId>phantomjsdriver</artifactId>
75+
<version>1.1.0</version>
76+
<scope>test</scope>
77+
<exclusions>
78+
<exclusion>
79+
<groupId>org.seleniumhq.selenium</groupId>
80+
<artifactId>selenium-remote-driver</artifactId>
81+
</exclusion>
82+
</exclusions>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.testng</groupId>
86+
<artifactId>testng</artifactId>
87+
<version>6.8</version>
88+
<scope>test</scope>
89+
</dependency>
90+
</dependencies>
91+
92+
<build>
93+
<resources>
94+
<resource>
95+
<directory>src/main/resources</directory>
96+
<filtering>true</filtering>
97+
</resource>
98+
</resources>
99+
<pluginManagement>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-compiler-plugin</artifactId>
104+
<configuration>
105+
<source>1.6</source>
106+
<target>1.6</target>
107+
</configuration>
108+
<version>2.3.2</version>
109+
</plugin>
110+
</plugins>
111+
</pluginManagement>
112+
</build>
113+
114+
<profiles>
115+
<profile>
116+
<id>selenium-tests</id>
117+
<build>
118+
<plugins>
119+
<plugin>
120+
<groupId>com.lazerycode.selenium</groupId>
121+
<artifactId>driver-binary-downloader-maven-plugin</artifactId>
122+
<version>1.0.0</version>
123+
<configuration>
124+
<rootStandaloneServerDirectory>${standalone.binary.root.folder}</rootStandaloneServerDirectory>
125+
<downloadedZipFileDirectory>${project.basedir}/selenium_standalone_zips</downloadedZipFileDirectory>
126+
<customRepositoryMap>${project.basedir}/RepositoryMap.xml</customRepositoryMap>
127+
</configuration>
128+
<executions>
129+
<execution>
130+
<goals>
131+
<goal>selenium</goal>
132+
</goals>
133+
</execution>
134+
</executions>
135+
</plugin>
136+
<plugin>
137+
<groupId>org.apache.maven.plugins</groupId>
138+
<artifactId>maven-surefire-plugin</artifactId>
139+
<version>2.7.2</version>
140+
<configuration>
141+
<includes>
142+
<include>**/*ST.java</include>
143+
</includes>
144+
<parallel>methods</parallel>
145+
<threadCount>${threads}</threadCount>
146+
</configuration>
147+
</plugin>
148+
</plugins>
149+
</build>
150+
</profile>
151+
</profiles>
152+
153+
</project>
4.21 KB
Loading
4.21 KB
Loading
4.21 KB
Loading
4.21 KB
Loading
4.21 KB
Loading
4.21 KB
Loading
4.21 KB
Loading
4.21 KB
Loading
4.21 KB
Loading
4.19 KB
Loading
4.21 KB
Loading

src/main/resources/dev.properties

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
binaryRootFolder=${standalone.binary.root.folder}
2+
browser=${browser}
3+
threads=${threads}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.pawelv.basecrm;
2+
3+
public enum BrowserType {
4+
FIREFOX("firefox"),
5+
CHROME("chrome"),
6+
IE("ie"),
7+
SAFARI("safari"),
8+
OPERA("opera"),
9+
GHOSTDRIVER("ghostdriver"),
10+
REMOTE("remote"),
11+
HTMLUNIT("htmlunit");
12+
13+
private final String browser;
14+
15+
BrowserType(String browser) {
16+
this.browser = browser;
17+
}
18+
19+
public String getBrowser() {
20+
return browser;
21+
}
22+
}

0 commit comments

Comments
 (0)