Skip to content

Commit 94c0712

Browse files
authored
Merge pull request #31 from mindstix-labs/master
Sync up from master
2 parents bd05315 + 28fbbe5 commit 94c0712

File tree

5 files changed

+111
-22
lines changed

5 files changed

+111
-22
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def notifyBuild(String buildStatus = 'STARTED') {
8484
// We need to first configure Jenkins with "Incoming Webhook" link of slack channel to send cucumber report.
8585
cucumberSlackSend channel: '#jenkins-notifications', json: 'build/reports/cucumberreport/cucumber.json'
8686

87-
// Step for sending a Jenkins build notification through mail
88-
mail (to: 'amit.mujawar@mindstix.com',
87+
// Step for sending a Jenkins build notification through mail. Please change the email id!
88+
mail (to: 'yourname@yourdomain.com',
8989
subject: subject,
9090
body: details);
9191
}

Jenkinsfile-minimal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def notifyBuild(String buildStatus = 'STARTED') {
6868
colorCode = '#FF0000'
6969
}
7070

71-
// Step for sending a Jenkins build notification through mail
72-
mail (to: 'amit.mujawar@mindstix.com',
71+
// Step for sending a Jenkins build notification through mail. Please update your email here.
72+
mail (to: 'youremail@yourdomain.com',
7373
subject: subject,
7474
body: details);
7575
}

Jenkinsfile-nogrid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def notifyBuild(String buildStatus = 'STARTED') {
8181
// We need to first configure Jenkins with "Incoming Webhook" link of slack channel to send cucumber report.
8282
cucumberSlackSend channel: '#jenkins-notifications', json: 'build/reports/cucumberreport/cucumber.json'
8383

84-
// Step for sending a Jenkins build notification through mail
85-
mail (to: 'amit.mujawar@mindstix.com',
84+
// Step for sending a Jenkins build notification through mail. Please change the email id!
85+
mail (to: 'yourname@yourdomain.com',
8686
subject: subject,
8787
body: details);
8888
}

README.md

Lines changed: 103 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,123 @@
11
[![Build Status](https://travis-ci.org/mindstix-labs/selenium-accelerator.svg?branch=master)](https://travis-ci.org/mindstix-labs/selenium-accelerator)
22

3-
# selenium-accelerator
4-
Opinionated baseline to bootstrap selenium and cucumber based web application test automation projects
3+
# Index
4+
1. [Introduction](#selenium-accelerator)
5+
2. [Features](#features)
6+
3. [Pre-requisites](#pre-requisites)
7+
4. [Dependencies](#dependencies)
8+
5. [Quick start](#quick-start)
9+
6. [IDE setup](#ide-setup)
10+
7. [Where do I see reports?](#where-do-i-see-reports)
11+
8. [Report Samples](#report-samples)
12+
9. [How to utilize Jenkins pipeline feature?](#how-to-utilize-jenkins-pipeline-feature)
13+
10. [How to utilize Selenium grid feature?](#how-to-utilize-selenium-grid-feature)
14+
11. [Developer guide](#developer-guide)
15+
12. [License](#license)
516

17+
# selenium-accelerator
18+
> Opinionated baseline to bootstrap selenium and cucumber based web application test automation projects
619
720
# Features
821
1. Selenium + Cucumber based automation test examples for automationpractice.com
9-
1022
2. Demonstrates use of BDD style tests using cucumber
11-
1223
3. Demonstrates use of Selenium Grid via docker-compose (almost zero configuration)
13-
1424
4. Supports various modes - headless, grid, incognito, normal (default)
15-
1625
5. Support feature level parallelization. (Recommended not to use scenario level parallelization)
17-
1826
6. Utilities to deal with test data in properties, yaml format
19-
2027
7. Utilities to deal with driver, finders
21-
2228
8. Externalized selector configuration
23-
2429
9. Almost zero setup overhead - driver setup is automated via webdrivermanager
25-
2630
10. TODO support for BrowserStack, SauceLabs
27-
2831
11. TODO support to trigger emails from the tests
29-
3032
12. Fully functional Jenkinsfile that can be used to setup a Jenkins pipeline
31-
3233
13. Sample API tests using RestAssured
3334

34-
For detailed instructions refer readme.txt
35+
# Pre-requisites
36+
> JDK 8
37+
38+
> docker, docker-compose - Optional for local development. Recommended for CI setup.
39+
40+
> Jenkins - 2.88+
41+
42+
# Dependencies
43+
1. Cucumber - 1.2.5
44+
2. Selenium - 3.8.1
45+
3. Courgette - 1.4.3
46+
4. WebDriverManager - 2.0.1
47+
5. RestAssured - 3.0.6
48+
6. SnakeYaml - 1.8
49+
7. docker - 17
50+
8. docker-compose - 1.17
51+
52+
# Quick start
53+
```sh
54+
$ git clone https://github.com/mindstix-labs/selenium-accelerator.git
55+
$ cd selenium-accelerator
56+
$ ./gradlew clean build
57+
```
58+
> Above steps will execute the tests in Chrome hitting www.automationpractice.com portal. It would take approximately 1 or 2 minutes to complete. At the end of this, you will see build failed. Do not panic! We have intentionally added one failing test as a sample.
59+
60+
# IDE setup
61+
```sh
62+
$ ./gradlew idea (for IDEA)
63+
$ ./gradlew eclipse (for Eclipse)
64+
```
65+
> Import the project in IDE after above steps generate required project setup files.
66+
67+
# Where do I see reports?
68+
> Open: `build/reports/cucumberreport/index/index.html`
69+
70+
> Alternatively, open courgette reports: `target/courgette-report/index.html`
71+
72+
> The best reports are generated once you setup Jenkins with cucumber-reports plugin. We are working on getting these reports generated even for local builds. See [Issue 19](https://github.com/mindstix-labs/selenium-accelerator/issues/29)
73+
74+
# Report Samples
75+
> Courtesy: https://github.com/damianszczepanik/cucumber-reporting
76+
77+
There is a feature overview page:
78+
79+
![feature overview page|50x50](https://github.com/damianszczepanik/cucumber-reporting/raw/master/.README/feature-overview.png)
80+
81+
And there are also feature specific results pages:
82+
83+
![feature specific page passing|50%](https://github.com/damianszczepanik/cucumber-reporting/raw/master/.README/feature-passed.png)
84+
85+
And useful information for failures:
86+
87+
![feature specific page passing|50%](https://github.com/damianszczepanik/cucumber-reporting/raw/master/.README/feature-failed.png)
88+
89+
If you have tags in your cucumber features you can see a tag overview:
90+
91+
![Tag overview](https://github.com/damianszczepanik/cucumber-reporting/raw/master/.README/tag-overview.png)
92+
93+
And you can drill down into tag specific reports:
94+
95+
![Tag report](https://github.com/damianszczepanik/cucumber-reporting/raw/master/.README/tag-report.png)
96+
97+
![Trends report](https://github.com/damianszczepanik/cucumber-reporting/raw/master/.README/trends.png)
98+
99+
# How to utilize Jenkins pipeline feature?
100+
1. Setup Jenkins 2.88+. Refer https://jenkins.io/doc/pipeline/tour/getting-started/
101+
2. Install *cucumber-reporting* plugin by going to *Manage Jenkins -> Manage Plugins -> Available* -> Search for *cucumber-reporting*. Select the *cucumber-reporting* plugin. Click on Install (without restart works just fine)
102+
3. Install *Blue Ocean* plugin in similar way as above. Things will be much more beautiful this way!
103+
4. Create a new pipeline job. Name it properly. Go to Pipeline section. Select pipeline script from SCM. Give the github URL. Add credentials using Add new or select existing.
104+
5. Branches to build: keep default - **master**.
105+
6. Script path: **Jenkinsfile-minimal** (good to start with, later you could try Jenkinsfile that is fully featured with docker-compose based selenium grid)
106+
7. Save.
107+
8. Go to Job page. Build the job. Keep default parameters if asked.
108+
9. Once the job is complete, go to the specific build page. You would see **Cucumber reports** menu. Click to see report.
109+
10. For email triggers to work from Jenkins, you will need to change the target email address in Script (Jenkinsfile-minimal or whichever you pick in Script path above).
110+
111+
> Too much just to get build run on Jenkins? We are working on simplifying it for you! See [Issue 30](https://github.com/mindstix-labs/selenium-accelerator/issues/30)
112+
113+
# How to utilize Selenium grid feature?
114+
1. Install docker using: https://docs.docker.com/engine/installation/#server
115+
2. Install docker-compose using: https://docs.docker.com/compose/install/
116+
3. Once you have above installed, you can go ahead and setup Jenkins pipeline with grid capabilities (Jenkinsfile).
117+
4. For reference on commands fired from Jenkins pipeline, refer to docker-compose commands in Jenkinsfile.
118+
119+
# Developer Guide
120+
> Refer [readme.txt](https://github.com/mindstix-labs/selenium-accelerator/blob/master/readme.txt)
35121
36-
# Licensed under MIT license
122+
# License
123+
> Licensed under [MIT license](https://github.com/mindstix-labs/selenium-accelerator/blob/master/LICENSE)

readme.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Instructions to setup docker, docker-compose are -
55
https://docs.docker.com/engine/installation/#server
66
https://docs.docker.com/compose/install/
7+
- Jenkins (2.88+) - See instructions here - https://jenkins.io/doc/pipeline/tour/getting-started/
78

89
------------------------Project Setup --------------------------------------------------
910

@@ -76,6 +77,7 @@
7677

7778
7. CI
7879
Jenkinsfile is used to setup pipeline jobs on CI server.
80+
Jenkinsfile-minimal : Uses gradle based trigger with minimal features - useful in developer's local environment.
7981
Jenkinsfile : Uses gradle based trigger which also takes care of grid setup/teardown.
8082
Jenkinsfile-nogrid : Uses gradle based trigger. Does not teardown grid. But starts it if down.
8183
The above files serve as ready references for basic steps, notifications.

0 commit comments

Comments
 (0)