Giter Site home page Giter Site logo

cucumber-ruby-wire's Introduction

Test cucumber-wire

cucumber-wire

This gem was extracted from the cucumber gem, and remains a runtime dependency to that gem.

Its tests are a bit hairy and prone to the occasional flicker.

In the future, it may become an opt-in plugin rather than a direct dependency on every Cucumber.

Configuration

You can configure the connection using a YAML file called a .wire file:

host: localhost
port: 54321
timeout:
  connect: 11
  invoke: 120
  begin_scenario: 120
  end_scenario: 120

Timeouts

The default timeout is 120 seconds. connect has a default timeout of 11 seconds.

YAML with ERB templating

The file format is YAML, with ERB templating, so you could make the configuration configurable:

host: localhost
port: 54321
timeout:
  connect: <%= (ENV['MY_CONNECT_TIMEOUT'] || 11).to_i %>
  invoke: 120
  begin_scenario: 120
  end_scenario: 120

cucumber-ruby-wire's People

Contributors

aslakhellesoy avatar aurelien-reeves avatar brasmusson avatar canmor avatar cbliard avatar gielvanschijndel-tomtom avatar junaruga avatar luke-hill avatar mattwynne avatar mpkorstanje avatar mxygem avatar olleolleolle avatar renovate-bot avatar renovate[bot] avatar timotheeville avatar tooky avatar vincent-psarga avatar vincentcapicotto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cucumber-ruby-wire's Issues

Suppot for embeddings

Hi everyone,

I'm trying to figure out if the wire protocol supports the transfer of embeddings (screen captures...).
It seems it does not, but maybe I'm missing something.
Does it?

Fix `features/snippets_message.feature` file

Feature features/snippets_message.feature had to be modified in commit e7feefc due to a bug in Gherkin (gherkin#290).

Once it's fixed, we should be able to revert the file to use two spaces instead of \t.

We should still be able to release the gem with this fix and get cucumber-ruby 4.0.0rc2 without being blocked by this issue.

cucumber crash with wire protocol while output format is html

Here's exception stack

โžœ cucumber -f html -o out.html

WARNING: # built-in usage of the wire protocol is deprecated and will be removed after version 8.0.0. See https://github.com/cucumber/cucumber-ruby/blob/main/UPGRADING.md#upgrading-to-710 for more info.
(Called from /Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/runtime.rb:77:in `run!')
undefined method `id' for #<Cucumber::Wire::StepDefinition:0x00007fa31abba548> (NoMethodError)
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/formatter/query/step_definitions_by_test_step.rb:34:in `on_step_activated'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/event_bus.rb:34:in `block in broadcast'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/event_bus.rb:34:in `each'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/event_bus.rb:34:in `broadcast'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/event_bus.rb:40:in `method_missing'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/configuration.rb:34:in `notify'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:53:in `result'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:37:in `find_match'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:33:in `attempt_to_activate'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:29:in `map'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:29:in `new_test_steps'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:23:in `test_case'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:12:in `test_case'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/filters/activate_steps.rb:12:in `test_case'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/test/case.rb:28:in `describe_to'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/test/filters/locations_filter.rb:18:in `block in done'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `each'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/test/filters/locations_filter.rb:17:in `done'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/filter.rb:62:in `done'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/test/filters/tag_filter.rb:18:in `done'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/compiler.rb:31:in `done'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core/gherkin/parser.rb:46:in `done'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core.rb:35:in `parse'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-core-10.1.0/lib/cucumber/core.rb:24:in `compile'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/runtime.rb:83:in `run!'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/lib/cucumber/cli/main.rb:29:in `execute!'
/Users/canmor/.rvm/gems/ruby-2.6.3/gems/cucumber-7.1.0/bin/cucumber:9:in `<top (required)>'
/Users/canmor/.rvm/gems/ruby-2.6.3/bin/cucumber:23:in `load'
/Users/canmor/.rvm/gems/ruby-2.6.3/bin/cucumber:23:in `<main>'
/Users/canmor/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/Users/canmor/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'

After some investigation, I found that the code throw exception here is requiring method id of StepDefinition:

https://github.com/cucumber/cucumber-ruby/blob/47c8e2d7c97beae8541c895a43f9ccb96324f0f1/lib/cucumber/formatter/query/step_definitions_by_test_step.rb#L34

But StepDefinition in wire library did not define reader for id:

attr_reader :regexp_source, :location, :registry, :expression

After define a id attr_reader in code above, it works.

Please investigate which library should be fix?

acceptance_tests is faied on Ruby 2.4

On master branch, Fedora 24, ruby 2.4.0, bundler 1.13.7

bundle exec rake unit_tests

is done successfully.

However

bundle exec rake acceptance_tests
...
      +/home/jaruga/git/cucumber-ruby-wire/vendor/bundle/ruby/2.4.0/gems/diff-lcs-1.2.5/lib/diff/lcs/change.rb:117: warning: constant ::Fixnum is deprecated
...
Failing Scenarios:
cucumber features/table_diffing.feature:23 # Scenario: Invoke a step definition tries to diff the table and fails
cucumber features/table_diffing.feature:52 # Scenario: Invoke a step definition tries to diff the table and passes
cucumber features/table_diffing.feature:71 # Scenario: Invoke a step definition which successfully diffs a table but then fails
cucumber features/table_diffing.feature:98 # Scenario: Invoke a step definition which asks for an immediate diff that fails

21 scenarios (4 failed, 17 passed)

Maybe the reason is because of below issue. diff-lcs-1.2.5 outputs warnings on Ruby 2.4.
https://github.com/halostatue/diff-lcs/pull/36/files

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: Invalid JSON (parsing failed)
Message: Syntax error: expecting String near ], ignor

Rename repo to cucumber-wire-ruby

This is to conform with the naming standard used for other libraries such as cucumber-expressions-[ruby,java,javascript,etc].

The gem name should stay the same, just cucumber-wire

Lincense file

I know this is WIP, but would you mind to include the LICENSE file into gem? I am packaging this for Fedora and the Fedora packaging guidelines mandates the separate license file.

Single `\` (backslash) doesn't survive the Wire

Given the following scenario:

Scenario: Backslashes in step definitions
     Given "\u20ac"
     And "\\u20ac"

in the first case, u20ac arrives from the wire, and in the second case \\u20ac.

Tested with both cucumber-cpp and cucumber-tcl-wire (as they have different wire client implementations)

tested with Cucumber 2.1.0 on win32, will retest with newer cucumber

Json output format issue. The steps are being skipped when background is used

๐Ÿ‘“ What did you see?

cucumber --format json is working incorrectly skipping steps, when Background section is present ( but works correctly when Rule sections is present)

  • cucumber invoke side
    cucumber --format json --tag "@demo01" [{"id":"demofeature","uri":"features/Demo.feature","keyword":"Feature","name":"DemoFeature","description":" As a development team\n we want to demonstrate the cpp step implementations","line":2,"tags":[{"name":"@Demo","line":1}],"elements":[{"id":"demofeature;wait-and-trace","keyword":"Scenario Outline","name":"Wait and trace","description":" This is a good weather scenario.","line":11,"type":"scenario","steps":[],"tags":[{"name":"@Demo","line":1},{"name":"@demo01","line":10}]}]}]

  • cucumber request handler side

` ./build/cucumber_wire_proxy/cucumber_test.cucumber_wire_proxy

2023-05-17T07:54:20.980834 CucumberWireProtocolServer connection accepted from: 127.0.0.1
2023-05-17T07:54:20.981011 ["step_matches",{"name_to_match":"I wait 1 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"1", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T07:54:20.983639 ["step_matches",{"name_to_match":"I wait 5 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"5", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ] `

โœ… What did you expect to see?

Same steps being processed as when a defualt format is being used or when the Rule section is present in the Feature
Using default format

  • cucumber side

`cucumber --tag "@demo01"
@demo
Feature: DemoFeature
As a development team
we want to demonstrate the cpp step implementations

Background: Test Background # features/Demo.feature:6
Background setup for demonstration
Given I wait 1 seconds test # DemoSteps.cpp:26

@demo01
Scenario Outline: Wait and trace # features/Demo.feature:11
This is a good weather scenario.
When I wait 5 seconds test # DemoSteps.cpp:26

1 scenario (1 passed)
2 steps (2 passed)
0m10.517s`

  • cucumber request handler side

`
2023-05-17T08:07:58.085245 CucumberWireProtocolServer connection accepted from: 127.0.0.1
2023-05-17T08:07:58.085365 ["step_matches",{"name_to_match":"I wait 1 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"1", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T08:07:58.087540 ["step_matches",{"name_to_match":"I wait 5 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"5", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T08:07:58.166488 ["begin_scenario",{"tags":["Demo","demo01"]}]
[ "success", [ ] ]

2023-05-17T08:07:58.168553 ["invoke",{"id":"0","args":["1"]}]

2023-05-17T08:07:58.168649 Waiting for 1 seconds[ "success", [ ] ]

2023-05-17T08:07:59.173326 ["invoke",{"id":"0","args":["5"]}]

2023-05-17T08:07:59.173523 Waiting for 5 seconds[ "success", [ ] ]

2023-05-17T08:08:08.605159 ["end_scenario",{"tags":["Demo","demo01"]}]
[ "success", [ ] ]`

With feature file containing rule section

  • cucumber side

cucumber --format json --tag "@demo_b01" [{"id":"demofeature","uri":"features/DemoRule.feature","keyword":"Feature","name":"DemoFeature","description":" As a development team\n we want to demonstrate the cpp step implementations","line":2,"tags":[{"name":"@DemoRule","line":1}],"elements":[{"id":"demofeature;wait-and-trace","keyword":"Scenario Outline","name":"Wait and trace","description":" This is a good weather scenario.","line":14,"type":"scenario","steps":[{"keyword":"Given ","name":"I wait 1 seconds test","line":11,"match":{"location":"DemoSteps.cpp:26"},"result":{"status":"passed","duration":1005075700}},{"keyword":"When ","name":"I wait 3 seconds test","line":16,"match":{"location":"DemoSteps.cpp:26"},"result":{"status":"passed","duration":3003355200}}],"tags":[{"name":"@DemoRule","line":1},{"name":"@demo_b01","line":13}],"before":[{"match":{"location":"wire"},"result":{"status":"passed","duration":3498600}}],"after":[{"match":{"location":"wire"},"result":{"status":"passed","duration":2025100}}]}]}]

  • cucumber request handler side

`root@9a49fcc40bc3:/workspaces/cucumber_test# ./build/cucumber_wire_proxy/cucumber_test.cucumber_wire_proxy

2023-05-17T07:57:15.068438 CucumberWireProtocolServer connection accepted from: 127.0.0.1
2023-05-17T07:57:15.068848 ["step_matches",{"name_to_match":"I wait 1 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"1", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T07:57:15.071259 ["step_matches",{"name_to_match":"I wait 3 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"3", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T07:57:15.150092 ["begin_scenario",{"tags":["DemoRule","demo_b01"]}]
[ "success", [ ] ]

2023-05-17T07:57:15.154718 ["invoke",{"id":"0","args":["1"]}]

2023-05-17T07:57:15.156274 Waiting for 1 seconds[ "success", [ ] ]

2023-05-17T07:57:16.160083 ["invoke",{"id":"0","args":["3"]}]

2023-05-17T07:57:16.160243 Waiting for 3 seconds[ "success", [ ] ]

2023-05-17T07:57:19.163339 ["end_scenario",{"tags":["DemoRule","demo_b01"]}]
[ "success", [ ] ]`

๐Ÿ“ฆ Which tool/library version are you using?

cucumber-ruby 7.1
cucumber-ruby-wire 6.2.1
cucumber-wire-proxy (in-house c++ implementation of the steps and cucumber request handler to be connected to)

๐Ÿ”ฌ How could we reproduce it?

You can use a repository with the setup
https://github.com/AleksKovalenko/cucumber-wire-test

  1. Install the dependencies using bundle with Gemfile provided
  2. Build the cucumber-wire-proxy using the container and run it inside the container ( will expose port 90 for connections)
  3. Run the cucumber --format json --tag "@demo01" from the host system

๐Ÿ“š Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.