ios_tests/lib/ios/specs/device/device.rb in appium_lib-9.3.4 vs ios_tests/lib/ios/specs/device/device.rb in appium_lib-9.3.5
- old
+ new
@@ -52,11 +52,14 @@
tag(UI::Inventory.navbar).name.must_equal 'UICatalog'
end
t 'background_app homescreen' do
background_app(-1) # background_app(nil) should work as same.
- screen.must_raise ::Selenium::WebDriver::Error::NoSuchElementError
+
+ screen.must_equal 'UICatalog'
+ # TODO: Should update this assert.
+ # screen.must_raise ::Selenium::WebDriver::Error::NoSuchElementError
end
t 'reset' do
reset
end
@@ -78,16 +81,33 @@
app_strings.must_include 'SearchBarExplain'
app_strings('en').must_include 'SearchBarExplain'
end
t 'action_chain' do
- Appium::TouchAction.new.press(element: id('ButtonsExplain')).perform
+ Appium::TouchAction.new.press(element: text(app_strings['ButtonsExplain'])).perform
wait { id 'ArrowButton' } # successfully transitioned to buttons page
go_back
end
t 'swipe' do
- swipe start_x: 75, start_y: 500, offset_x: 75, offset_y: 0, duration: 800
+ touch_action = swipe(start_x: 75, start_y: 500, offset_x: 75, offset_y: 20, duration: 500)
+ touch_action.actions.must_equal []
+
+ touch_action = Appium::TouchAction.new.swipe(start_x: 75, start_y: 500, offset_x: 75, offset_y: 20, duration: 500)
+
+ touch_action.actions[0][:action].must_equal :press
+ touch_action.actions[0][:options].must_equal(x: 75, y: 500)
+
+ touch_action.actions[1][:action].must_equal :wait,
+ touch_action.actions[1][:options].must_equal(ms: 500)
+
+ touch_action.actions[2][:action].must_equal :moveTo
+ touch_action.actions[2][:options].must_equal(x: 75, y: 20)
+
+ touch_action.actions[3][:action].must_equal :release
+
+ touch_action.perform
+ touch_action.actions.must_equal []
end
t 'pull_file' do
# Selenium::WebDriver::Error::UnknownError: An unknown server-side error occurred while processing the command.
# Original error: Cannot read property 'getDir' of undefined