diff --git a/cypress.json b/cypress.json index 830f4dd6..c69778d4 100644 --- a/cypress.json +++ b/cypress.json @@ -1,4 +1,5 @@ { "projectId": "websiteone-fe", - "baseUrl": "http://localhost:8082" + "baseUrl": "http://localhost:8082", + "ignoreTestFiles": "*_steps.js" } diff --git a/cypress/integration/common/web_steps.js b/cypress/integration/common/web_steps.js new file mode 100644 index 00000000..84c8762b --- /dev/null +++ b/cypress/integration/common/web_steps.js @@ -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 + '\'') + } +}) \ No newline at end of file diff --git a/cypress/integration/journey.feature b/cypress/integration/journey.feature new file mode 100644 index 00000000..951da434 --- /dev/null +++ b/cypress/integration/journey.feature @@ -0,0 +1,5 @@ +Feature: Journey test + + Scenario: Access the website + Given I am at the "Home" page + Then I should see "Scrums" \ No newline at end of file diff --git a/cypress/integration/journey_spec.js b/cypress/integration/journey_spec.js deleted file mode 100644 index 832f41a3..00000000 --- a/cypress/integration/journey_spec.js +++ /dev/null @@ -1,11 +0,0 @@ -describe('Journey test', function () { - describe('GIVEN I am in the home page', function () { - beforeEach(function () { - cy.visit('/') - }) - - it('THEN I should see the home page', function () { - cy.contains('Scrums') - }) - }) -}) \ No newline at end of file