Skip to content

Instantly share code, notes, and snippets.

@rakeshsukla53
Created March 31, 2017 19:12
Show Gist options
  • Save rakeshsukla53/5aa691ac264cacfd867500b20a8f7ec1 to your computer and use it in GitHub Desktop.
Save rakeshsukla53/5aa691ac264cacfd867500b20a8f7ec1 to your computer and use it in GitHub Desktop.
automation_files

starting the appium driver and ios simulator

driver = start_driver(desired_capabilities={'app':'/Users/rakeshsukla/Downloads/ResyOS.app.zip', 'automationName':'XCUITest', 'deviceName':'iPad Air 2', 'platformName':'iOS', 'platformVersion':'10.2','command-timeout':'999999','newCommandTimeout':'999999'}, command_executor='http://localhost:4723/wd/hub')

pw = 8f5dabb833 Here's a rule that you need to know: you can not inject an if statement into a JSX expression.

The reason why has to do with the way that JSX is compiled. You don't need to understand the mechanics of it for now, but if you're interested then you can learn more here.

What if you want a JSX expression to render, but only under certain circumstances? You can't inject an if statement. What can you do?

starting test

py.test -n6 --host http://localhost:4723/wd/hub --resy_os /Users/rakeshsukla/Downloads/ResyOS.app.zip tests/mobile/ios

('//XCUIElementTypeStaticText[contains(@name, "Email")]/following-sibling::XCUIElementTypeButton','xpath', 'Email')

('//XCUIElementTypeCollectionView[contains(@name, "Staff Names")]//XCUIElementTypeStaticText','xpath', 'Select the first staff name')

('//XCUIElementTypeOther[3]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView//XCUIElementTypeCell[3]/XCUIElementTypeStaticText', 'xpath', 'Select the first staff name')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[4]/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]//XCUIElementTypeStaticText', 'xpath', 'user elements')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[4]/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]/XCUIElementTypeTable//XCUIElementTypeStaticText', 'xpath', 'User Elements')

el = find_elements(driver, ('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[4]/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]/XCUIElementTypeTable//XCUIElementTypeStaticText', 'xpath', 'User Elements'))

curl -u rakeshs:22ef145c-98ed-425a-a3c9-ddacc3a1579d -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/rakeshs/ResyOS.app.zip?overwrite=true --data-binary @ResyOS.app.zip

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeNavigationBar//XCUIElementTypeStaticText[2]', 'xpath', 'Change VIP Options')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[2]/XCUIElementTypeStaticText', 'xpath', 'First VIP Options')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextField', 'xpath', 'Edit First Name')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextField[2]', 'xpath', 'Edit Last Name')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[4]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextField', 'xpath', 'Search Box Field')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[4]/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]/XCUIElementTypeTable/XCUIElementTypeCell'

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[5]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextField', 'xpath', 'Search Box')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeCollectionView//XCUIElementTypeStaticText', 'xpath', 'Staff Names')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[5]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell[6]/XCUIElementTypeTextField', 'xpath', 'Mobile Number')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell/XCUIElementTypeStaticText', 'xpath', 'Sarah Montero')

('/XCUIElementTypeApplication/XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable/XCUIElementTypeCell/XCUIElementTypeStaticText', 'xpath', 'Mikie Montero')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment