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
5
votes
2 answers

Pressing the Back Button on Navigation Bar using EarlGrey

I've run into a bit of a snag trying to write a test that uses the back button, hopefully someone can point me in the right direction with this one. My views are pretty standard I have a UINavigation controller as my root view controller and I'm…
khandpur
  • 705
  • 3
  • 12
5
votes
1 answer

How can I configure my EarlGrey test to wait for a view or an event?

I'm writing a test where I need to wait for a particular view to show up in my UI using the EarlGrey UI Testing framework. So, I looked at the docs here and am trying to achieve this using GREYCondition. But it seems as though GREYCondition requires…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
4
votes
3 answers

Pod install fails with "LoadError - cannot load such file -- earlgrey"

I followed the instructions as verbatim on https://github.com/google/EarlGrey/blob/master/docs/install-and-run.md#cocoapods-installation and I when I run pod install, I get: LoadError - cannot load such file --…
khandpur
  • 705
  • 3
  • 12
4
votes
1 answer

Is there a way in EarlGrey for me to reset the application automatically?

Say I have the following app structure: [View Controller 1] -> tap on next button [View Controller 2] -> Check for Title In EarlGrey, I defined this test by doing: [[EarlGrey selectElementWithMatcher:grey_text(@"Next…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
4
votes
4 answers

Is it possible to dismiss System Alerts using EarlGrey (iOS UI Testing)?

I'm beginning to experiment with EarlGrey a little bit, having done UI Testing using the XCUITest for some months now. I'm running into the classic problem of being unable to dismiss system alerts, which is strange as it looks as though Google…
Jonathan Chen
  • 716
  • 8
  • 19
3
votes
1 answer

How to perform a pull to refresh while automating with EarlGrey?

Suppose you have a tableView or fileListView, and you would like to perform a pull to refresh action on the same. Tried performing with swipe and scroll, there was no result initially.
Arjun Kalidas
  • 919
  • 9
  • 14
3
votes
1 answer

How can I get EarlGrey to select the keyboard's window or other private UIKit elements?

I am trying to write a test to automate the showing and hiding of the UI keyboard. However, I need to make sure that the keyboard is visible on the screen whenever I try to make such a call. I found that I can check for an element of the…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
3
votes
1 answer

How do I check whether an element exists in the UI hierarchy?

How do I check whether an element exists in the UI hierarchy? I dont want EarlGrey to fail if an element does not exist but just check if its there, I need this for UITableView where I must constantly scroll to top and scroll down searching an…
jdis
  • 101
  • 5
3
votes
1 answer

In EarlGrey how can I access the element object that I am interacting with?

In EarlGrey how can I access the element object that I am interacting with, for example I want access to UIButton that I just tapped.
jdis
  • 101
  • 5
3
votes
1 answer

Find elements in an UIWebView

I want to write an UI automation test that log in by using Google. The webview is embedded in the app. In Earlgrey, how can I select a text field or a button of a web view. Thanks
sahara108
  • 2,829
  • 1
  • 22
  • 41
3
votes
1 answer

EarlGrey tried waiting for 5.0 seconds for the application to reach an idle state

Looks like EarlGrey can't use nice function of waiting APP to idle when testing our APP. Getting this error on each screen: EarlGrey tried waiting for 5.0 seconds for the application to reach an idle state, but it didn't. EarlGrey is now forced…
3
votes
2 answers

EarlGrey - How do I check if multiple objects are being shown on the screen

The EarlGrey documentation says that You must narrow down the selection until it can uniquely identify a single UI element I have three UIViews on my UI that I need to check the visibility of using the grey_sufficientlyVisible() assertion. However,…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
3
votes
1 answer

How do I debug timeout failures in EarlGrey tests?

Every time I run my EarlGrey test, it fails with the following message: Failed to change device orientation due to error: Error Domain=com.google.earlgrey.GREYUIThreadExecutorErrorDomain Code=0 "Failed to execute block because App is not idle.…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
2
votes
2 answers

Xcode got "Image Not Found" while running the test

I am trying to add UI Tests to my project using EarlGrey 2.0 by following this steps to install the framework : https://www.youtube.com/watch?v=KQaA11qVQn0 (using Cocoapods). It build successfully but when I tried to run the test, I got this…
mrjimoy_05
  • 3,452
  • 9
  • 58
  • 95
2
votes
1 answer

Problems with EarlGrey synchronization always timing out

I'm having problems with EarlGrey's synchronization feature. I'm trying to create a simple test example for my app that basically checks if the login button shows up. func testExample() { let success = GREYCondition(name: "Wait for action view…
Lee Kang
  • 729
  • 9
  • 19
1
2 3 4 5 6 7