This is a test automation framework built using Cypress, Cucumber and JavaScript. Cypress is a Node.js library for automating web browsers, Cucumber is a tool for running automated tests written in plain language, and JavaScript that compiles to plain script.
- Visual Studio Code installed on your machine
- Node.js and npm installed on your machine
- Chrome or Chromium browser installed on your machine
- Clone the repository
- Install dependencies by running
npm install - In Visual Studio Code add
Cucumbervia the Extensions tab - Go to
Extensions Settingsby clicking on the settings wheel in theCucumberextension - Click on
Edit in settings.jsonand paste the code block, to auto search for step-definitions within features
"cucumber.features": [
"src/cucumber/features/*.feature",
"src/cucumber/features/**/*.feature"
],
"cucumber.glue": [
"src/cucumber/step-definitions/*.js",
"src/cucumber/step-definitions/**/*js"
],
npm run test: Runs tests locally using based on the feature files infeaturesfoldernpm run lint: Checks for linting issues in the source code using eslintnpm run format-check: Checks for formatting issues in the source code using prettier configurationnpm run format: Formats the source code using prettier
The folder structure for this framework is as follows:
src: Contains all the source files of the framework.features: Contains all the*.featurefiles that define the behavior of the system under test.step-definitions: Contains all the step definition classes that define the behavior of each step in the feature files.
.gitignore: Specifies files and directories that should be ignored by Git.cucumber.js: Contains cucumber-js configuration like reporting, format and execution type.package.json: Contains metadata and dependencies for the project.prettierrc.json: Contains prettier configuration settingsREADME.md: This file, which contains documentation and instructions for using the test framework.
If you would like to contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature) - Make your changes
- Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature/your-feature) - Create a new Pull Request