如何解决如何以这种格式显示日志?
我正在使用纯HTML文件,并尝试使用标签显示apache日志。但是所有行都被截断并显示为段落。我可以通过任何方式在网页上显示其原始格式的日志。 我需要显示的日志:-
Execution of 3 spec files started at 2020-08-11T10:45:13.392Z
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[0-0] RUNNING in chrome - /1_features/sample1.feature
[0-0] wdio testing--> something
[0-0] https://webdriver.io/docs/api/browser/waitUntil.html
[0-0] (//descendant::*[contains(text(),"Blog")])[1]
[0-0] (//descendant::*[contains(text(),"Versions")])[1]
[0-0] PASSED in chrome - /1_features/sample1.feature
[0-1] RUNNING in chrome - /1_features/t - Copy.feature
[0-1] wdio testing--> something
[0-1] Error in "Login Validation: Visit Websites: Given I print consoles "something""
Step "Given I print consoles "something"" is not definedYou can ignore this error by setting cucumberOpts.ignoreUndefinedDefinitions as true.
[0-1] wdio testing--> something
[0-1] wdio testing--> something2
[0-1] wdio testing--> something
[0-1] Error in "Login Validation: Visit Websites: Given I print consoles "something""
Step "Given I print consoles "something"" is not definedYou can ignore this error by setting cucumberOpts.ignoreUndefinedDefinitions as true.
[0-1] FAILED in chrome - /1_features/t - Copy.feature
[0-2] RUNNING in chrome - /1_features/t.feature
[0-2] wdio testing--> something
[0-2] PASSED in chrome - /1_features/t.feature
? Cucumber HTML report 3_reports/testReport.html generated successfully ?
"spec" Reporter:
------------------------------------------------------------------
[chrome 83.0.4103.116 linux #0-0] Spec: /home/cloud-user/bdd/1_features/sample1.feature
[chrome 83.0.4103.116 linux #0-0] Running: chrome (v83.0.4103.116) on linux
[chrome 83.0.4103.116 linux #0-0] Session ID: 5f4519cdbf15a61efaef92bc53bb31a7
[chrome 83.0.4103.116 linux #0-0]
[chrome 83.0.4103.116 linux #0-0] Login Validation
[chrome 83.0.4103.116 linux #0-0] Visit Websites Once
[chrome 83.0.4103.116 linux #0-0] ✓ Given I print console "something"
[chrome 83.0.4103.116 linux #0-0] ✓ Given I open the url "https://webdriver.io/docs/api/browser/waitUntil.html"
[chrome 83.0.4103.116 linux #0-0] ✓ When I click on "Blog"
[chrome 83.0.4103.116 linux #0-0] ✓ And I wait for a while
[chrome 83.0.4103.116 linux #0-0] ✓ When I click on "Versions"
[chrome 83.0.4103.116 linux #0-0] ✓ Given the following verifications:
[chrome 83.0.4103.116 linux #0-0] │ Help │
[chrome 83.0.4103.116 linux #0-0] │ Blog │
[chrome 83.0.4103.116 linux #0-0] ✓ Then I verify if "Contribute" exists
[chrome 83.0.4103.116 linux #0-0] ✓ And I wait for a while
[chrome 83.0.4103.116 linux #0-0]
[chrome 83.0.4103.116 linux #0-0] 8 passing (9.9s)
------------------------------------------------------------------
[chrome 83.0.4103.116 linux #0-1] Spec: /home/cloud-user/bdd/1_features/t - Copy.feature
[chrome 83.0.4103.116 linux #0-1] Running: chrome (v83.0.4103.116) on linux
[chrome 83.0.4103.116 linux #0-1] Session ID: b62a9cda00fee2ce7e93bd8cc2e6b1e6
[chrome 83.0.4103.116 linux #0-1]
[chrome 83.0.4103.116 linux #0-1] Login Validation
[chrome 83.0.4103.116 linux #0-1] Visit Websites
[chrome 83.0.4103.116 linux #0-1] ✓ Given I print console "something"
[chrome 83.0.4103.116 linux #0-1] ✖ Given I print consoles "something"
[chrome 83.0.4103.116 linux #0-1] - Given I print console "minister"
[chrome 83.0.4103.116 linux #0-1]
[chrome 83.0.4103.116 linux #0-1] Visit Websites
[chrome 83.0.4103.116 linux #0-1] ✓ Given I print console "something"
[chrome 83.0.4103.116 linux #0-1]
[chrome 83.0.4103.116 linux #0-1] Visit Websites
[chrome 83.0.4103.116 linux #0-1] ✓ Given I print console "something2"
[chrome 83.0.4103.116 linux #0-1]
[chrome 83.0.4103.116 linux #0-1] Visit Websites
[chrome 83.0.4103.116 linux #0-1] ✓ Given I print console "something"
[chrome 83.0.4103.116 linux #0-1] ✖ Given I print consoles "something"
[chrome 83.0.4103.116 linux #0-1] - Given I print console "minister"
[chrome 83.0.4103.116 linux #0-1]
[chrome 83.0.4103.116 linux #0-1] 4 passing (1.2s)
[chrome 83.0.4103.116 linux #0-1] 2 failing
[chrome 83.0.4103.116 linux #0-1] 2 skipped
[chrome 83.0.4103.116 linux #0-1]
[chrome 83.0.4103.116 linux #0-1] 1) Visit Websites Given I print consoles "something"
[chrome 83.0.4103.116 linux #0-1] Step "Given I print consoles "something"" is not definedYou can ignore this error by setting cucumberOpts.ignoreUndefinedDefinitions as true.
[chrome 83.0.4103.116 linux #0-1] undefined:undefined
[chrome 83.0.4103.116 linux #0-1]
[chrome 83.0.4103.116 linux #0-1] 2) Visit Websites Given I print consoles "something"
[chrome 83.0.4103.116 linux #0-1] Step "Given I print consoles "something"" is not definedYou can ignore this error by setting cucumberOpts.ignoreUndefinedDefinitions as true.
[chrome 83.0.4103.116 linux #0-1] undefined:undefined
------------------------------------------------------------------
[chrome 83.0.4103.116 linux #0-2] Spec: /home/cloud-user/bdd/1_features/t.feature
[chrome 83.0.4103.116 linux #0-2] Running: chrome (v83.0.4103.116) on linux
[chrome 83.0.4103.116 linux #0-2] Session ID: a755f0dfa3599d3fc41a29f02f95758d
[chrome 83.0.4103.116 linux #0-2]
[chrome 83.0.4103.116 linux #0-2] Login Validation
[chrome 83.0.4103.116 linux #0-2] Visit Websites
[chrome 83.0.4103.116 linux #0-2] ✓ Given I print console "something"
[chrome 83.0.4103.116 linux #0-2]
[chrome 83.0.4103.116 linux #0-2] 1 passing (448ms)
Spec Files: 2 passed,1 failed,3 total (100% completed) in 00:00:15
但当前显示如下:
从2020-08-11T10:45:13.392Z开始执行3个规范文件
启动ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs / branch-heads / 4103 @ {#416}) 在端口9515上仅允许本地连接。请参阅 https://chromedriver.chromium.org/security-considerations的 有关保护ChromeDriver安全的建议。 ChromeDriver已启动 成功。 [0-0]以chrome格式运行-/1_features/sample1.feature [0-0] wdio测试->某些[0-0] https://webdriver.io/docs/api/browser/waitUntil.html [0-0] (//后代:: [包含(text(),“博客”)]))[1] [0-0] (// descendant :: [包含(text(),“版本”)]])[1] [0-0]通过 chrome-/1_features/sample1.feature [0-1]在chrome中运行- / 1_features / t-Copy.feature [0-1] wdio测试->某些[0-1] “登录验证:访问网站:给出我的打印控制台中的错误” “某物””步骤“鉴于我打印控制台“某物””不是 您可以通过设置忽略此错误 bananaOpts.ignoreUndefinedDefinitions为true。 [0-1] wdio测试-> 东西[0-1] wdio测试->东西2 [0-1] wdio测试-> “登录验证:访问网站:已知我”中出现[0-1]错误 打印控制台“某物””步骤“鉴于我打印控制台“某物”” 未定义您可以通过设置忽略此错误 bananaOpts.ignoreUndefinedDefinitions为true。 [0-1]失败 chrome-/ 1_features / t-Copy.feature [0-2]在chrome中运行- /1_features/t.feature [0-2] wdio testing->通过[0-2] chrome-/1_features/t.feature
?生成的黄瓜HTML报告3_reports / testReport.html
“规范”记者: -------------------------------------------------- ---------------- [chrome 83.0.4103.116 linux#0-0]规范: /home/cloud-user/bdd/1_features/sample1.feature [chrome 83.0.4103.116 linux#0-0]正在运行:linux [chrome(chrome)(v83.0.4103.116) 83.0.4103.116 linux#0-0]会话ID:5f4519cdbf15a61efaef92bc53bb31a7 [chrome 83.0.4103.116 linux#0-0] [chrome 83.0.4103.116 linux#0-0] 登录验证[chrome 83.0.4103.116 linux#0-0]访问网站 一次[chrome 83.0.4103.116 linux#0-0]✓给出我的打印控制台 “某物” [chrome 83.0.4103.116 linux#0-0]✓鉴于我打开了 网址“ https://webdriver.io/docs/api/browser/waitUntil.html” [chrome 83.0.4103.116 linux#0-0]✓单击“博客”时[chrome 83.0.4103.116 linux#0-0]✓等待一会儿[chrome 83.0.4103.116 linux#0-0]✓单击在“版本”上[chrome 83.0.4103.116 linux#0-0]✓进行了以下验证:[chrome 83.0.4103.116 linux#0-0]│帮助│[chrome 83.0.4103.116 linux#0-0]│博客│[chrome 83.0.4103.116 linux#0-0]✓然后,我确认“贡献”是否存在[chrome 83.0.4103.116 linux#0-0]✓我等了一会儿[chrome 83.0.4103.116 linux#0-0] [chrome 83.0.4103.116 linux#0-0] 8通过(9.9s) -------------------------------------------------- ---------------- [chrome 83.0.4103.116 linux#0-1]规格: / home / cloud-user / bdd / 1_features / t-Copy.feature [chrome 83.0.4103.116 linux#0-1]运行:在linux [chrome上运行chrome(v83.0.4103.116) 83.0.4103.116 linux#0-1]会话ID:b62a9cda00fee2ce7e93bd8cc2e6b1e6 [chrome 83.0.4103.116 linux#0-1] [chrome 83.0.4103.116 linux#0-1] 登录验证[chrome 83.0.4103.116 linux#0-1]访问网站 [chrome 83.0.4103.116 linux#0-1]✓给出我的打印控制台 “某物” [chrome 83.0.4103.116 linux#0-1]✖给出我的打印信息 控制台“东西” [chrome 83.0.4103.116 linux#0-1]-已给出 我打印控制台“ minister” [chrome 83.0.4103.116 linux#0-1] [chrome 83.0.4103.116 linux#0-1]访问网站[chrome 83.0.4103.116 linux#0-1]✓鉴于我打印了控制台“东西” [chrome 83.0.4103.116 linux#0-1] [chrome 83.0.4103.116 linux#0-1]访问网站[chrome 83.0.4103.116 linux#0-1]✓鉴于我已打印 控制台“ something2” [chrome 83.0.4103.116 linux#0-1] [chrome 83.0.4103.116 linux#0-1]访问网站[chrome 83.0.4103.116 linux#0-1]✓鉴于我打印了控制台“东西” [chrome 83.0.4103.116 linux#0-1]✖给定我打印控制台“东西” [chrome 83.0.4103.116 linux#0-1]-给定我打印控制台 “ minister” [chrome 83.0.4103.116 linux#0-1] [chrome 83.0.4103.116 linux#0-1] 4个通过(1.2s)[chrome 83.0.4103.116 linux#0-1] 2 失败[chrome 83.0.4103.116 linux#0-1] 2被跳过[chrome 83.0.4103.116 linux#0-1] [chrome 83.0.4103.116 linux#0-1] 1)访问网站,因为我打印了控制台“东西” [chrome 83.0.4103.116 linux#0-1]步骤“鉴于我打印控制台“某物””不是 您可以通过设置忽略此错误 bananaOpts.ignoreUndefinedDefinitions为true。 [铬83.0.4103.116 linux#0-1]未定义:undefined [chrome 83.0.4103.116 linux#0-1] [chrome 83.0.4103.116 linux#0-1] 2)访问给出的网站,我已打印 控制台“东西” [chrome 83.0.4103.116 linux#0-1]步骤“给出我 打印控制台“某物”未定义您可以忽略此错误,方法是 将黄瓜Opts.ignoreUndefinedDefinitions设置为true。 [铬 83.0.4103.116 linux#0-1]未定义:未定义 -------------------------------------------------- ---------------- [chrome 83.0.4103.116 linux#0-2]规格: /home/cloud-user/bdd/1_features/t.feature [chrome 83.0.4103.116 linux #0-2]运行:Linux [chrome 83.0.4103.116 linux#0-2]上的Chrome(v83.0.4103.116)会话ID:a755f0dfa3599d3fc41a29f02f95758d [chrome 83.0.4103.116 linux#0-2] [chrome 83.0.4103.116 linux#0-2]登录验证[chrome 83.0.4103.116 linux#0-2]访问网站 [chrome 83.0.4103.116 linux#0-2]✓给定我的打印控制台 “某物” [chrome 83.0.4103.116 linux#0-2] [chrome 83.0.4103.116 linux#0-2] 1传递(448ms)
规范文件:00:00:15通过了2次,失败了1次,总计3次(100%完成)
我正在尝试的代码是:-
<html>
<head>
<title>log display</title>
</head>
<body>
<code>
Execution of 3 spec files started at 2020-08-11T10:45:13.392Z
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[0-0] RUNNING in chrome - /1_features/sample1.feature
[0-0] wdio testing--> something
[0-0] https://webdriver.io/docs/api/browser/waitUntil.html
[0-0] (//descendant::*[contains(text(),3 total (100% completed) in 00:00:15
</code>
</body>
</html>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。