-
Notifications
You must be signed in to change notification settings - Fork 8
Running UITests Locally (Mozillans Only)
We rely on analytics events to ensure UITests are behaving correctly and, therefore, passing. We host a configured instance of Snowplow Micro in a Docker instance, to run UITests you need to:
- Install Docker
- Register for Snowplow Micro image
- Run the Snowplow Micro image
- Configure the project for local analytics
You can install Docker using Homebrew: brew install docker
Or you may download it from the Docker website
Provide your Docker username to the iOS lead so they can add you to the Pocket Docker Organization.
Execute docker compose up
in Terminal from the root Pocket directory to run an instance of Snowplow Micro.
In your XCode Pocket (iOS) schema, access the Run Arguments.
Uncheck the disableSnowplow
launch argument.
Enable both the SNOWPLOW_POST_PATH
and SNOWPLOW_ENDPOINT
Environment Variables.
You should now be able to run the UITests.
When you are done, run docker compose down
to clean up the Snowplow Micro instance.
Snowplow micro has 4 endpoints of note:
- http://localhost:9090/micro/all - Lists the total number of events received and whether they are bad or good.
- http://localhost:9090/micro/good - Returns all the good (passed validation) events snowplow received and the data within.
- http://localhost:9090/micro/bad - Returns all the bad (failed validation) events snowplow received and the reason why.
- http://localhost:9090/micro/reset - Resets snowplow to 0 events received. Should be ran at the start of each test.
These are very useful for debugging. If you have added new events and wish to check that they are firing correctly you can visit the URLs in Firefox and see the results.
The SnowplowMicro class is used to interact with Snowplow and provide helper assertions to make testing events easier.