一、使用命令
1、安装nodejs
2、输入npm -v 来测试是否安装npm
3、安装TestCafe npm install -g testcafe
4、运行TestCafe testcafe chrome test.js
二、使用IDE
1、下载并安装VS Code
2、新建工作区或文件夹
3、将TestCafe安装到项目目录 npm install --save-dev testcafe
4、运行--选中需要执行的js文件,右键选中TestCafe:Run Test(s) In Chrome
5、调试--在文件中,用例前输入debugger,设置断点,右键执行TestCafe:Run Test(s) In Chrome。如下如所示进入调试模式,点击第一个按键进入或F10
学习文档:
https://devexpress.github.io/testcafe/documentation/getting-started/
https://testcafe.devexpress.com/