I need to do the pre-test config, one time setup before I run XCUITest (automation test) cases,
Example of pre-test setup: (This needs to be done once for test cycle, the output of below APIs is used in all test cases)
- Fetching
qTestaccess token - Fetching the
qTestURLs from remote config file.
From docs I found that testBundleWillStart method of XCTestObservation protocol is ideal place to do pre-test setup.
But
-testBundleWillStart method is not getting called or executed,
all below listed methods of XCTestObservation are getting executed correctly.
testSuiteWillStarttestCaseWillStarttestCaseDidFinishtestSuiteDidFinish
I tried setting Principal Class in UITest info.plist but no luck, it shows following error
Test bundle Info.plist at /var/containers/Bundle/Application/BEAFB0C2-43D5-4C90-B50F-B1FF1A16BC23/MyAppUITests-Runner.app/PlugIns/MyAppUITests.xctest/Info.plist specified MyAppUItests.TestObserver for NSPrincipalClass, but no class matching that name was found.
How can I get the method testBundleWillStart executed?
Any help would be appreciated.