1. -cypress
  2. -fixtures //通常配合 cy.fixture()命令使用,主要用来存储测试用例的外部测试数据
  3. -intergration //存放测试用例
  4. -plugins //插件,测试文件执行前,Cypress会自动加载插件文件cypress/plugins/index.js
  5. -support // 存放可重用配置或者全局配置等
  6. -node_modules // 存放安装的包
  7. cypress.json // 定义的配置信息
  8. package.json

Fixture(测试夹具)

Test file(测试文件)

Plugin file(插件文件)

Support file(支持文件)

支持文件默认位于cypress/support/index.js中,即在文件里添加beforeEach()函数即可,例如实现每次执行运行前打印所有的环境变量信息。

  1. beforeEach(function(){
  2. cy.log(`当前测试系统环境变量为${JSON.stringify(Cypress.config())}`)
  3. })