0

Seeing this error when trying to write the tests. How to configure earlgrey to not track network calls at all?


Exception Details: Error Trace: [ { "Description": "Failed to execute block because idling resources below are busy.", "Description Glossary": { "GREYAppStateTracker": "Waiting for network requests to finish. By default, EarlGrey tracks all network requests. To change this behavior, refer to GREYConfiguration.

user1165756
  • 375
  • 3
  • 11

1 Answers1

-1

If you know the link that you'd like to not be tracked, then you can use the blacklist regex configuration.

https://github.com/google/EarlGrey/blob/91c27bb8a15e723df974f620f7f576a30a6a7484/Tests/UnitTests/Sources/NSURL%2BGREYAdditionsTest.m#L43

gran_profaci
  • 8,087
  • 15
  • 66
  • 99
  • I tried that but did not work. As when I run the unit test, the app starts to run before actually calling the unit test's set up method and inside the set up I had the blacklist as below\n override func setUp() { super.setUp() //Add Mocks and stuff here GREYConfiguration.sharedInstance().setValue([".*abcserver.*"], forConfigKey: kGREYConfigKeyURLBlacklistRegex) – user1165756 Sep 23 '18 at 02:55
  • Can you move it to before super.setUp? – gran_profaci Sep 24 '18 at 20:42
  • Tried but same problem. As when I start the test (1) the app starts to run, as part of this some network calls are already started (2) setup of the test is called where I tell to ignore the network. But I think from here on wards, it will ignore.. But not the network calls that already got started! – user1165756 Sep 24 '18 at 22:18
  • What about in an attribute constructor. Since the test depends on EG, the constructors of EG should be called before your test. – gran_profaci Sep 25 '18 at 00:08
  • Where do I add attribute constructor? I do not want to add in main.m file. How can I add this in test code? – user1165756 Sep 26 '18 at 17:26
  • You can add it in a test file as well. – gran_profaci Sep 26 '18 at 23:40
  • test file in swift? Do you have any sample? Thanks! – user1165756 Sep 28 '18 at 13:05