Files
appium/sample-code/ruby/spec/ios_basic_interactions_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

30 lines
859 B
Ruby

require 'spec_helper'
require 'appium_lib_core'
describe 'IOS Basic Interactions' do
before(:all) do
@driver = Appium::Core.for(ios_caps).start_driver
end
after(:all) do
@driver&.quit
end
it 'should send keys to inputs' do
text_field_el = @driver.find_element :predicate, 'label == "TextField1"'
expect(text_field_el.attribute(:value)).to be_nil
text_field_el.send_keys 'Hello World!'
expect(text_field_el.attribute(:value)).to eq 'Hello World!'
end
it 'should click a button that opens an alert' do
button_el_txt = 'show alert'
button_el = @driver.find_element :accessibility_id, button_el_txt
button_el.click
alert_title = 'Cool title'
alert_el = @driver.find_element :accessibility_id, alert_title
alert_title = alert_el.attribute :name
expect(alert_title).to eq 'Cool title'
end
end