Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 28 15:20
    kevindew commented #538
  • Sep 28 14:29
    luke-hill commented #538
  • Sep 28 13:58
    kevindew commented #538
  • Aug 23 08:40
    botandrose opened #239
  • Aug 23 08:28
    aslakhellesoy commented #238
  • Aug 23 08:28

    luke-hill on main

    Restore support for matching a … (compare)

  • Aug 23 08:28
    luke-hill closed #238
  • Aug 23 08:26
    botandrose commented #238
  • Aug 23 08:15
    luke-hill commented #238
  • Aug 23 08:14
    luke-hill commented #238
  • Aug 20 12:11
    botandrose commented #238
  • Aug 20 12:10
    botandrose synchronize #238
  • Aug 19 12:37
    botandrose commented #238
  • Aug 19 12:33
    botandrose synchronize #238
  • Aug 17 17:25
    botandrose commented #238
  • Aug 17 16:34
    luke-hill commented #238
  • Aug 16 15:48
    botandrose commented #238
  • Aug 16 15:44
    botandrose edited #238
  • Aug 16 15:44
    botandrose edited #238
  • Aug 16 15:43
    botandrose synchronize #238
Eric Kessler
@enkessler
A Gherkin tag and a Ruby Instance variable have nothing to do with each other.
greybox99
@greybox99
why do the step def need to search for the output within that tag? should be captured under all
Eric Kessler
@enkessler
@previously_captured_output is not a tag. It is an instance variable.
Rather, in Gherkin it is a tag but in Ruby it is an instance variable.
You are working with two languages.
greybox99
@greybox99
my apologies, so how do I set this?
Eric Kessler
@enkessler
What does your When step definition look like?
greybox99
@greybox99
@enkessler it's a built in method from Aruba which allows you to run bash commands directly from Gherkin
@enkessler is there any way I can avoid specifying @previously_captured_output and just search in all?
Eric Kessler
@enkessler
I don't know. I am not familiar with Aruba.
But they appear to have a room as well: https://gitter.im/cucumber/aruba
greybox99
@greybox99
@enkessler thanks, does seem inactive though.
so expect will need a output def? you can't do it without?
greybox99
@greybox99
@enkessler doesn't a test have a test output defined?
Eric Kessler
@enkessler
Not by default, no.
greybox99
@greybox99
@enkessler is there a test wide setting I can set?
Eric Kessler
@enkessler
A setting for what?
greybox99
@greybox99
@enkessler to save the output for @previously_captured_output
from any test
Eric Kessler
@enkessler
No.
greybox99
@greybox99
hmm
Eric Kessler
@enkessler
Cucumber is just a framework for executing Gherkin. It has no idea what you might write or try do in a step definition.Very little, if anything, happens by default.
Aruba appears to be similar to Rails in the sense that it is a box of predefined magic that is built on top of underlying functionality.
You will have to find the step definition for the Aruba sep that you are using and see how it does what it does.
Eric Kessler
@enkessler
Alternatively, you could write your own step definition using any one of the methods that I linked to and then you would not be relying on magic.
greybox99
@greybox99
last_command_started
@enkessler
Then the output should include: # features/step_definitions/lines_steps.rb:1
  """
  days
  uptime
  """
  expected #<Aruba::Command(#<Aruba::Processes::SpawnProcess:9551740 commandline="w": output=" 17:00:53 up 15 days,  3:17,  1 user,  load average: 0.01, 0.02, 0.05
  USER  ...">)> to include "days", but it does not respond to `include?`
  Diff:
  @@ -1,2 +1,3 @@
  -["days"]
  +#<Aruba::Processes::SpawnProcess:9551740 commandline="w": output=" 17:00:53 up 15 days,  3:17,  1 user,  load average: 0.01, 0.02, 0.05
  +USER  ...">
   (RSpec::Expectations::ExpectationNotMetError)
  ./features/step_definitions/lines_steps.rb:3:in `block (2 levels) in <top (required)>'
  ./features/step_definitions/lines_steps.rb:2:in `each'
  ./features/step_definitions/lines_steps.rb:2:in `/^the output should include:$/'
Eric Kessler
@enkessler
Try this step:
Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:$/)
It takes a table instead of a multiline string.
greybox99
@greybox99
so
Then(/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:$/) do |expected_words|
expected_words.split("\n").each do |word|
expect(last_command_started).to include(word)
end
end
Eric Kessler
@enkessler
I think that it is already defined. Just use it in your Gherkin.
greybox99
@greybox99
oh

Ambiguous match of "the output should contain all of these lines:":

aruba-0.14.2/lib/aruba/cucumber/command.rb:356:in /^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:$/' features/step_definitions/lines_steps.rb:1:in/^(?:the )?(output|stdout|stderr) should( not)? contain all of these lines:$/'

Eric Kessler
@enkessler
Then the output should contain all of these lines:
  | foo |
  | bar |
  | bay buzz|
Yep. An ambiguous match is what would happen if you try to define a pattern that conflicts with an existing pattern.
greybox99
@greybox99
Then the output should contain all of these lines: # aruba-0.14.2/lib/aruba/cucumber/command.rb:356
  | uptime |
  | days   |
  expected [#<Aruba::Command(#<Aruba::Processes::SpawnProcess:9483560 commandline="w": output=" 17:05:29 up 15 days,  3:21,  1 user,  load average: 0.00, 0.01, 0.05
  USER  ...">)>] to include an object have output: string includes: "uptime"

     object at index 0 failed to match:
        expected " 17:05:29 up 15 days,  3:21,  1 user,  load average: 0.00, 0.01, 0.05\nUSER     TTY      FROM       ...PU   PCPU WHAT\ncentos   pts/0    10.2.153.10      11:51    1.00s  1.35s  0.18s sshd: centos [priv]" to have output: string includes: "uptime" (RSpec::Expectations::ExpectationNotMetError)
  features/landingzone_baseline.feature:35:in `Then the output should contain all of these lines:'
worked
thank you so much @enkessler
Eric Kessler
@enkessler
Glad to help.
Sam Leiendecker
@sleiendecker
is there a way to run multiple sessions concurrently?
I'm using cucumber with capybara
Eric Kessler
@enkessler
Do you mean run multiple tests at once, each with their own browser?
Sam Leiendecker
@sleiendecker
@enkessler yes
well, with the same browser
I'm using webdriver.io for a different test suite, and the test runner has a wdio.conf file with a maxInstances property
so if you set that to 3, and have chrome and firefox in your capabilities.browserName, it'll launch 3 firefox sessions and 3 chrome sessions
greener
@greenr_twitter
Hi, i'm using cucumber + ruby for iOS. when i worked on Xcode 8.3 simulators, everything is fine and i can specify . Xcode 9 released recently and i installed Xcode 9. when i started running test cases with cucumber + ruby, i found i can only specify iOS 11 simulators and launch tests successfully. if i specify iOS 10.3.1 or prior simulators, a iOS 11 simulator was launched instead. i've installed 10.3.1 simulators for Xcode 9. not sure what happened. did anyone encounter same issue and resolve it?
Frank Bravo
@lefty1975

Longtime Cucumber user and Ruby enthusiast.
On a serious note, I'm struggling with when I should delete data and where I can (e.g. After hook)?

Scenario: As John I verify I feel good once I put on shoes
Given: I create a person named John
When:  I put my shoes on
Then: I feel refreshed
And: I delete person named John using an API call

In this scenario I am setting up my person named John from the UI, however, I don't want this person hanging around in my DB, so I'm adding a step to delete this individual. The scenario is not about deleting John, but feeling good about putting on shoes. So, if for some reason my deletion fails, then the test fails which is incorrect. So, can I abstract this step and place it into an After hook using a variable that I store John in? What if I have multiple scenarios creating multiple Johns, can I still abstract this step?

I know this might sound jumbled, so please tell me to provide further or clearer details.
Thanks.