Jason B | 21 Oct 16:56 2014
Picon

[Cucumber] Is it possible to store 'steps' in a gem for easy re-use among projects?

Did some brief searching and didn't find this question, so apologies if I missed it.

My team is investigating and exploring Cucumber + Ruby as an automated testing solution. One thing we're exploring is the idea of separate test projects for different development/test teams but the catch there is there are a lot of common actions we'd ideally like to share across projects (For web test, logins, basic navigation. For api tests, auth steps, etc).

We had the idea to see if it was possible to put the step implementations (and their dependent objects, structures, etc) into ruby gems, so Team A could include a UIBaseGem and TeamB could include an APIBaseGem, Team C could get both! 

Is this possible? Our team is new to ruby so I hunted and pecked and tried something that failed spectacularly. Hoping someone in these parts has the knowledge we need (even if it's "sorry, that's impossible dude").

Thanks
Jason B

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Aslak Hellesøy | 21 Oct 15:33 2014
Picon

[Cucumber] [ANN] 3 day BDD Kickstart course in Atlanta, GA 5-7 Nov

Hi everyone,

Yours truly and core team member Julien Biezemans will be teaching a 3 day course on BDD and Cucumber in Atlanta, GA 5-7 Nov.

BDD and Cucumber is so much more than just test automation. It's also a set of principles and practices that can be used by all members of the team to build better software.
From business analysts and product owners to developers and testers.

Join our course and take BDD and Cucumber to the next level in your organisation!

Sshhhh! We have created a discount code *only* for the cukes google group that will give you 10% off the ticket price.
Just use "cukes-group" when you book your ticket.

http://kickstartacademy.io/courses/bdd-kickstart

Hope to see you in Atlanta!

Aslak & Julien

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Lukács István | 21 Oct 13:59 2014
Picon

[Cucumber] [CPP] - build problem

Hi all,

I am trying to build cucumber-cpp on the basis of "https://github.com/cucumber/cucumber-cpp".
The following Gmock and Gtest are installed on my Ubuntu:
GMock with its GTest: 1.6.0
Ubuntu: 64bit, 14.04

"cucumber-ruby-core" directory is in the Path.

the output of command "cmake -E chdir build cmake -DCUKE_ENABLE_EXAMPLES=on .." :
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   thread
--   system
--   regex
--   date_time
--   unit_test_framework
-- Could NOT find CPPSPEC (missing:  CPPSPEC_LIBRARY CPPSPEC_INCLUDE_DIR) 
-- Found GTest: /usr/lib/libgtest.a  
-- Found GMock: /usr/src/gmock/libgmock.a  
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Adding ContextHandlingTest
-- Adding HookRegistrationTest
-- Adding StepRegistrationTest
-- Adding TaggedHookRegistrationTest
-- Adding WireServerTest
-- Adding WireProtocolTest
-- Adding BasicStepTest
-- Adding ContextManagerTest
-- Adding CukeCommandsTest
-- Adding RegexTest
-- Adding StepCallChainTest
-- Adding StepManagerTest
-- Adding TableTest
-- Adding TagTest
-- Adding GTestDriverTest
-- Adding BoostDriverTest
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake (found version "4.8.6") 
CMake Warning at CMakeLists.txt:128 (message):
  Could not find Bundler: skipping Ruby Gem management


-- Found Cucumber
-- Configuring done
-- Generating done
-- Build files have been written to: /home/s-dev/cucumber-cpp/cucumber-cpp-master/build

Then I get the following error as output of "cmake --build build":
Scanning dependencies of target cucumber-cpp
[  1%] Building CXX object src/CMakeFiles/cucumber-cpp.dir/ContextManager.cpp.o
...
[ 53%] Built target BasicStepTest
Scanning dependencies of target BoostDriverTest
[ 55%] Building CXX object tests/CMakeFiles/BoostDriverTest.dir/integration/drivers/BoostDriverTest.cpp.o
Linking CXX executable BoostDriverTest
[ 55%] Built target BoostDriverTest
Scanning dependencies of target ContextHandlingTest
[ 56%] Building CXX object tests/CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o
Linking CXX executable ContextHandlingTest
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<int, unsigned long>(char const*, char const*, int const&, unsigned long const&)':
ContextHandlingTest.cpp:(.text._ZN7testing8internal11CmpHelperEQIimEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIimEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x92): undefined reference to `testing::internal::EqFailure(char const*, char const*, testing::internal::String const&, testing::internal::String const&, bool)'
CMakeFiles/ContextHandlingTest.dir/integration/ContextHandlingTest.cpp.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<int, int>(char const*, char const*, int const&, int const&)':
ContextHandlingTest.cpp:(.text._ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_[_ZN7testing8internal11CmpHelperEQIiiEENS_15AssertionResultEPKcS4_RKT_RKT0_]+0x8d): undefined reference to `testing::internal::EqFailure(char const*, char const*, testing::internal::String const&, testing::internal::String const&, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/ContextHandlingTest] Error 1
make[1]: *** [tests/CMakeFiles/ContextHandlingTest.dir/all] Error 2
make: *** [all] Error 2

Does somebody have any idea to solve this problem?
I am waiting for your answer!

BR,
Istvan


--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Miriam lopes | 21 Oct 12:19 2014
Picon

[Cucumber] Cucumber json report

Hi everyone,

I have a problem with cucumber json report on jenkins. When the test passes the report is generated correctly and everything works fine. However if the test fails the .json file is always generated with 0bytes - is empty. The html report is generated correctly providing information on the failure however the .json file does not contain any information.

Can you help me on this?

Thanks
Miriam

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Miriam lopes | 21 Oct 12:17 2014
Picon

[Cucumber] Cucumber hooks.rb file not called when using Jenkins

Hi everyone,

i'm using cucumber-ruby-appium to automate my tests in iOS. Everything seems to work correctly when i run the tests via terminal. However when i use Jenkins, the test runs correctly however the hooks.rb file does not seem to be called.

My hooks.rb file is on support directory along with env.rb and it looks like this:
After do |scenario|

if scenario.failed?
screenshot_file = "screenshot-#{Time.now.strftime('%Y%m%d-%H%M%S')}.png"
selenium.save_screenshot("/Users/SWQA/Desktop/iOS/Results/Failed_Tests/#{screenshot_file}")
embed(screenshot_file, "image/png")
puts 'Build failed'
else
puts 'Build Passed'
end
end

When i run the tests from my terminal, whenever a scenario fails the screenshot is taken and everything works correctly. If i run the test with jenkins the test is run correctly but the hook is never called.

Any help?

Thanks
Miriam

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Christian | 19 Oct 12:38 2014
Picon

[Cucumber] [cucumber-jvm] Why are we not allowed to extend classes that contain Cucumber hooks?

Hi all,

When trying to extend a class that uses cucumber hooks, Cucumber throws the following error message:
cucumber.runtime.CucumberException: You're not allowed to extend classes that define Step Definitions or hooks

What's the rationale behind stopping us from doing that?

Brgrds,

Christian

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
JP | 18 Oct 15:13 2014
Picon

[Cucumber] Can you have more than one background in one feature file?

Hi, 

I would like to find out whether I can include two different background in one feature file Thanks  

background: 
Given I am on this screen.....

Scenario: .......

Scenario:........

background:  
Given I am on that screen......

Scenario:.........



--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Rahul Sharma | 17 Oct 16:50 2014
Picon

[Cucumber] Common elements in multiple pages

Let's say a text field appears on 2 pages. What are the best practices to follow in step definitions when using these fields.

e.g. Registration page and Reset Password page both have password fields.

What should the step definition for "When I fill in my password" look like?

registration_page.password.set(value) | reset_password_page.set(value) | current_page.set(value)

In some cases the step could be reworded to avoid the overlap but sometimes same step needs to reused. CurrentPage doesn't really make it obvious which page it is in the code.

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Richard Duinmayer | 17 Oct 11:14 2014
Picon

[Cucumber] Scenario Outline uses not existing Examples in format like: <*>

Scenario Outline fills in not existing Examples in format <*>.

Hi every one, I am using Cucumber in combination with Ruby. 

I am using the Scenario outline with examples table. Some how after the first examples have run successfully Cucumber want to use <user name> in a field as well. SO it tries to enter <user name> as an example but in fact it's part of the scenario.

I can't figure out why this is. I hope some one recognises this problem and can help me.

My feature:
Scenario Outline: Update existing users with correct data
Then I search for an existing user by <user name> or <email> in the system 
And I verify that <user name>, <email> are the only ones in the list

Examples: existing users in the system to be edited and also to be modified back
|user name |email |full name |password |confirm password |
|Admin2   |richard.admin-JWcZAjjzOBFhl2p70BpVqQ@public.gmane.orgm |Richard Richards |123 |123 |
|admin12345 |test.admin-JWcZAjjzOBHQT0dZR+AlfA@public.gmane.org |Admin |123 |123 |

Examples: new correct data
      |new username | new email | new full name | new password | new confirm password |
       | abc |abc.iemand-JWcZAjjzOBHQT0dZR+AlfA@public.gmane.org |richie |1234 | 1234 |



Corresponding Ruby steps:
Then /^I search for an existing user by (.*?) or (.*?) in the system$/ do |username,email|
fill_in('search_username', :with => username)
# check username in table
find(".column_username").should have_content(username)
page.should have_content("1 - 1 of 1 (filtered from")
fill_in('search_username', :with => "")
fill_in('search_emailAddress', :with => email)
# check email in table
find(".column_emailAddress").should have_content(email)
page.should have_content("1 - 1 of 1 (filtered from")
end

And /^I verify that (.*?), (.*?) are the only ones in the list$/ do |username,email|
find(".tr.even:nth-child(2) > td:nth-child(1)").should not_have_text('')
find(".tr.even:nth-child(2) > td:nth-child(2)").should not_have_text('')
# fill_in('search_emailAddress', :with => "mail") 
# verify result matches with table
# empty and search next by email
end


--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Daniel Esponda | 15 Oct 17:06 2014
Picon

[Cucumber] Possible Cucumber Bug/Undefined behavior with local variables

Cukes Team,

I am experiencing some weird behavior with what I thought were local variables in step definitions here is an example of the problem I am encountering:


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Gherkin: 

Feature: A Test

    Scenario Outline: Test memory
        Then the password is "<password>"

    Examples:
        | password     |
        | password1234 |
        | password1234 |
        | password1234 |
        | password1234 |
        | password1234 |
        | password1234 |
        | test1        |
        | test2        |
        | password1234 |


Step Def: 

Then(/^the password is "([^"]*)"$/) do |password|
    puts password
    puts password.object_id
    password.concat("s")
end


Output:

Then the password is "<password>" # features/step_definitions/memory_steps.rb:1
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

password1234

23072964
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

password1234s

23072964
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

password1234ss

23072964
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

password1234sss

23072964
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

password1234ssss

23072964
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

password1234sssss

23072964
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

test1

23512080
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

test2

23556972
Environment Variables:
PROJ_NAME = default-project
CF_NAME = test-lab
ENV = lab

password1234ssssss

23072964
9 scenarios (9 passed)
9 steps (9 passed)
0m0.140s

Process finished with exit code 0


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I guess what I'm noting is that objects are being re-used - the memory address is the same - 23072964, and while I agree that it's probably best not to modify parameters (not a good practice), it's something that was unexpected to us and took us quite a while to figure out why our tests were failing- we are working under the assumption that local variables work like local variables. 


Thanks,

Daniel

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Marcel Overdijk | 15 Oct 18:16 2014
Picon

[Cucumber] [JVM|Spring]

Is the current code 1.2.0-snapshot code from the cucumber-spring module compatible with cucumber 1.1.8?

I'm asking this because I have the feeling 1.2.0 final will not be released soon and I'm thinking of repacking the spring module in a tiny library I'm writing.



\Marcel

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane