Questions tagged [earlgrey]

EarlGrey is an iOS UI Automation Test framework by Google.

EarlGrey is a native iOS UI automation test framework that enables you to write clear, concise tests.

With the EarlGrey framework, you have access to enhanced synchronization features. EarlGrey automatically synchronizes with the UI, network requests, and various queues, but still allows you to manually implement customized timings, if needed.

EarlGrey’s synchronization features help ensure that the UI is in a steady state before actions are performed. This greatly increases test stability and makes tests highly repeatable.

EarlGrey works in conjunction with the XCTest framework and integrates with Xcode’s Test Navigator so you can run tests directly from Xcode or the command line (using xcodebuild).

It's available on GitHub here: https://github.com/google/EarlGrey

96 questions
2
votes
1 answer

Randomly Selecting In EarlGrey

I was writing pretty complicated UI tests using XCTest, and recently switched to EarlGrey, because it's so much faster and way more reliable - Tests aren't randomly failing on a build server, and the test suite could take up to a half hour to run!…
ArielSD
  • 829
  • 10
  • 27
2
votes
2 answers

Building the test target fails with this error "This project requires NS_Block_Assertions to be undefined

Trying to get started with EarlGrey , i followed the steps to manually add EarlGrey to the project . But every time i try to build the test target it tends to fail with this error /EarlGrey-1.0.0/EarlGrey.pch:27:4: "This project requires…
2
votes
1 answer

How to use EarlGrey and XCTest hand in hand in the same project?

Since, XCTest requires its instances to launch with a code snippet like this : let app = XCUIApplication() let device = XCUIDevice() app.launch() and EarlGrey initialises the app instance in a different way. So when I tried to intertwine both code,…
Arjun Kalidas
  • 919
  • 9
  • 14
2
votes
2 answers

Is there a way to get count of elements with the same accessibilityID?

Is there a way to get the count of elements having same accessibilityID/label etc in Swift?
Arjun Kalidas
  • 919
  • 9
  • 14
2
votes
1 answer

EarlGrey freezes for some time when I search on a large set of TableViewCells

I was working on a basic iOS tutorial app and thought I could also start learning some EarlGrey with it. The test that I'm automating has this flow - I have a large UITableView and I pre-populate it with some random words that I generate. These can…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
2
votes
1 answer

grey_accessibilityLabel("Login") doesn't match element that exists in UI hierarchy with the same accessibility label

I am using this code to click on the login button: [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel("Login")] performAction:grey_tap()]; However, it fails with the following error: No elements found The relevant element in the UI…
khandpur
  • 705
  • 3
  • 12
2
votes
2 answers

GREYActionBlock to return specific element property not working

I'm following the Swift example under the heading Is there a way to return a specific element from the FAQ to try to retrieve a property from an element. I copied the example directly from the FAQ but after calling performAction, textValue still…
Joe Taylor
  • 2,145
  • 1
  • 19
  • 35
2
votes
1 answer

How can I detect if I'm running an EarlGrey test in my application?

For testing purposes, I want to bypass the login screen of my application. I can do that simply by commenting out the code that pushes the view controller when running tests. However, that's not ideal. I came up with a better way of setting a env…
khandpur
  • 705
  • 3
  • 12
2
votes
1 answer

Can I actually set breakpoints on EarlGrey action?

As a counter example, when setting breakpoint on KIF action, it only stops on the adding action to dispatching queue process, which is quite not as expected. My question is, can we actually break on the real EarlGrey action instead of adding the…
Zheng Xu
  • 101
  • 6
2
votes
1 answer

I get a crash with “Could not swizzle” when I launch EarlGrey tests

I get a crash with “Could not swizzle” when I launch EarlGrey tests, how do I avoid this?
jdis
  • 101
  • 5
2
votes
1 answer

Can I use Xcode Test Navigator for EarlGrey tests?

Like the following: Xcode Test Navigator
Zheng Xu
  • 101
  • 6
2
votes
1 answer

GREYAction not working when a modal dialog shows up

I am using the Google Maps API in my app following the instructions provided here. As soon as I launch the app, a permission modal comes up to ask for location services to be turned on. I have UI tests using EarlGrey being run on the app and I…
Zheng Xu
  • 101
  • 6
2
votes
1 answer

Can Earl Grey be used with XCUITest

I started using XCUITest in Xcode 7 to add UI tests for the app I was testing . As I had issues with XCUITest while entering text fields, I wanted to try EarlGrey framework for adding UITests and not unit Tests. I completed all the set up…
craj
  • 67
  • 1
  • 6
2
votes
1 answer

EarlGrey Failure - "Keyboard did not disappear after resigning first responder status"

I am attempting to write UI tests for my login page. The page has some intro animations, a search field (for finding the right server to connect to), and then once they select the right server, a username and password field appears. Here's my test…
user1661421
1
vote
0 answers

EarlGrey 2 - White Box Setup Simulator Crash on test run

I'm having trouble setting up EarlGrey2 for white box testing. I can setup blackbox fine, but when my bundle is attached to my test target, whenever a test is run the simulator crashes. Xcode 11.4.1 iOS Sim: 12 & 13 Steps: Black box: (Can…
lacking-cypher
  • 483
  • 4
  • 16