-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cd97d14
Showing
17 changed files
with
4,000 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.DS_Store | ||
.idea/ | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
test-results.html | ||
test-results.html.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
#reports | ||
reports/*.html | ||
reports/*.json | ||
|
||
#build | ||
build | ||
dist/ | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## [1.1.0] - 2021-01-20 | ||
|
||
### Added | ||
|
||
- added @cucumber/pretty-formatter | ||
|
||
## [1.0.0] - 2021-01-18 | ||
|
||
### Added | ||
|
||
- use this template only with cucumber-js v7 | ||
- this template is migrated from [cucumber6-ts-starter](https://github.com/hdorgeval/cucumber6-ts-starter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Henri d'Orgeval | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# cucumber7-ts-starter | ||
|
||
[](https://travis-ci.org/hdorgeval/cucumber7-ts-starter) | ||
[](https://ci.appveyor.com/project/hdorgeval/cucumber7-ts-starter) | ||
|
||
Starter project to write and debug cucumber-js v7 features in TypeScript language | ||
|
||
## After cloning the repo | ||
|
||
- run the command `npm install`. | ||
|
||
## To execute the tests locally | ||
|
||
- run the command `npm test`. | ||
|
||
## To choose a reporter | ||
|
||
The last reporter/formatter found on the cucumber-js command-line wins: | ||
|
||
```text | ||
--format summary --format @cucumber/pretty-formatter --format cucumber-console-formatter | ||
``` | ||
|
||
In [package.json](package.json) file, modify the `cucumber` script to keep only your preferred formatter. | ||
|
||
## To debug a scenario in Visual Studio Code | ||
|
||
- tag the scenario with `@debug` | ||
- set the breakpoints in the typescript code | ||
- Start debugging | ||
|
||
## To run only specific scenarios | ||
|
||
- tag the scenario(s) with `@only` | ||
- run the command `npm run only`. | ||
|
||
## To ignore a scenario | ||
|
||
- tag the scenario with `@ignore` | ||
|
||
## To check for typescript, linting and gherkin errors | ||
|
||
- run the command `npm run build`. | ||
|
||
## To view the steps usage | ||
|
||
- run the command `npm run steps-usage`. | ||
|
||
## To view the html report of the last run | ||
|
||
- run the command `npm run report`. | ||
|
||
## To create a new step | ||
|
||
- first write the Given/When/Then sentence: | ||
|
||
```gherkin | ||
Given I push "foo" on "bar" | ||
``` | ||
|
||
- run the npm script: | ||
|
||
```sh | ||
npm run snippets | ||
``` | ||
|
||
- the script will report the missing step(s): you just need to copy and paste them in the step definitions file: | ||
|
||
```sh | ||
Given('I push {string} on {string}', async function (string, string2) { | ||
// Write code here that turns the phrase above into concrete actions | ||
return 'pending'; | ||
}); | ||
``` | ||
## To use a custom option on the CLI | ||
With cucumber-js v7, you cannot have anymore custom options on the CLI. | ||
This is a breaking change with cucumber-js v6. | ||
You must instead use environment variables. | ||
When running your tests localy, you can setup environment variables by customizing the file [set-environment-variables.ts](env/set-environment-variables.ts). | ||
When running on a CI, you should setup your jobs with the expected environment variables. | ||
## To use a custom World Objet | ||
- cutomize the given Custom World Object : [custom-world](world/custom-world.ts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const common = ` | ||
--require-module ts-node/register | ||
--require src/hooks/*.ts | ||
--require src/steps/**/*.steps.ts | ||
--format json:reports/cucumber-report.json | ||
--format summary | ||
--format progress-bar | ||
--format-options ${JSON.stringify({ snippetInterface: 'async-await' })} | ||
--publish-quiet | ||
`; | ||
|
||
// --format node_modules/cucumber-pretty | ||
|
||
const getWorldParams = () => { | ||
const params = { | ||
foo: 'bar', | ||
}; | ||
|
||
return `--world-parameters ${JSON.stringify({ params })}`; | ||
}; | ||
|
||
module.exports = { | ||
default: `${common} ${getWorldParams()}`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
process.env['--logLevel'] = 'error'; | ||
process.env['SimpleConsoleFormatter.printEnvelopes'] = 'false'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@foo | ||
Feature: Playwright docs | ||
|
||
Background: Navigation | ||
Given Go to the playwright docs website | ||
|
||
Scenario: Search documents | ||
When Enter search term "checkbox" | ||
Then Snapshot "checkbox search" | ||
|
Oops, something went wrong.