0

After cloning and installing (I believe in the proper way - I followed this tutorial) I go to to ~\Cucumber\Cucumber\cpp\examples\Calc and type cucumber --init.

I get

C:\Cucumber\Cucumber-cpp\examples\Calc>cucumber --init
  exist   features
  exist   features/step_definitions
  exist   features/support
  exist   features/support/env.rb
  Timed out calling wire server with message 'step_matches' (Timeout::Error)

Followed by

C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/connection.rb:45:in `block in fetch_data_from_socket'
C:/Ruby/lib/ruby/2.4.0/timeout.rb:108:in `timeout'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/connection.rb:45:in `fetch_data_from_socket'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/connection.rb:22:in `call_remote'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/request_handler.rb:10:in `execute'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/protocol/requests.rb:14:in `execute'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/protocol.rb:8:in `step_matches'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/connections.rb:33:in `block in step_matches'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/connections.rb:33:in `map'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-wire-0.0.1/lib/cucumber/wire/connections.rb:33:in `step_matches'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/step_match_search.rb:20:in `call'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/step_match_search.rb:20:in `call'
C:/Ruby/lib/ruby/2.4.0/delegate.rb:83:in `method_missing'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/step_match_search.rb:62:in `call'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:66:in `matches'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:47:in `result'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:37:in `find_match'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:33:in `attempt_to_activate'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:29:in `map'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:29:in `new_test_steps'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:23:in `test_case'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:12:in `test_case'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/filters/activate_steps.rb:12:in `test_case'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/case.rb:25:in `describe_to'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/locations_filter.rb:18:in `block in done
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `each'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `done'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/filter.rb:62:in `done'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/compiler.rb:24:in `done'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core/gherkin/parser.rb:37:in `done'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core.rb:32:in `parse'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-core-3.1.0/lib/cucumber/core.rb:21:in `compile'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/runtime.rb:75:in `run!'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/lib/cucumber/cli/main.rb:34:in `execute!'
C:/Ruby/lib/ruby/gems/2.4.0/gems/cucumber-3.1.1/bin/cucumber:9:in `<top (required)>'
C:/Ruby/bin/cucumber:23:in `load'
C:/Ruby/bin/cucumber:23:in `<main>'

While I understand this is a basic mistake I really could not find a solution for this. I visited most links that show up when I type it in google.
My questions are:
- I am working on a network, would that cause issues with the wiring?
- Are there any extra steps required to run the example? The documentation mentions CMake but I did not find its usage
- What other issues might cause this?
- Could you point me to any good tutorial to getting started with cucumber-cpp? (written only)

This computer is a Windows 7 Professional

EDIT:
If I use the given port in the wire file I get:

C:\Cucumber\Cucumber-cpp\examples\Calc>cucumber --init
   exist   features
   exist   features/step_definitions
   exist   features/support
   exist   features/support/env.rb
Unable to contact the wire server at localhost:3902. Is it up? 
(Cucumber::Wire::Connection::ConnectionError)

I also could not fix this based on any of the information I found.

4

1 回答 1

1

答案:

  • Windows 上的防火墙可能会导致问题,但通常您会看到一个请求确认访问的弹出窗口(您也可以尝试暂时禁用防火墙以验证是否存在问题)。
  • 是的,虽然缺乏很好的解释,但项目README中定义的步骤应该是正确的。
  • 未使用 C++ 步骤定义启动有线服务器。
  • 项目存储库中的指南可能是最好的起点(确保您遵循所有步骤)。不幸的是,没有很好的文档。

Cucumber-CPP 当前的工作方式是让 Cucumber-Ruby 连接到 C++ 实现正在侦听的 TCP 端口。当文件中定义了有线协议cucumber.wire,以及 C++ 有线协议服务器正在侦听的主机和端口时,Cucumber-Ruby 将尝试使用 Cucumber-CPP 运行它们。

C++ 是一种编译语言,因此必须先编译步骤定义。提供的示例使用 CMake,如 README 中所述。Cucumber-CPP 需要链接到步骤定义和它们使用的所有内容(通常是被测应用程序),创建一个可执行文件,该文件将侦听localhost:3902Cucumber-Ruby 连接到的有线协议端口(默认为 )(和断开时退出)。

                    +------------------------------------------+
                    |                                          |
+----------+        | +----------+  +----------+  +----------+ |
|          |        | |          |  |          |  |          | |
| Cucumber |        | | Cucumber |  | C++ Step |  | Your     | |
| Ruby     |--------->| CPP Wire |--| Defs     |--| CPP App  | |
|          |        | | Server   |  |          |  |          | |
|          |        | |          |  |          |  |          | |
+----------+        | +----------+  +----------+  +----------+ |
                    |                                          |
                    +------------------------------------------+
于 2018-06-10T08:20:34.573 回答