-
Notifications
You must be signed in to change notification settings - Fork 4
How to start with XCUITest from Scratch?
Pre-requisites:
To test an iOS app using XCUITest, we may require the below: • an iOS demo app • Language: Swift or Obj C • UI Test Frameworks • GitHub account • Xcode • SourceTree
- Login to your personal GitHub Account.
- ‘Fork’ a copy of an iOS demo test app such as in https://github.com/appium/ios-test-app
- Post successful forking, a working copy of the forked branch will be added to your list of GitHub ‘Repositories’.
https://drive.google.com/open?id=1LC0JE2sQXRBO-zeqee024i0KP6v6G6vj
- Go to your newly forked repo branch and copy the git url: https://github.com/suparna-khamaru/ios-test-app.git
https://drive.google.com/open?id=1olvTVfkKKVyTQ0qMZc_692hPaosFBbnZ
- Go to SourceTree (Install if not present)
- In SourceTree -> Click on ‘New’ -> Click on “Clone from URL” -> Paste the copied url in Source URL -> Automatically the other fields should be auto-populated in seconds -> Select ‘master’ -> Click on ‘Clone’ button -> Save it in a PC location of your choice
https://drive.google.com/open?id=16m-HDgvo8UqGgdIFheyD9Xk6oAwxydEW
- Open Xcode -> File -> Open -> Open the above cloned local project file ‘TestApp.xcodeproj’
https://drive.google.com/open?id=1Y0467DVFzHObhVwhYHGYcW49yr3IBTOf
- On opening the project, the default iOS app can be observed. Our aim is to add another Target (for UI Test) to the displayed project.
https://drive.google.com/open?id=1wF8LyUdOhOpAP_g5gHHAxiydv6RGnT-c
- Xcode -> Editor -> Add Target -> Select “iOS UI Testing Bundle” -> Next
https://drive.google.com/open?id=12jut6pcuvANcdiiEihpuBOYqfLQ4scH-
- Choose a suitable name for the test suite in Product Name field such as ‘UITests’ -> Click Finish (if all the populated fields look okay)
https://drive.google.com/open?id=1SvSzhAAWeebE9UyI_9RWGWhUzDchdbfK
- By end of this step, you must be able to see that the target for UITests are created in project.
https://drive.google.com/open?id=1ZtFYC1tiDiIlXnsCt9reAyG8fj-mxYrv
-
Go to ‘UITests’ folder and start developing a test framework for testing the iOS app like any tester/end user.
-
By default, Xcode creates a sample class with sample syntaxes to run demo test (with nice descriptions for users to start from here)
https://drive.google.com/open?id=1P-8CDmrZHL_oc0pjCEB7JA-a2ReDLTUH