Merge pull request #13 from IT4Change/refactoring

refactor(other): update readmee and typescript
This commit is contained in:
mahula 2024-02-27 09:24:58 +01:00 committed by GitHub
commit 004225ed69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 35 additions and 5 deletions

View File

@ -18,7 +18,7 @@ jobs:
if: ${{ failure() && steps.e2e-run.conclusion == 'failure' }}
run: |
cd cypress/
node create-cucumber-html-report.js
npx tsx create-cucumber-html-report.ts
- name: Get PR number
if: ${{ failure() && steps.e2e-run.conclusion == 'failure' }}

View File

@ -10,7 +10,7 @@ IT4C Boilerplate for End-to-End Testing with Cypress utilizing
Building this project requires `nodejs` (`>= v20`) and `npm`.
## Commands
### Commands
| Command | Description |
|----------------------------|-----------------------------------------------|
@ -41,6 +41,15 @@ npm install
```
## Test Examples
To showcase Cucumber feature tests, a simple login example on [the-internet](https://the-internet.herokuapp.com/) is written in the feature file [Login.feature](./cypress/e2e/features/Login.feature).
The `baseUrl` is set in [cypress.config.ts](https://github.com/IT4Change/boilerplate-e2e-cypress-cucumber/blob/8306614812c1011642c75ae34057ca66784cae4f/cypress.config.ts#L25) and the test steps are defined in [this step definition file](./cypress/e2e/ssteps/login.ts).
Testing against the demo website [the-internet](https://the-internet.herokuapp.com/) was chosen from the test practice recommendations of https://www.davidmello.com/best-websites-for-practicing-test-automation/.
## How to use as part of a project
If you want to use this template as part of a larger project, e.g. in conjunction with a frontend also utilizing a boilerplate you cannot use the template mechanic provided by github for this repository.

View File

@ -1,7 +1,8 @@
import report from 'multiple-cucumber-html-reporter'
const reportTitle = 'DreamMall End-to-End Test Report'
const reportTitle = 'End-to-End Test Report'
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
report.generate({
jsonDir: './reports/json/',
reportPath: './reports/e2e_html_report',

View File

@ -1,7 +1,6 @@
Feature: Login
As a user
I want to sign in
I want to benoticed when sign in fails
Background:
Given The web browser is at the login page

20
package-lock.json generated
View File

@ -30,6 +30,7 @@
"multiple-cucumber-html-reporter": "^3.6.2",
"prettier": "^3.2.5",
"ts-loader": "^9.5.1",
"tsx": "^4.7.1",
"typescript": "^5.3.3",
"vuepress": "^2.0.0-rc.8",
"vuepress-plugin-search-pro": "^2.0.0-rc.26",
@ -14799,6 +14800,25 @@
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==",
"dev": true
},
"node_modules/tsx": {
"version": "4.7.1",
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz",
"integrity": "sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==",
"dev": true,
"dependencies": {
"esbuild": "~0.19.10",
"get-tsconfig": "^4.7.2"
},
"bin": {
"tsx": "dist/cli.mjs"
},
"engines": {
"node": ">=18.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
}
},
"node_modules/tty-browserify": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz",

View File

@ -54,6 +54,7 @@
"multiple-cucumber-html-reporter": "^3.6.2",
"prettier": "^3.2.5",
"ts-loader": "^9.5.1",
"tsx": "^4.7.1",
"typescript": "^5.3.3",
"vuepress": "^2.0.0-rc.8",
"vuepress-plugin-search-pro": "^2.0.0-rc.26",
@ -61,7 +62,7 @@
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
"stepDefinitions": "cypress/e2e/step_definitions/**/*.{js,ts}",
"stepDefinitions": "cypress/e2e/steps/**/*.{js,ts}",
"json": {
"enabled": true,
"output": "cypress/reports/json/cucumber-report.json"