|
1 | 1 | [](https://travis-ci.org/mindstix-labs/selenium-accelerator) |
2 | 2 |
|
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) |
5 | 16 |
|
| 17 | +# selenium-accelerator |
| 18 | +> Opinionated baseline to bootstrap selenium and cucumber based web application test automation projects |
6 | 19 |
|
7 | 20 | # Features |
8 | 21 | 1. Selenium + Cucumber based automation test examples for automationpractice.com |
9 | | - |
10 | 22 | 2. Demonstrates use of BDD style tests using cucumber |
11 | | - |
12 | 23 | 3. Demonstrates use of Selenium Grid via docker-compose (almost zero configuration) |
13 | | - |
14 | 24 | 4. Supports various modes - headless, grid, incognito, normal (default) |
15 | | - |
16 | 25 | 5. Support feature level parallelization. (Recommended not to use scenario level parallelization) |
17 | | - |
18 | 26 | 6. Utilities to deal with test data in properties, yaml format |
19 | | - |
20 | 27 | 7. Utilities to deal with driver, finders |
21 | | - |
22 | 28 | 8. Externalized selector configuration |
23 | | - |
24 | 29 | 9. Almost zero setup overhead - driver setup is automated via webdrivermanager |
25 | | - |
26 | 30 | 10. TODO support for BrowserStack, SauceLabs |
27 | | - |
28 | 31 | 11. TODO support to trigger emails from the tests |
29 | | - |
30 | 32 | 12. Fully functional Jenkinsfile that can be used to setup a Jenkins pipeline |
31 | | - |
32 | 33 | 13. Sample API tests using RestAssured |
33 | 34 |
|
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 | + |
| 80 | + |
| 81 | +And there are also feature specific results pages: |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +And useful information for failures: |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +If you have tags in your cucumber features you can see a tag overview: |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +And you can drill down into tag specific reports: |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 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) |
35 | 121 |
|
36 | | -# Licensed under MIT license |
| 122 | +# License |
| 123 | +> Licensed under [MIT license](https://github.com/mindstix-labs/selenium-accelerator/blob/master/LICENSE) |
0 commit comments