Repository with examples of automation using selenium + cucumber + junit in java
Selenium is a portable software-testing framework for web applications. Selenium provides a playback tool for authoring tests without the need to learn a test scripting language.
Índice
README
.
environment variables and bash_profile
-
Mac:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
-
Windows: https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
-
Mac:
export PATH=/opt/apache-maven-3.5.3/bin:$PATH
-
Windows: https://www.mkyong.com/maven/how-to-install-maven-in-windows/
Clone
-
Clone this repo to your local machine using
https://github.com/uLucasFraga/selenium_java_for_studies.git
-
Install all dependencies (pom.xml)
mvn install
Tips
- Use pom.xml to install the project dependencies
run all tests with maven
$ mvn clean test
run all tests with cucumber
$ mvn clean -Dtest=CucumberRunnerTest test
run all tests choosing browser and operational system (ex: Chrome for Linux)
$ mvn clean test -Dbrowsers=CHROME_LINUX
run all tests with cucumber and a tag (ex: tag @example)
$ mvn test -DCucumber.options="--tags '@example'"
run all tests with IntelliJ (or another IDE)
Right click on class: src.test.java.br.com.studies/runner/CucumberRunnerTest > Run 'CucumberRunnerTest'
- file example
.feature
#language: en
@example
Feature: Access github
As a QA
I want to learn how to use selenium
To be able to automate applications like the github website
Scenario: Validate access on github website
Given he accesses the page
Then he checks the text on the initial page: "Why GitHub?"
run all tests and to generate an allure report
$ mvn allure:serve
-
Twitter at
@ulucasfraga
-
Facebook at
Facebook: Lucas Fraga
-
Linkedin at
Linkedin: Lucas Fraga
-
E-mail:
lucass.fragaa@gmail.com
-
Skype:
live:lucass.fragaa
- MIT license
- Copyright 2018 © Lucas Fraga.