Skip to content

Commit

Permalink
Convert js test into cucumber for cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopapereira committed Jan 16, 2019
1 parent afe187b commit 4982786
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"projectId": "websiteone-fe",
"baseUrl": "http://localhost:8082"
"baseUrl": "http://localhost:8082",
"ignoreTestFiles": "*_steps.js"
}
13 changes: 13 additions & 0 deletions cypress/integration/common/web_steps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Then, Given } from 'cypress-cucumber-preprocessor/steps'

Then(`I should see {string}`, (textToFind) => {
cy.contains(textToFind)
})

Given(`I am at the {string} page`, (pageName) => {
if(pageName === "Home") {
cy.visit('/')
} else {
cy.fail('unknown page \'' + pageName + '\'')
}
})
5 changes: 5 additions & 0 deletions cypress/integration/journey.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Journey test

Scenario: Access the website
Given I am at the "Home" page
Then I should see "Scrums"
11 changes: 0 additions & 11 deletions cypress/integration/journey_spec.js

This file was deleted.

0 comments on commit 4982786

Please sign in to comment.