English 中文(简体)
Cypress - Reports
  • 时间:2024-03-24 08:57:37

Cypress - Reports

Previous Page Next Page  

风暴与Mocha交火。 因此,可能为Mocha编写的任何报告也可以用“旋风”加以利用。 除此以外,还有其他第三方记者,如Junnit和团队精神。

Mochawesome Report

Mochaweous报告是“Cypress”中最重要的报告之一。

    页: 1


npm install mochawesome --save-dev

以下屏幕将登在你的电脑上:

Install Mochawesome

    安装 mo,指挥线如下:


npm install mocha --save-dev

以下屏幕将登在你的电脑上:

Install Mocha


npm install mochawesome-merge --save-dev

以下屏幕将登在你的电脑上:

Merge Mochawesome JSON Reports

在安装后,所有这些包裹都应反映在包件上。 json案。

将多份报告合并为一份报告,由以下指挥:


npm run combine-reports

Configurations in cypress.json file

In the cypress.json file, we can set the following configurations for the mochawesome reports −

    overwrite − If its value is set to false, there should not be any overwriting from the prior generated reports.

    报告应予保存。

    quiet − If its value is set to true, there should not be any Cypress related output. Only the mochawesome output has to be printed.

    html − If its value is set to false, there should not be any generation of html reports after execution.

    json——如果其价值被确定为真实,将产生一份载有执行细节的json档案。

Implementation in cypress.json

cy杂报告的执行情况。 json如下:


{
   "reporter": "mochawesome",
   "reporterOptions": {
      "reportDir": "cypress/results",
      "overwrite": false,
      "html": false,
      "json": true
   }
}

1. 为气旋风暴项目整合者的所有光谱编制一份报告,其指挥范围如下:


npx cypress run

进行特定试验,由以下指挥进行:


npx cypress run --spec "<path of spec file>"

在完成执行后,在“Cypress”项目内产生了 mo状报告夹,其中包含以html和json格式撰写的报告。

JSON Formats.

Right-cpck on the mochawesome.html report. 然后选择制版路,打开浏览器上铺路。

Mochawesome HTML

令人不安的报告在开篇时附有执行结果、期限、测试案例名称、测试步骤等细节。

在对屏幕左上角的icon(以上述图像为亮点)进行点击时,展示出更多的选择。

Mochawesome Report

我们可以得出不同的看法,选择过去、失败、等待、天空的测试案例,以及适用于试验的hoo。

JUnit Report

气旋风暴还提供了另外一种称为Junnit报告的报告。

安装JUSG报告包,指挥如下:


npm install cypress-junit-reporter --save-dev

以下屏幕将登在你的电脑上:

JUnit Report

Implementation in cypress.json

下面是《日元报告》的执行情况。 json -


{
   "reporter": "junit",
   "reporterOptions": {
      "mochaFile": "cypress/results/results.xml",
      "toConsole": true
   }
}

如果我们进行多次测试,并希望有一份单独光谱档案的独特报告,我们就必须在风暴中增加[hash]。 碎块中的卷宗参数。 json。

Implementation to avoid overriding report

下面是cy。 json, 避免在Cypress发表压倒一切的报告


{
   "reporter": "junit",
   "reporterOptions": {
      "mochaFile": "cypress/results/results-[hash].xml",
      "toConsole": true
   }
}

3. 为“旋风”项目集成夹中的所有光谱生成报告,由以下指挥:


npx cypress run --reporter junit

以下屏幕将登在你的电脑上:

Cypress Project

在完成执行后,结果夹在含有Xml格式报告的Cypress项目中产生。

teamcity Report

气旋风暴提供了另外一种称为团队精神报告的报告。

安装小组报告包,操作如下:


npm install cypress-teamcity-reporter --save-dev

以下屏幕将登在你的电脑上:

Teamcity Report

3. 为“旋风”项目集成夹中的所有光谱生成报告,由以下指挥:


npx cypress run --reporter teamcity

以下屏幕将登在你的电脑上:

Running Advertisements