Skip to content

Commit

Permalink
refactor: 💡 Add example for bundled features files
Browse files Browse the repository at this point in the history
  • Loading branch information
laistomazz authored and laiscoolblue committed Aug 26, 2019
1 parent 02d7bca commit c50cfeb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ npm install
npm test
```

## Bundle feature files before running

```
npm run test:all
```

# Tags usage

### Tagging tests
Expand Down Expand Up @@ -39,7 +45,7 @@ Feature: The Facebook
@another-tag-to-include @some-other-tag
Scenario: Different kind of opening
Given I kinda open Facebook page
Then I am very happy
Then I am super happy
```

Expand Down
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"ignoreTestFiles": "*.js"
"ignoreTestFiles": "*.js",
"testFiles": "**/*.{feature,features}"
}
Empty file.
2 changes: 1 addition & 1 deletion cypress/integration/socialNetworks/Facebook.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Feature: The Facebook
@another-tag-to-include @some-other-tag
Scenario: Different kind of opening
Given I kinda open Facebook page
Then I am very happy
Then I am super happy
2 changes: 1 addition & 1 deletion cypress/integration/socialNetworks/Facebook/different.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Given(`I kinda open Facebook page`, () => {
});

// This is the same step that we have in news/Google/different.js, but you don't have to worry about collisions!
Then(`I am very happy`, () => {
Then(`I am super happy`, () => {
cy.title().should("include", "Facebook");
});
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Example of cypress with cucumber",
"main": "index.js",
"scripts": {
"test": "cypress run"
"test": "cypress run --spec \"**/*.feature\"",
"test:all": "cypress run --spec \"**/*.features\""
},
"repository": {
"type": "git",
Expand All @@ -23,7 +24,7 @@
"homepage": "https://github.com/TheBrainFamily/cypress-cucumber-example#readme",
"dependencies": {
"cypress": "^3.3.0",
"cypress-cucumber-preprocessor": "1.11.2"
"cypress-cucumber-preprocessor": "^1.14.3"
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
Expand Down

0 comments on commit c50cfeb

Please sign in to comment.