lib/calabash-android/steps/assert_steps.rb in calabash-android-0.4.22.pre4 vs lib/calabash-android/steps/assert_steps.rb in calabash-android-0.5.0.pre1
- old
+ new
@@ -1,44 +1,29 @@
Then /^I see the text "([^\"]*)"$/ do |text|
- performAction('assert_text',text, true)
+ wait_for_text(text, timeout: 10)
end
Then /^I see "([^\"]*)"$/ do |text|
- performAction('assert_text', text, true)
+ wait_for_text(text, timeout: 10)
end
Then /^I should see "([^\"]*)"$/ do |text|
- performAction('assert_text', text, true)
+ wait_for_text(text, timeout: 10)
end
Then /^I should see text containing "([^\"]*)"$/ do |text|
- performAction('assert_text', text, true)
+ wait_for_text(text, timeout: 10)
end
Then /^I should not see "([^\"]*)"$/ do |text|
- performAction('assert_text', text, false) #second param indicated that the text should _not_ be found
+ wait_for_text_to_disappear(text, timeout: 10)
end
-
-Then /^I don't see the text "([^\"]*)"$/ do |text|
- performAction('assert_text', text, false) #second param indicated that the text should _not_ be found
+Then /^I don't see the text "([^\"]*)"$/ do |text|
+ wait_for_text_to_disappear(text, timeout: 10)
end
-Then /^I don't see "([^\"]*)"$/ do |text|
- performAction('assert_text', text, false) #second param indicated that the text should _not_ be found
+Then /^I don't see "([^\"]*)"$/ do |text|
+ wait_for_text_to_disappear(text, timeout: 10)
end
-
-# This step is more of an example or macro to be used within your own custom steps
-# Generally, assert_view_property takes 3 args, but for if 'property'='compoundDrawables', the next arg should be 'left'/'right'/'top'/'bottom', followed by the expected drawable ID.
-# @param view_id - the name of the view, eg: R.my_view_id
-# @param property - eg: 'visibility' (visible/invisible/gone), 'drawable' (expected drawable ID)
-Then /^the view with id "([^\"]*)" should have property "([^\"]*)" = "([^\"]*)"$/ do | view_id, property, value |
- # get_view_property is also available: performAction( 'get_view_property', 'my_view', 'visibility')
- performAction( 'assert_view_property', view_id, property, value )
-end
-
-Then /^the "([^\"]*)" activity should be open$/ do | expected_activity |
- actual_activity = performAction('get_activity_name')['message']
- raise "The current activity is #{actual_activity}" unless( actual_activity == expected_activity || actual_activity == expected_activity + 'Activity' )
-end
\ No newline at end of file