-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathios_with_reporting.rb
More file actions
55 lines (47 loc) · 1.67 KB
/
ios_with_reporting.rb
File metadata and controls
55 lines (47 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require "rubygems"
require "appium_lib"
require "sauce_whisk"
require "minitest/autorun"
describe "Basic iOS Test" do
def caps
{
caps: {
appiumVersion: "1.3.7",
platformName: "iOS",
platformVersion: "8.2",
deviceName: "iPhone Simulator",
app: "http://appium.s3.amazonaws.com/TestApp7.1.app.zip",
name: "Basic iOS Native Test",
}
}
end
before do
@driver = Appium::Driver.new(caps)
@driver.start_driver
end
after do
session_id = @driver.session_id
@driver.driver_quit
unless passed?
puts "Failed test link: https://saucelabs.com/tests/#{session_id}"
end
SauceWhisk::Jobs.change_status session_id, passed?
end
describe "when I use the calculator" do
it "should sum two numbers correctly" do
# populate text fields with values
field_one = @driver.find_element :accessibility_id, "TextField1"
field_one.send_keys 12
field_two = @driver.find_elements(:class_name, "UIATextField")[1]
field_two.send_keys 8
# they should be the same size, and the first should be above the second
assert field_one.location.y < field_two.location.y
assert_equal field_one.size, field_two.size
# trigger computation by using the button
@driver.find_element(:accessibility_id, "ComputeSumButton").click
# is sum equal?
sum = @driver.find_elements(:class_name, "UIAStaticText")[0].text
assert_equal sum.to_i, 20
end
end
end