EarlGrey is a mobile automation framework from Google that helps you write tests for your iOS applications. BrowserStack App Automate supports EarlGrey testing on a wide range of real iOS devices. This guide will help you run your first EarlGrey test on BrowserStack.
You will need a BrowserStack username
and access key
. To obtain your access credentials, sign up for a free trial or purchase a plan.
EarlGrey tests are the unit tests based on XCTest framework, you just need to upload your .app
directory which will contain your app as well as the test-suite for the app.
You need to upload your .app
directory, which contains your app as well as the test-suite for the app.
zip
file of your .app
directory containing your app and test-suite, follow step by step instructions in our Build and export .app guide to generate the zip
file.
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY"
-X POST "https://api-cloud.browserstack.com/app-automate/earlgrey/app-dir"
-F "file=@/path/to/app/file/appDir.zip"
Sample response for the above request is shown below:
{
"test_url":"bs://j3c874f21852ba57957a3fdc33f47514288c4ba4"
}
The test_url returned in the response will be used to execute your test.
Note:
Execute your test using the below API:
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/earlgrey/build" \
-d '{"appDir": "bs://j3c874f21852ba57957a3fdc33f47514288c4ba4", "devices": ["iPhone 8 Plus-11"]}' \
-H "Content-Type: application/json"
Sample response:
{
"message" : "Success",
"build_id" : "4d2b4deb810af077d5aed98f479bfdd2e64f36c3"
}
The test results are available on the command-line interface, as well as the App Automate dashboard. You have now run your first Espresso test on BrowserStack App Automate.
Once you start an Espresso test execution using REST API, you will be able to access the test execution results on the App Automate dashboard as well as using our REST API. You can access overall summary of your test execution and also check the result and debugging logs for every test case in the Espresso test-suite.
Contact our Support team for immediate help while we work on improving our docs.