Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EarlGrey 2.0 Prototype (multiprocess, XCUITest support) #193

Closed
wants to merge 10 commits into from

Conversation

axi0mX
Copy link
Contributor

@axi0mX axi0mX commented Jul 15, 2016

Here's something I made this summer. You can look over the tests to understand how to use it, and read the code to understand how it works.

I didn't add any tests using XCUITest API, feel free to add your own.

I also wrote a doc about it, feel free to comment on it:
https://docs.google.com/document/d/1nlJKiPvW4s_4XkeV9fMP-s90FoPAuGRTBoHCyz3F2nE/edit?usp=sharing

It's just a prototype, so expect to find bugs.

Resolves #63.

@bootstraponline
Copy link
Contributor

Do we need IPC if we can just link in Facebook's XCUITest library?

@axi0mX axi0mX force-pushed the multiprocess branch 7 times, most recently from 3f17553 to 76c9a40 Compare July 17, 2016 04:00
@axi0mX
Copy link
Contributor Author

axi0mX commented Jul 17, 2016

If your only goal is to use XCUITest and EarlGrey together, no.

Multiprocess design has other advantages though, not just XCUITest support. With it, the prototype can today inject EarlGrey into SpringBoard on iOS simulator and confirm system alert dialogs using EarlGrey API.

In the future it can be extended to inject EarlGrey into any application on iOS simulator and on jailbroken iOS devices, and allow testing of Today widgets, Notifications, iMessage extensions, Siri extensions, Maps extensions, other app extensions, and anything else that requires testing in apps that you cannot compile and deploy yourself such as SpringBoard, Calendar, Photos, and Mobile Safari. All of this within a single test.

@axi0mX axi0mX force-pushed the multiprocess branch 4 times, most recently from 154ef63 to 8e1e123 Compare July 17, 2016 06:31
- (void)launch;
- (void)terminate;

- (BOOL)isHealthy;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have this documented.

@axi0mX axi0mX force-pushed the multiprocess branch 15 times, most recently from 2b23255 to e1d43f0 Compare July 21, 2016 10:12
@axi0mX axi0mX force-pushed the multiprocess branch 2 times, most recently from f59dee6 to 31ffb66 Compare August 27, 2016 03:13
@axi0mX axi0mX force-pushed the multiprocess branch 2 times, most recently from 0b6422d to 1739c16 Compare September 8, 2016 21:03
@Liusunming
Copy link

Is real device supported to confirm system alert dialogs using EarlGrey API?

@tirodkar
Copy link
Collaborator

@Liusunming the current prototype being worked out will be using XCUITest API's to work with System Dialogs on sim/device.

@Liusunming
Copy link

@tirodkar, does it only work within UI testing target, but not Unit testing target? In the testSystemDialog example, it just return if not on simulator:

// Interaction with SpringBoard is not on device or before iOS 9.
if (!TARGET_OS_SIMULATOR || !iOS9_OR_ABOVE()) {
return;
}

@tirodkar
Copy link
Collaborator

@Liusunming Yes, EarlGrey 2.0 will only work in the XCUITestCase context.

@Liusunming
Copy link

@tirodkar thank you so much. I used EarlGrey together with WebDriverAgentLib to confirm system alert dialogs.

@wuhao5
Copy link
Contributor

wuhao5 commented Feb 23, 2017

@Liusunming do you mind sharing more info about how you do it?

@Liusunming
Copy link

Use FBAlert of WebDriverAgentLib with EarlGrey2.0 in XCUITestCase.

@marc-neureiter
Copy link

Hi, is there a timeline for Earl Grey 2.0? Will you be able to use XCUITest calls like app.buttons["2"].tap()?

@tirodkar
Copy link
Collaborator

@eder7 We're currently developing 2.0. As soon as we have it vetted internally, we'll have it announced here.

We're keeping the current EarlGrey syntax, so instead of app.buttons["2"].tap(), you would have to do EarlGrey.select(elementWithMatcher:grey_buttonTitle("w")).perform(grey_tap()). The current API will pretty much remain the same for 2.0 as well.

Is there any other particular XCUITest api that you need to use?

@khandpur
Copy link
Collaborator

khandpur commented Apr 29, 2017

To answer @eder7's question: Yes you would be able to because after all it's running within an XCUITest.

@Liusunming
Copy link

@khandpur but it is not using EarlGrey's property if you are using app.buttons["2"].tap().

@khandpur
Copy link
Collaborator

khandpur commented May 2, 2017

That's right. The test is run in the same context so user can choose to use xcuitest apis directly but will lose all the features offered by EarlGrey.

@khandpur
Copy link
Collaborator

khandpur commented Dec 5, 2018

@khandpur khandpur closed this Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants