📍 Creando nuestro primer Feature y ejecutándolo
Llegó el momento de crear nuestro primer Feature File y, para poder correrlo (sin éxito) por primera vez para validar que tenemos todo instalado y configurado correctamente, vamos a tener que completar una serie de pasos.
Acá les dejo las clases que creamos y modificamos y su código como referencia.
settings.gradle: Le sacamos que incluya "app" y dejamos solo
rootProject.name = 'SeleniumFreeRange'
TestRunner.java
package runner;
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources",
glue = "src/test/java/steps",
plugin = { "pretty", "html:target/cucumber-reports" })
public class TestRunner {}
FreeRangeNavigation.feature
Feature: Navigation bar
To see the subpages
Without logging in
I can click the navigation bar links
Scenario: I can access the subpages through the navigation bar
Given I navigate to www.freerangetesters.com
When I try to access the free sections through the navigation bar
Then I am redirected to the right page
Al final de build.gradle, cambiamos la tarea "test" de la siguiente manera.
tasks.named('test') {
systemProperty "cucumber.options", System.getProperty("cucumber.options")}