Files
appium/sample-code/ruby/spec/android_selectors_spec.rb
Kazuaki Matsuo 974a8c3891 chore: Update sample in Ruby (#15062)
* docs: tweak platform-support in readme and platform-support page

* add you.i and flutter

* add section, tweak gecko, review

* test: update ruby sample

* fix android

* update readme

* remove unused gem
2021-01-27 17:45:04 +09:00

34 lines
1009 B
Ruby

require 'spec_helper'
require 'appium_lib'
describe 'Basic Android selectors' do
before(:all) do
@driver = Appium::Driver.new(android_caps, true).start_driver
end
after(:all) do
@driver&.quit
end
it 'should find elements by Accessibility ID' do
search_parameters_element = @driver.find_elements :accessibility_id, 'Content'
expect(search_parameters_element.length).to eql 1
end
it 'should find elements by ID' do
action_bar_container_elements = @driver.find_elements :id, 'android:id/action_bar_container'
expect(action_bar_container_elements.length).to eql 1
end
it 'should find elements by class name' do
linear_layout_elements = @driver.find_elements :class_name, 'android.widget.FrameLayout'
expect(linear_layout_elements.length).to eql 3
end
it 'should find elements by XPath' do
linear_layout_elements = @driver.find_elements :xpath, "//*[@class='android.widget.FrameLayout']"
expect(linear_layout_elements.length).to eql 3
end
end