Cypress with TypeScript Project setup step by step. How to build cypress project in typescript?

Опубликовано: 29 Сентябрь 2024
на канале: Codenbox AutomationLab
7,348
58

#cypress #typescript #cypressInTypescript
+Cypress with TypeScript project step by step?
+How to build cypress project in typescript?

▬▬▬▬▬▬ In this Video ▶️ ▬▬▬▬▬▬
Prerequisites:
1. Install any IDE, eg: VS Code
2. Support for JavaScript and TypeScript added to VS Code
3. Install Node JS & verify:
node -v
npm -v

Project setup step by step:
1. Create an empty folder for a new Project
2. Open the project folder in VS Code
3. Run commands: npm init -y
npm install cypress
npm install typescript
4. Initialize a new tsconfig.json file using command: npx tsc --init --types cypress --lib dom,es6
Note:this ensure that types for cypress are accessible by typescript. These types depend on dom & es6, so we pass them as lib option to typescript.
5. Open TestRunner using command: npx cypress open

▬▬▬▬▬▬ Useful Links 🛠 ▬▬▬▬▬▬
Blog ► http://codenboxautomationlab.com/​​​
GitHub Repo ► https://github.com/codenbox​​
TypeScript Site ► https://www.typescriptlang.org/


▬▬▬▬▬▬ Connect with us 👋 ▬▬▬▬▬▬
~~~Subscribe to this channel, and press bell icon to get all updated videos on Selenium and Cypress Automation:
   / codenboxautomationlab  

~~~ Follow us on Facebook & Twitter to get more updates:
  / ​​​