我是Cucumber的新人。在我编写基本功能文件时,我使用了表格。并打印相同的表值以查看它们将如何在控制台上显示。但在打印值时,我可以看到一些特殊字符。他们是什么以及如何删除它们?任何的想法? 我用谷歌搜索得到一个解决方案,但无法做到。谁能帮帮我吗?
这是我的专题文件: 功能:添加两个值 添加两个值
Scenario: tesing sum values
Given input and output
When inputs <inputx> and <inputy> is given
|22|33|
|33|55|
Then output must be <output>
|55|
|88|
以下是我的Ruby文件
Given(/^input and output$/) do
puts "Given block"
end
When(/^inputs <inputx> and <inputy> is given$/) do |table|
# table is a Cucumber::Core::Ast::DataTable
puts table
end
Then(/^output must be <output>$/) do |table|
# table is a Cucumber::Core::Ast::DataTable
puts table
end
以下是控制台上的输出
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
C:/Ruby193/bin/ruby -S bundle exec cucumber --profile default
Using the default profile...
Feature: Addding two values
Addding two values
Scenario: tesing sum values
[32mGiven input and output[0m
[36mGiven block[0m
[32mWhen inputs <inputx> and <inputy> is given[0m
[36m[0m
[36m | [32m 22[0m[0m |[0m [32m 33[0m[0m |[0m[0m
[36m | [32m 33[0m[0m |[0m [32m 55[0m[0m |[0m[0m
| [36m22[0m[0m |[0m [36m33[0m[0m |[0m
| [36m33[0m[0m |[0m [36m55[0m[0m |[0m
[32mThen output must be <output>[0m
[36m[0m
[36m | [32m 55[0m[0m |[0m[0m
[36m | [32m 88[0m[0m |[0m[0m
| [36m55[0m[0m |[0m
| [36m88[0m[0m |[0m
1 scenario ([32m1 passed[0m)
3 steps ([32m3 passed[0m)
0m6.555s
答案 0 :(得分:1)
尝试将--no-color
添加到命令行调用或默认配置文件中。
例如:
default: --no-source --no-color --format pretty