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

FindBy doc update #1311

Merged
merged 9 commits into from
Mar 29, 2020
Merged

Conversation

Cliabhach
Copy link
Contributor

@Cliabhach Cliabhach commented Mar 5, 2020

Change list

  • New Advanced-By.md file for advanced AndroidBy & iOSXCUITFindBy usage
  • Updated javadoc links for UiAutomator and Class Chain concepts

Types of changes

What types of changes are you proposing/introducing to Java client?
Put an x in the boxes that apply

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

The main goal here was to document these uiAutomator and iOSClassChain attributes within the java client documentation. You'll note that the README is incomplete - I tried to use the server source code to figure out how UiScrollable works, but didn't get very far.

I did find these two files in the main appium source. Should I make a pull request to update either of those instead/as well?

@jsf-clabot
Copy link

jsf-clabot commented Mar 5, 2020

CLA assistant check
All committers have signed the CLA.

@mykola-mokhnach
Copy link
Contributor

Thanks for the PR @Cliabhach , the documentation is never enough

As a nice bonus, this also enables syntax highlighting in
compatible clients, such as the GitHub website.
@Cliabhach
Copy link
Contributor Author

Also, it looks like appium has its own WebDriverAgent repository - should I make the inline links point there instead of to facebook's old project?

@mykola-mokhnach
Copy link
Contributor

Also, it looks like appium has its own WebDriverAgent repository - should I make the inline links point there instead of to facebook's old project?

Yes, we maintain our own fork. Although, it only contains the code. Wiki does not get copied

@Cliabhach
Copy link
Contributor Author

I'll need to add more examples, I think, but how does that look so far?

@iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeCell[`name BEGINSWITH \"Foo\"`]")

// Selector for every cell with a name that starts with "it's not"
@iOSXCUITFindBy(iOSClassChain = "**/XCUIElementTypeCell[`name BEGINSWITH \"it's not\"`]")
Copy link
Contributor

Choose a reason for hiding this comment

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

class chain also supports indexing, including negative indexes (e.g. -1 means the last matched element, -2 - the one before the last one, etc) . The only limitation is that the index should be the last specifier in the chain, for example **/XCUIElementTypeCell[`name == 'bla'`][-2] is valid, but **/XCUIElementTypeCell[-2][`name == 'bla'`] is not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are 1-based indices, it looks like. What does an index of 0 do?

Copy link
Contributor

Choose a reason for hiding this comment

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

throws an error :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough.

@mykola-mokhnach
Copy link
Contributor

yep, the doc looks great. I've also added a comment regarding indexing and deep attribute search

@Cliabhach
Copy link
Contributor Author

Cliabhach commented Mar 21, 2020

Ok, I've added items for those. I'm still not 100% on putting the README in this folder - should we maybe cross-reference it from e.g. the main Appium docs?

@Cliabhach
Copy link
Contributor Author

Oh, and I should rebase these commits so they have the docs: prefix.....

@Cliabhach
Copy link
Contributor Author

Not sure about the name - I don't suppose anyone has a good idea for what to call it?

@mykola-mokhnach
Copy link
Contributor

the current name is ok. We can always rename it if necessary ;)

@mykola-mokhnach mykola-mokhnach merged commit 5a899f9 into appium:master Mar 29, 2020
@Cliabhach Cliabhach deleted the findby-doc-update branch March 30, 2020 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants