Skip to content

Commit

Permalink
Merge pull request #129 from wvankuipers/feature/1.3.0
Browse files Browse the repository at this point in the history
Release 1.3.0
  • Loading branch information
wvankuipers authored Sep 11, 2017
2 parents 60e186f + 053c763 commit f45f656
Show file tree
Hide file tree
Showing 109 changed files with 3,356 additions and 3,401 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
presets: ['es2015']
"presets": ["es2015"]
}
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
engines:
eslint:
enabled: true
channel: "eslint-3"
channel: "eslint-4"

exclude_paths:
- "demo-app/"
Expand Down
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
notifications:
email: false
dist: trusty

language: node_js

cache: yarn

notifications:
email: false

node_js:
- '4'
- '5'
- '6'
- '7'
- '8'

env:
- CXX=g++-4.8
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [1.3.0] - T.B.D.
### Added
- More Node versions to Travis build
- [Forever](https://www.npmjs.com/package/forever) for managing the `http-server` process

### Changed
- Updated Chai, wdio-cucumber-framework & wdio-spec-reporter dependencies
- Updated codebase to match new Cucumber 2 syntax & functionalities
- Updated readme to reflect changes in the tags processing mechanism

### Fixed
- Syntax issue in `.babelrc`

### Removed
- No longer needed tagprocessor functionality


## [1.2.0] - 2017-07-12
### Added
- Rules:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ If you want to run only specific tests you can mark your features with tags. The
Feature: ...
```

To run only the tests with specific tag(s) use the `--tags=` parameter like so:
To run only the tests with specific tag(s) use the `--cucumberOpts.tagExpression=` parameter like so:

```sh
$ yarn run wdio -- --tags=@Tag,@AnotherTag
$ yarn run wdio -- --cucumberOpts.tagExpression=@Tag,@AnotherTag
```

You can add multiple tags separated by a comma
Expand All @@ -165,7 +165,7 @@ Scenario: ...

The predefined snippets allow you to do a lot of common things but you might need extra snippets which
are better aligned with your aims. To do so you will find all step definitions in `./src/steps`. They
are separated in `given`, `when` and `then`.
are separated in `given`, `when` and `then`.

You define your snippet using regular expressions. This is pretty powerful as it allows you to create complex
sentences with multiple options. Everything that's within `"([^"]*)?"` gets captured and appended to the
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"homepage": "https://github.com/webdriverio/cucumber-boilerplate",
"scripts": {
"clean": "read -p \"Are you sure you want to clean the project? [y/n] \" REPLY; if [[ $REPLY =~ ^[Yy]$ ]]; then rm -R .git .github demo-app test .codeclimate.yml .travis.yml jest.json wdio.BUILD.conf.js src/features/**; fi",
"local-webserver": "http-server ./demo-app -s",
"local-webserver": "forever start -s ./node_modules/.bin/http-server ./demo-app -s",
"test": "npm run test:validate && npm run test:unit && npm run test:features",
"test:features": "npm run local-webserver & (wdio wdio.BUILD.conf.js; wdio_ret=$?; kill $(lsof -t -i:8080); exit $wdio_ret)",
"test:features": "npm run local-webserver & (wdio wdio.BUILD.conf.js; wdio_ret=$?; forever stopall; exit $wdio_ret)",
"test:unit": "jest --config=jest.json",
"test:validate": "eslint 'src/**/*.js' 'test/**/*.js!(setup.js)'"
},
Expand All @@ -32,18 +32,19 @@
"dependencies": {
"babel-preset-es2015": "~6.24.0",
"babel-register": "~6.26.0",
"chai": "~4.1.0",
"chai": "~4.1.2",
"wdio-cucumber-framework": "~1.0.2",
"wdio-phantomjs-service": "~0.2.2",
"wdio-selenium-standalone-service": "~0.0.9",
"wdio-spec-reporter": "~0.1.0",
"wdio-spec-reporter": "~0.1.2",
"webdriverio": "4.7.1"
},
"devDependencies": {
"babel-polyfill": "~6.26.0",
"eslint": "~4.6.0",
"eslint-config-airbnb-base": "~12.0.0",
"eslint-plugin-import": "~2.7.0",
"forever": "~0.15.3",
"http-server": "~0.10.0",
"jest": "~21.0.0"
}
Expand Down
4 changes: 1 addition & 3 deletions src/features/pending.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ Feature: Pending scenario

Scenario: do somethimg
Given I open the site "/"
# And ...
# Then ...
# And ...
Then this will fail since this does not exist
49 changes: 26 additions & 23 deletions src/steps/given.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { defineSupportCode } from 'cucumber';

import checkContainsAnyText from '../support/check/checkContainsAnyText';
import checkIsEmpty from '../support/check/checkIsEmpty';
import checkContainsText from '../support/check/checkContainsText';
Expand All @@ -19,109 +21,110 @@ import isVisible from '../support/check/isVisible';
import openWebsite from '../support/action/openWebsite';
import resizeScreenSize from '../support/action/resizeScreenSize';

module.exports = function given() {
this.Given(

defineSupportCode(({ Given }) => {
Given(
/^I open the (url|site) "([^"]*)?"$/,
openWebsite
);

this.Given(
Given(
/^the element "([^"]*)?" is( not)* visible$/,
isVisible
);

this.Given(
Given(
/^the element "([^"]*)?" is( not)* enabled$/,
isEnabled
);

this.Given(
Given(
/^the element "([^"]*)?" is( not)* selected$/,
checkSelected
);

this.Given(
Given(
/^the checkbox "([^"]*)?" is( not)* checked$/,
checkSelected
);

this.Given(
Given(
/^there is (an|no) element "([^"]*)?" on the page$/,
checkElementExists
);

this.Given(
Given(
/^the title is( not)* "([^"]*)?"$/,
checkTitle
);

this.Given(
Given(
/^the element "([^"]*)?" contains( not)* the same text as element "([^"]*)?"$/,
compareText
);

this.Given(
Given(
/^the element "([^"]*)?"( not)* matches the text "([^"]*)?"$/,
checkEqualsText
);

this.Given(
Given(
/^the element "([^"]*)?"( not)* contains the text "([^"]*)?"$/,
checkContainsText
);

this.Given(
Given(
/^the element "([^"]*)?"( not)* contains any text$/,
checkContainsAnyText
);

this.Given(
Given(
/^the element "([^"]*)?" is( not)* empty$/,
checkIsEmpty
);

this.Given(
Given(
/^the page url is( not)* "([^"]*)?"$/,
checkUrl
);

this.Given(
Given(
/^the( css)* attribute "([^"]*)?" from element "([^"]*)?" is( not)* "([^"]*)?"$/,
checkProperty
);

this.Given(
Given(
/^the cookie "([^"]*)?" contains( not)* the value "([^"]*)?"$/,
checkCookieContent
);

this.Given(
Given(
/^the cookie "([^"]*)?" does( not)* exist$/,
checkCookieExists
);

this.Given(
Given(
/^the element "([^"]*)?" is( not)* ([\d]+)px (broad|tall)$/,
checkDimension
);

this.Given(
Given(
/^the element "([^"]*)?" is( not)* positioned at ([\d]+)px on the (x|y) axis$/,
checkOffset
);

this.Given(
Given(
/^I have a screen that is ([\d]+) by ([\d]+) pixels$/,
resizeScreenSize
);

this.Given(
Given(
/^I have closed all but the first (window|tab)$/,
closeAllButFirstTab
);

this.Given(
Given(
/^a (alertbox|confirmbox|prompt) is( not)* opened$/,
checkModal
);
};
});
Loading

0 comments on commit f45f656

Please sign in to comment.