漂亮的东西
为终端提供丰富的Cucumber进展和成果格式

使用量
此软件包用于内部 @cucumber/cucumber 提供 summary, (中文(简体) ), progress 财务报告和审定财务报表 pretty 格式化器;不需要自己安装或管理.
关于用法,见 https://github.com/cucumber/cucumber-js/blob/main/docs/formaters.md 互联网档案馆的存檔,存档日期2011-12-21。 。 。 .
您可以使用这些低级课程来为Cucumber不同的执行提供格式化.
摘要
打印测试结果摘要,包括非通过方案、统计和片段.
import { SummaryPrinter } from '@cucumber/pretty-formatter'
const printer = new SummaryPrinter()
// each time a message is emitted
printer.update(envelope)
也可以用来总结一个已经发生的测试运行, 并预留人口 Query 对象 :
import { Query } from '@cucumber/query'
import { SummaryPrinter } from '@cucumber/pretty-formatter'
const query = new Query()
// each time a message is emitted
query.update(envelope)
// later
SummaryPrinter.summarise(query)
进度
打印测试进度为单字符状态指标.
import { ProgressPrinter } from '@cucumber/pretty-formatter'
const printer = new ProgressPrinter()
// each time a message is emitted
printer.update(envelope)
漂亮插件
打印以预设的Gherkin风格格式测试进度.
import { PrettyPrinter } from '@cucumber/pretty-formatter'
const printer = new PrettyPrinter()
// each time a message is emitted
printer.update(envelope)
主题
这是一个主题的计划:
interface Theme {
attachment?: Style
dataTable?: {
all?: Style
border?: Style
content?: Style
}
docString?: {
all?: Style
content?: Style
delimiter?: Style
mediaType?: Style
}
feature?: {
all?: Style
keyword?: Style
name?: Style
}
location?: Style
rule?: {
all?: Style
keyword?: Style
name?: Style
}
scenario?: {
all?: Style
keyword?: Style
name?: Style
}
status?: {
all?: Partial<Record<TestStepResultStatus, Style>>
icon?: Partial<Record<TestStepResultStatus, string>>
progress?: Partial<Record<TestStepResultStatus, string>>
}
step?: {
argument?: Style
keyword?: Style
text?: Style
}
tag?: Style
symbol?: {
bullet?: string
}
}
enum TestStepResultStatus {
UNKNOWN = "UNKNOWN",
PASSED = "PASSED",
SKIPPED = "SKIPPED",
PENDING = "PENDING",
UNDEFINED = "UNDEFINED",
AMBIGUOUS = "AMBIGUOUS",
FAILED = "FAILED"
}
Style 是任意 节点.js 支持修改 或数组它们.
见 默认主题 为了一个好的例子。 出口为 CUCUMBER_THEME,所以你可以克隆和扩展它 如果你愿意.