Data Driven Test with "Scenario Outlines"

125 views
Skip to first unread message

Sabha

unread,
Dec 5, 2013, 6:46:13 AM12/5/13
to calabash...@googlegroups.com
Hi,

I have a field in the app that accepts a number to authenticate.
I wanted to parametrize different numbers to validate boundary values(mostly the invalid data) 

This is how I did using Scenario Outline and Examples:

 Scenario Outline: Login invalid credentials
  
 Then I enter <phonenumber> into input field number 1
 Then I press "Activate"
 Then I wait for 2 seconds
 Then I clear input field number 1

Examples:
|phonenumber|
|1234580980000|
|123987|
|1244456789|
|9996707999|

But - Calabash is throwing 

  Scenario Outline: Login invalid credentials            # features\1Setbridgeurl_1.feature:19
    Then I enter <phonenumber> into input field number 1 # features\1Setbridgeurl_1.feature:21
    Then I press "Activate"
    Then I wait for 5 seconds                            # calabash-android-0.4.3/lib/calabash-android/steps/progress_steps.rb:14
    Then I clear input field number 1                    # calabash-android-0.4.3/lib/calabash-android/steps/enter_text_steps.rb:17

    Examples:
      | phonenumber   | 
      | 1234580980000 |
      | 123987        |
      | 1244456789    |
      | 9996707999    |

5 scenarios (4 undefined, 1 passed)
28 steps (8 skipped, 8 undefined, 12 passed)
0m54.473s

You can implement step definitions for undefined steps with these snippets:

Then /^I enter (\d+) into input field number (\d+)$/ do |arg1, arg2|
  pending # express the regexp above with the code you wish you had
end

Then /^I press Activate$/ do
  pending # express the regexp above with the code you wish you had
end


Can some one let me know - how can we use 'Scenario Outline' in calabash
or let me know - where I went wrong.

Raúl Riera

unread,
Dec 6, 2013, 5:04:22 AM12/6/13
to calabash...@googlegroups.com
You need to create those 2 steps that the compiler is telling you to

callahat

unread,
Dec 6, 2013, 11:03:09 AM12/6/13
to calabash...@googlegroups.com
Are you trying to use the steps from calabash-android/calabash_steps? (as in you have "require 'calabash-android/calabash_steps'" in your step definition file)

You might need to double check quotes:

from calabash-android/steps/enter_text_steps.rb:

Then /^I enter "([^\"]*)" into input field number (\d+)$/ do |text, number|
  performAction('enter_text_into_numbered_field',text, number)
end
Reply all
Reply to author
Forward
0 new messages