-
Notifications
You must be signed in to change notification settings - Fork 804
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
Added xdebug
, xtree
, xobject
and xnoid
commands
#192
Conversation
Thanks for submitting this! I've only taken a quick look, I'll review it soon. I do have one initial question: Why have both swift and objc expressions, why not use objc everywhere? I suspect I know what the answer is, but maybe I don't. |
Hi, All commands accept an expression as an argument. So, in a case of the xdebug userPage.nameLabel() After evaluating the expression in the Swift or the Objective-C those commands are getting a pointer to the evaluated object and perform all tasks in Objective-C for simplicity. So both expressions are used only at the beginning to handle user provided data. |
Right. The technique (trick) I've used is to put the user input in backquotes. For example:
doesn't work if called from a view controller written in swift, but this does:
Many chisel commands are like this, they currently don't always work from swift. I was thinking that commands could add backticks around the user input to resolve this. I haven't done any work to update the existing chisel commands, but you might want to consider it for these new commands. On the flip side, maybe there's some value evaluating swift expressions in swift, I haven't given it much thought. |
Hi, I didn't know about When I execute command directly from LLDB like:
it works. But when I execute exactly the same expression from Python: print fb.evaluateExpressionValue("[(XCUIElement *)`XCUIApplication()` debugDescription]").GetObjectDescription() I'm getting an error:
I couldn't find any option in the |
Hi, Are you content with my PR or should I change something? |
Sorry for the delay, thank you the pull request. I'll try to review today/tomorrow. |
Looks good to me! |
I should clarify, I went over it pretty lightly so I wouldn't have caught any bugs with my eye. Thanks again! |
Note to self, maybe these commands should be aded to the README. |
This PR adds four new commands to help with Xcode UI tests. All commands are working with Objective-C and Swift code.
xdebug
This command is a shortcut for
XCUIApplication().debugDescription
(or[[[XCUIApplication alloc] init] debugDescription]
for Objective-C). It accepts an optional argument which an instance of theXCUIElement
type which will be used instead ofXCUIApplication
. In addition, for the Swift variant, all\n
characters are normalized to new line characters.xtree
Prints tree of
XCUIElement
objects of theXCUIApplication
object (it can be configured by an optional argument like in thexdebug
command). Output is similar toXCUIApplication().debugDescription
but it doesn't contain by default "unnecessary" information like frame, traits or pointer value. That additional information can be turned on by using options--frame
,--trait
and--pointer
.Example output:
xnoid
This command can be used to find potential views with missing identifiers. It prints all objects which have set label but doesn't have the identifier. Output is similar to
xtree
command but in addition, theStatusBar
is not presented (which can be changed with--status-bar
option).Example output:
xobject
Prints detailed information about the
XCUIElement
object.Example output: