blob: eeab38b269cd213acb9d409a058e4a434717f0bc [file] [log] [blame] [view]
Mike Baxley47db7d82017-11-16 15:57:171# Automated testing for Chrome for iOS
2
3See the [instructions] for how to check out and build Chromium for iOS.
4
5Automated testing is a crucial part of ensuring the quality of Chromium.
6
7## Unit testing
8
9Unit testing is done via gtests. To run a unit test, simply run the test
10target (ending in _unittest).
11
12## Integration testing
13
14[EarlGrey] is the integration testing framework used by Chromium for iOS.
15
16### Running EarlGrey tests
17
18EarlGrey tests are based on Apple's [XCUITest].
19
20#### Running tests from Xcode
21
22An entire suite of tests can be run from Xcode.
231. Select the *egtest target you wish to run.
242. ⌘+U to run all the tests. Note: ⌘+R, which is normally used to run an
25application, will simply launch the app under test, but will not run the
26XCTests.
27
28A subset of tests can be run by selecting the test or test case from the
29XCTest navigator on the left side of the screen.
30
31#### Running from the command-line
32
33When running from the command-line, it is required to pass in the *.xctest
34target, in addition to the test application.
35Example:
36```
37./out/Debug-iphonesimulator/iossim -d "iPad Retina" -s 8.1 \
38out/Debug-iphonesimulator/ios_chrome_integration_egtests.app \
39out/Debug-iphonesimulator/ios_chrome_integration_egtests_module.xctest
40```
41
42
43[EarlGrey]: https://github.com/google/EarlGrey
44[instructions]: ./build_instructions.md
45[XCUITest]: https://developer.apple.com/documentation/xctest