This is a tool written in python that automatically alters the json files and index.js such that a vue project created using vue CLI can use cypress and cucumber with cypress-cucumber-preprocessor without the user having to do it manually. I did this in my free time as I realized that such modifications are simple and should be automated instead of having to do it manually every time a new vue project is created.
This tool can only be used after the following requirements have been satisfied:
- npm package has to be installed. (Windows users can use nvm to install npm)
- vue cli has to be installed. (can be installed with :
npm install -g @vue/cli
)
- launch the command line interface on windows or linux and navigate to where you want your vue 3 project to be.
- write in the following command to create the vue project:
vue create <your project's name>
and wait for it to finish.(*) - copy and paste the python file from this repository inside the folder of your project. (**)
- run the python script using the command "python main.py"
(*) the naming constraint on vue projects is that no capital letters are allowed.
(**) The Python scipt has to be on the same directory level as the folders "tests" and "src"
You can check if you followed the steps correctly by running the following command in cmd inside the project's folder: npm run test:e2e
When that command runs successfully, you will see cypress UI with a single feature named "featureFileTest"
If you click on it, the test should run and you should see the following:
Now you can start a new vue project with cypress and cypress-cucumber-preprocessor without all the hassle of setting up the dependencies! it's plug and play;)
cypress-cucumber-preprocessor: https://github.com/TheBrainFamily/cypress-cucumber-preprocessor#step-definitions-creation
npm setup: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
behaviour-driven development (BDD): https://cucumber.io/docs/bdd/