Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
41 lines (31 loc) · 1.28 KB

File metadata and controls

41 lines (31 loc) · 1.28 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
"""An example of Appium running on Sauce.
This test assumes SAUCE_USERNAME and SAUCE_ACCESS_KEY are environment variables
set to your Sauce Labs username and access key."""
from random import randint
from appium import webdriver
from appium import SauceTestCase, on_platforms
platforms = [{
'platformName': 'iOS',
'platformVersion': '7.1',
'deviceName': 'iPhone Simulator',
'app': 'http://appium.s3.amazonaws.com/TestApp6.0.app.zip',
'appiumVersion': '1.3.4'
}]
@on_platforms(platforms)
class SimpleIOSSauceTests(SauceTestCase):
def _populate(self):
# populate text fields with two random numbers
els = self.driver.find_elements_by_class_name('UIATextField')
self._sum = 0
for i in range(2):
rnd = randint(0, 10)
els[i].send_keys(rnd)
self._sum += rnd
def test_ui_computation(self):
# populate text fields with values
self._populate()
# trigger computation by using the button
self.driver.find_element_by_accessibility_id('ComputeSumButton').click()
# is sum equal ?
sum = self.driver.find_elements_by_class_name("UIAStaticText")[0].text
self.assertEqual(int(sum), self._sum)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.