This project demonstrates the page object pattern (POP) that we use internally here at Xamarin. We have tried both simpler and more complex architectures in the past and have found this approach to be one of the best. It is easily adopted by people who are learning how to write tests, but also provides the scalability needed to build out larger, more complicated test suites.
This project is based on the Tasky Pro Calabash example and uses many of the same concepts as Calabash's page object pattern.
- Clone this repo
- Build
- Run*
*If you want to run this on a physical iOS device, you will need to clone and build the app from source in order to get an IPA file that is compatible with your device.
-
Create a new test project or open up your existing one
-
Install the Xamarin.UITest.POP NuGet package, which will add all the necessary files to your project
Alternatively, you can manually add the following files to your project (making sure to change the namespaces to match your own):
-
Remove AppInitializer.cs (if it exists)
-
Ensure page object classes inherit from
BasePage
-
Ensure test fixture classes inherit from
BaseTestFixture
For more detailed instructions check out the wiki.