ios_tests/lib/ios/specs/common/helper.rb in appium_lib-4.1.0 vs ios_tests/lib/ios/specs/common/helper.rb in appium_lib-5.0.0
- old
+ new
@@ -1,7 +1,8 @@
# rake ios[common/helper]
describe 'common/helper.rb' do
+
def before_first
screen.must_equal catalog
end
t 'before_first' do
@@ -89,15 +90,15 @@
t 'xpath' do
xpath('//UIAStaticText').name.must_equal 'UICatalog'
end
t 'xpaths' do
- xpaths('//UIAStaticText').length.must_equal 13
+ xpaths('//UIAStaticText').length.must_equal 25
end
def uibutton_text
- 'Buttons, Various uses of UIButton'
+ 'Buttons'
end
t 'ele_index' do
ele_index('UIAStaticText', 2).name.must_equal uibutton_text
end
@@ -124,29 +125,29 @@
# todo: 'string_attr_include'
t 'find_ele_by_attr_include' do
el_text = find_ele_by_attr_include('UIAStaticText', :name, 'button').text
- el_text.must_equal ''
+ el_text.must_equal uibutton_text
el_name = find_ele_by_attr_include('UIAStaticText', :name, 'button').name
el_name.must_equal uibutton_text
end
t 'find_eles_by_attr_include' do
ele_count = find_eles_by_attr_include('UIAStaticText', :name, 'e').length
- ele_count.must_equal 12
+ ele_count.must_equal 19
end
t 'first_ele' do
first_ele('UIAStaticText').name.must_equal 'UICatalog'
end
t 'last_ele' do
el = last_ele('UIAStaticText')
- el.text.must_equal ''
- el.name.must_equal 'Transitions, Shows UIViewAnimationTransitions'
+ el.text.must_equal 'Transitions'
+ el.name.must_equal 'Transitions'
end
# t 'source' do # tested by get_source
t 'get_source' do
@@ -156,36 +157,26 @@
t 'id' do
id 'ButtonsExplain' # 'Various uses of UIButton'
end
t 'invalid id should error' do
- begin
- id 'does not exist'
- rescue Exception => e
- message = e.message
- end
- message.must_equal 'Invalid id `does not exist`'
+ proc { id 'does not exist' }.must_raise Selenium::WebDriver::Error::NoSuchElementError
# resource id should error on ios
- begin
- id 'android:id/text1'
- rescue Exception => e
- message = e.message
- end
- message.must_equal 'Invalid id `android:id/text1`'
+ proc { id 'android:id/text1' }.must_raise Selenium::WebDriver::Error::NoSuchElementError
end
t 'tag' do
- tag('UIATableCell').name.must_equal 'Buttons, Various uses of UIButton'
+ tag('UIATableCell').name.must_equal uibutton_text
end
t 'tags' do
tags('UIATableCell').length.must_equal 12
end
t 'find_eles_by_attr_include' do
- find_eles_by_attr_include('UIATableCell', 'name', 'Use').length.must_equal 7
+ find_eles_by_attr_include('UIAStaticText', 'name', 'Use').length.must_equal 7
end
t 'get_page_class' do
# 8 local. 9 on sauce.
get_page_class.split("\n").length.must_be :>=, 8
@@ -207,6 +198,6 @@
string_visible_exact
xpath_visible_exact
xpaths_visible_exact
raise_no_element_error
=end
-end
\ No newline at end of file
+end