Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/421.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在CMD中运行测试时,如何更改Cypress输出_Javascript_Reporting_Cypress - Fatal编程技术网

Javascript 在CMD中运行测试时,如何更改Cypress输出

Javascript 在CMD中运行测试时,如何更改Cypress输出,javascript,reporting,cypress,Javascript,Reporting,Cypress,我在詹金斯进行赛普拉斯测试。但是,我需要更改默认输出。我想要一个带有测试名称的表结构,另一列表示通过或失败状态 默认输出如下所示: (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 3.1.5

我在詹金斯进行赛普拉斯测试。但是,我需要更改默认输出。我想要一个带有测试名称的表结构,另一列表示通过或失败状态

默认输出如下所示:

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.1.5                                                                              │
  │ Browser:    Chrome 72                                                                          │
  │ Specs:      2 found (Login_With_User_Credentials.spec.js, tsconfig.json)                       │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running: Login_With_User_Credentials.spec.js...                                          (1 of 2) 



  1) Correct credentials login

  √ Incorrect credentials login (2082ms)

  1 passing (3m)
  1 failing

  1)  Correct credentials login:
     CypressError: Timed out retrying: Expected to find element: 'button#btnSearch', but never found it.
      at Object.cypressErr (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:65377:11)
      at Object.throwErr (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:65342:18)
      at Object.throwErrByPath (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:65369:17)
      at retry (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:58910:16)
      at http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:51018:18
      at tryCatcher (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:127298:23)
      at Promise._settlePromiseFromHandler (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125316:31)
      at Promise._settlePromise (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125373:18)
      at Promise._settlePromise0 (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125418:10)
      at Promise._settlePromises (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:125493:18)
      at Async._drainQueue (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:122222:16)
      at Async._drainQueues (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:122232:10)
      at Async.drainQueues (http://quicktest.aclessentials.com/__cypress/runner/cypress_runner.js:122106:14)




  (Results)

  ┌───────────────────────────────────────────────────┐
  │ Tests:        2                                   │
  │ Passing:      1                                   │
  │ Failing:      1                                   │
  │ Pending:      0                                   │
  │ Skipped:      0                                   │
  │ Screenshots:  1                                   │
  │ Video:        false                               │
  │ Duration:     2 minutes, 52 seconds               │
  │ Spec Ran:     Login_With_User_Credentials.spec.js │
  └───────────────────────────────────────────────────┘


  (Screenshots)

  - C:\cypress\screenshots\Login_With_User_Credentials.spec.js\Correct credentials login (failed).png (1920x969)


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running: tsconfig.json...                                                                (2 of 2) 


  0 passing (2ms)


  (Results)

  ┌─────────────────────────────┐
  │ Tests:        0             │
  │ Passing:      0             │
  │ Failing:      0             │
  │ Pending:      0             │
  │ Skipped:      0             │
  │ Screenshots:  0             │
  │ Video:        false         │
  │ Duration:     0 seconds     │
  │ Spec Ran:     tsconfig.json │
  └─────────────────────────────┘


====================================================================================================

  (Run Finished)


      Spec                                                Tests  Passing  Failing  Pending  Skipped 
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ × Login_With_User_Credentials.spec.js       02:52        2        1        1        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ √ tsconfig.json                               6ms        -        -        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    1 of 2 failed (50%)                         02:52        2        1        1        -        -  
我只希望输出的底部显示:

(Run Finished)


      Spec                                                Tests  Passing  Failing  Pending  Skipped 
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ × Login_With_User_Credentials.spec.js       02:52        2        1        1        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ √ tsconfig.json                               6ms        -        -        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    1 of 2 failed (50%)                         02:52        2        1        1        -        -  
是否有设置了格式的配置文件?如果是,我在哪里找到这个? 我也尝试过创建一个自定义的报告配置文件,但到目前为止还没有成功


任何帮助都将不胜感激

将mocha reporter设置为
min
只会打印每个测试的摘要和总摘要

cypress.json

{
  "reporter": "min"
}
要获得更多自定义输出,您必须构建自己的输出。查看mocha存储库中的和


您还可以尝试其他一些报告程序。

将摩卡报告程序设置为
min
只会打印每个测试的摘要和总摘要

cypress.json

{
  "reporter": "min"
}
要获得更多自定义输出,您必须构建自己的输出。查看mocha存储库中的和

你也可以试试其他一些记者