by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 01 07:45

    vincent-psarga on master

    Post-release 7.1.0 (compare)

  • Jul 01 07:41

    vincent-psarga on v7.1.0

    (compare)

  • Jul 01 07:41

    vincent-psarga on master

    Release 7.1.0 (compare)

  • Jul 01 06:22

    vincent-psarga on master

    Update gherkin to 14 and messag… Merge pull request #203 from cu… (compare)

  • Jul 01 06:22
    vincent-psarga closed #203
  • Jun 29 15:26
    cgriego commented #474
  • Jun 29 14:16
    vincent-psarga opened #203
  • Jun 29 14:15

    vincent-psarga on gherkin-14

    Update gherkin to 14 and messag… (compare)

  • Jun 29 07:41
    luke-hill commented #474
  • Jun 27 05:59
    olleolleolle commented #474
  • Jun 27 05:45
    aslakhellesoy commented #473
  • Jun 27 05:45

    olleolleolle on master

    Restore compatibility with data… Merge pull request #473 from cg… (compare)

  • Jun 27 05:45
    olleolleolle closed #473
  • Jun 26 22:10
    cgriego opened #474
  • Jun 26 21:12
    cgriego opened #473
  • Jun 25 10:28
    aslakhellesoy commented #467
  • Jun 25 10:28

    luke-hill on master

    failing test. compatibility with database_cle… Merge pull request #467 from bo… (compare)

  • Jun 25 10:28
    luke-hill closed #467
  • Jun 24 18:46
    lock[bot] locked #168
  • Jun 24 18:42
    lock[bot] commented #168
BhupenderAgarwal24
@BhupenderAgarwal24
Hi, can I pass a variable to scenario which should be pass to each step under that scenario?
Eric Kessler
@enkessler
What is your use case/context?
BhupenderAgarwal24
@BhupenderAgarwal24
I have a variable which gets used for each step and instead of passing along which each step I want to pass it to scenario which should pass it to all steps underneath it
Eric Kessler
@enkessler

So you've got something like

Scenario:
  * this step needs a "7"
  * this step also needs that "7"
  * don't forget the "7"

And you want something like

Scenario: Everyone loves "7"
  * I love that number
  * so do I
  * me too
Yes?
BhupenderAgarwal24
@BhupenderAgarwal24
yes
so as per your example, if I pass that parameter along with scenario, does it get pass on to all steps?
Eric Kessler
@enkessler
Nah. Things don't work like that.
You can do this, however.:
Scenario:
  Given we are working with the number "7"
  Then we can do stuff with it
  And even more stuff
Given /^we are working with the number "(\d+)"$/ do |number|
  @current_number = number
end

Then /^we can do stuff with it$/ do
  puts "Doing stuff with #{@current_number}"
end

Then /^even more stuff$/ do
  puts "Doing more stuff with #{@current_number}"
end
Cezar Cruz
@cezarcruz
Hello guys, i'm very new in cucumber and I have this doubt: How I deal with my client database? in some scenarios i need to get some id from database (executing a sql) and i not sure about the good way to do. There is some good pratice to deal with?
BhupenderAgarwal24
@BhupenderAgarwal24
Thank you @enkessler for the example. This perfectly would solve my problem.
Eric Kessler
@enkessler
@BhupenderAgarwal24 You're welcome.
BhupenderAgarwal24
@BhupenderAgarwal24
Hi, can we use same pattern for different statements while still maintaining the same definition?
For example, is it possible to have something like below:
Scenario: When I call my friend
Given He got his phone with him
When He's not in office
Then He'll attend my call
Given I call my father
And He's not in office
But Still couldn't attend my call
As you can see above I have When, And with same statement. Is it possible to have same definition for both statement instead of re-writing it
Eric Kessler
@enkessler
Yes, it is. Step definitions are matched to Gherkin statements using regular expressions. An example of a step definition that would match both When I call my friend and Given I call my father is
When /^I call my (friend|father)$/ do |person|
  call_person(person)
end
The keyword does not matter when matching step definitions. Given/When/And/etc. are ignored and only the freeform part of the statement is considered.
BhupenderAgarwal24
@BhupenderAgarwal24
thanks for the resolution :smile:
Eric Kessler
@enkessler
You're welcome.
Ryan
@rstellar
Hello!
The following appears to work when manually executed with binding.pry but fails when run as part of my Ruby step file. Any advice?
[10] pry(#<Cucumber::Rails::World>)> page.first('a', text: "edit")
=> #<Capybara::Node::Element tag="a" path="/html/body/div[2]/div/div/div/div[2]/form/div[4]/p[2]/div/div/div/div/div/table/tr[2]/td[3]/a">
[11] pry(#<Cucumber::Rails::World>)> page.first('a', text: "edit").click
=> Obsolete #<Capybara::Node::Element>
[12] pry(#<Cucumber::Rails::World>)>
Eric Kessler
@enkessler
In general, when code works in irb/pry but not in the 'end to end' test, the root cause is either timing or the way in which you have loaded up your code in those two different environments.
If you are using binding.pry then your code is presumably the same as when you run a test because you are running a test. So my guess is that it is a timing issue.
If you replace the binding.pry with a sleep 5, does it work? Is the page not done moving around and it is working in pry because it has extra time before you start typing things at it?
Ryan
@rstellar
Thank you @enkessler I didn't know about Sleep. I will try it. Thank you.
Eric Kessler
@enkessler
@rstellar Clarification: don't actually use sleep as a solution. If using sleep makes it work again, that just means that the problem is a timing issue.
That does not, however, make using sleep a good solution for timing issues.
Use some kind of dynamic waiting so that the test will sleep for only as long as it needs to instead of for a hard coded amount of time.
Ryan
@rstellar
That's how I interpreted it! Thank you for the clarification though.
lefty1975
@lefty1975

@here I know Backgrounds apply to all Scenarios in a Feature file, but I'm curious if there's a way to get around this so it doesn't apply to all the scenarios.

Example:
I have users with different permissions to access the application. Instead of creating 2 different feature files for the same feature to account for permissions, I'd rather have a background handle logging in for these 2 different users.

Feature: Ability to log into the application with users with different permissions.

Background_1: User with Admin Permissions

Scenario: As an admin user I log in and see the admin link

Background_2: User without Admin Permissions

Scenario: As a user I log in and do not see the admin link

Looks like this conversation has occurred in the past: cucumber-attic/gherkin#41 and I'm not sure if there was a resolution.

I am trying hard to reduce the number of feature files I need to create because I have to accommodate permissions.

I'm some would argue that 2 features files should be required because testing the Application and Features with different permissions does create the features to be in a different state.

Björn Rasmusson
@brasmusson
A Feature can only have one Background, and if a Background exists, it will apply to all Scenarios.
lefty1975
@lefty1975
@brasmusson thanks, I did mention I understood that. I was looking for alternatives to bypass that or utilize the same background with different users as laid out in my example above.
Björn Rasmusson
@brasmusson

alternatives to bypass that

Do not use a background at all?

Renato Marinho
@renatomarinho
This message was deleted
This message was deleted
stephenren2002
@stephenren2002
Hey all...
I was an intermediate users of cucumber... happy to be in this group
can anyone tell me is "scenarios outline" not a good idea to use...?
stephenren2002
@stephenren2002
Hello Al l, we have been using the cucumber/capybara in our framework. I need a clarification regarding the wait utilization in capybara. In my test some elements are not getting found in that case my capybara driver is not waiting till the default time is set (i.e. Capybara.default_max_wait_time = 15)... can anyone tell me what's wrong with it
Renato Marinho
@renatomarinho
This message was deleted
stephenren2002
@stephenren2002
hey guys, in my tests i have couple of steps (assume 10) wherein the second step itself there is a failure(assume element not found ), in that case the scenario fails. In that case I want to skip some other scenarios also. So that it won't wait for the element (which will not appear, due to previous failure) and the execution time will be saved ....any solution for that
PakoSt
@psstoyanov
The most simplistic approach would be to use quick fail (skip all scenarios if one fails) in combination of test runs by tags
PakoSt
@psstoyanov

but this goes more towards your structure of tests

ideally, the scenarios will be self contained and not dependent on any other scenario

quick fail is nice approach, you might disable it for stable builds to check everything and keep it for work in progress scenarios to make quick itterations

ouelletk
@ouelletk
Hello, I have the following error using cucumber-ruby: invalid byte sequence in UTF-8 (ArgumentError) when using char µ. I saw issue #1300 in github. Does anybody know when the fix is coming or if there is a workaround to use utf-8 encoding char in step definition?
Charan Damisetti
@dcharan
Anyone here got the cucumber tests running in aws Lambda… so that you could speed up the tests
Ryan
@rstellar
hello
Mathieu Jobin
@mathieujobin
@dcharan what a great idea...
Mathieu Jobin
@mathieujobin
Now that AWS lambda support Ruby. I would love to be able to throw my cucumber scenarios to run in lambda. Anyone attempted that?
melissa ann mallia
@missy198426_twitter
okay
thmai11
@thmai11
Hello, very new to cucumber. I have a question about the cucumber.wire file. Actually in mine it define the unix socket I was wondering if you could input that in the command line instead.