Skip to content

Commit

Permalink
test added, readme added
Browse files Browse the repository at this point in the history
  • Loading branch information
anthanh committed Oct 14, 2019
1 parent eddc755 commit 68e1c6e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
example-project/node_modules
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ This package integrates cucumber and testcafe in one single CLI configurable via

Also provides a set of generic step-definitions implemented with testcafe.

## Quick start
## Requisites

* [nodejs](https://nodejs.org/)
* [cucumber vscode autocomplete](https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete)

## Quick start

* Install with npm

Expand All @@ -18,10 +22,48 @@ Also provides a set of generic step-definitions implemented with testcafe.
yarn add -D cucumber-testcafe
```

* Bootstrap a cucumber-testcafe project
* Creates test folder estructure, with:
* Example Home page object from [`BasePO`](https://github.com/masmovil/cucumber-testcafe/blob/master/example-project/test/book/home.po.ts)
* Example page declaration in [`book`](https://github.com/masmovil/cucumber-testcafe/blob/master/example-project/test/book/index.ts)
* Example Home steps definition [`Home.sd`](https://github.com/masmovil/cucumber-testcafe/blob/master/example-project/test/steps/home.sd.ts)
* Creates [VSCode cucumber settings](https://github.com/masmovil/cucumber-testcafe/blob/master/example-project/.vscode/settings.json).
* Creates default [`cucumber.profiles.json`](https://github.com/masmovil/cucumber-testcafe/blob/master/example-project/cucumber.profiles.json) config file.

```
cucumber-testcafe init <folder> # ./test/ as default folder
```

* Runs cucumber-testcafe project

```
cucumber-testcafe run CUCUMBER_PROFILE=default # default as defacto profile name to run
```

* Show help

```
cucumber-testcafe --help
```


* Run this repo test

```
npm test
```

* [Example project with tests](https://github.com/masmovil/cucumber-testcafe/tree/master/example-project)

* [Example config by profiles](https://github.com/masmovil/cucumber-testcafe/blob/master/example-project/cucumber.profiles.json)

* [List of available step definitions](https://github.com/masmovil/cucumber-testcafe/blob/master/src/lib/steps/base.sd.ts)

* [Example VSCode config](https://github.com/masmovil/cucumber-testcafe/blob/master/example-project/.vscode/settings.json)


## More info

* https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/
* https://cucumber.io/docs/cucumber/cucumber-expressions/
* https://cucumber.io/docs/gherkin/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"clean": "rm -rf node_modules package-lock.json dist",
"postinstall": "npm run build",
"build": "npx tsc -p tsconfig.json",
"test": "cd example-project && npm run all && cd ..",
"lint": "npx prettier src/**/*.ts --write && npx tslint -c tslint.json 'src/**/*.ts'"
},
"repository": {
Expand Down

0 comments on commit 68e1c6e

Please sign in to comment.