admin管理员组文章数量:1392007
I am trying to install cypress on an empty project. However, cypress is not installed in the package.js file and cypress is not included on the project. How can I make it work? I cannot install cypress as part of the development project, so i am trying to create a separate test automation project with cypress.
I am trying to install cypress on an empty project. However, cypress is not installed in the package.js file and cypress is not included on the project. How can I make it work? I cannot install cypress as part of the development project, so i am trying to create a separate test automation project with cypress.
Share Improve this question asked Jan 13, 2021 at 7:52 Eva VasEva Vas 691 silver badge3 bronze badges 2- hi can you share screenshot of it if there is any error ? also try this tutorial as well youtube./watch?v=dArfrRnyp8A – Zubair Saif Commented Jan 13, 2021 at 9:06
- Have you read docs.cypress.io/guides/getting-started/…? – Jonah Commented Jan 13, 2021 at 10:52
3 Answers
Reset to default 4Steps to install cypress:
Step 1: Create your project folder, go inside the folder from the terminal using cd folder_path/folder_name
and run npm init
. This will create your package.json
file inside your project folder. You can do this in a sperate project or create some folder in your development project and do it there as well.
Step 2: Now, Run the mand npm install cypress --save-dev
. This will add the cypress as a dev dependency inside your package.json
file. Once you have successfully installed this, you should see one more file package-lock.json
and an folder node_modules
being created
Step 3: Run the mand node_modules/.bin/cypress open
or node_modules/.bin/cypress run
to run cypress.
You need to add --save or --save-dev to save it to package.json file. eg: npm install cypress --save
. https://docs.npmjs./cli/v6/mands/npm-install
Normally you install Cypress into your dev project, but I see you can't do that.
Go to https://www.cypress.io
, middle of the page is Download now.
After downloading, unzip to a folder, open bash or cmd prompt in that folder and type Cypress.
You get some warnings about installing into your project being preferred, but it works fine.
There's a To get started... box on the runner. Choose the same folder, and Cypress will set up the testing folder structure
/cypress
/integration
/examples -- lots of sample tests here
/support
/plugins
/fixtures
etc
本文标签: javascriptCypressinstall it on empty projectStack Overflow
版权声明:本文标题:javascript - Cypress - install it on empty project - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744762084a2623812.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论