Skip to content

Conversation

@jamesmcroft
Copy link
Member

Changes have been made to incorporate new By locator features as well as additional wait condition functionality.

For By locators, these include:

  • ByAll that can be used in place of a By locator to locate elements that match all of the provided By locators. This is useful when you want to find an element that matches multiple criteria, such as a button that has a specific text.
    • RemoteWebElement element = app.FindElement(new ByAll(By.TagName("button"), ByExtras.Text("Send Message")));
  • ByNested that can be used in place of a By locator to locate elements that are nested by a sequence of locators. This is useful when you want to find an element that is nested within other elements, such as a button that is inside a form, inside an ID'd element.
    • RemoteWebElement element = app.FindElement(new ByNested(By.Id("PersonContainer"), By.TagName("form"), By.TagName("button")));

New wait conditions include:

  • ElementIsVisible to wait for an element to be visible with a specific locator at the driver
  • ElementIsVisibleInElement to wait for an element to be visible with a specific locator within another element
  • ElementIsVisibleInElementWrapper to wait for an element to be visible with a specific locator within an element wrapper
  • ElementIsVisibleInPage to wait for an element to be visible with a specific locator within a page object
  • ElementIsNotVisible to wait for an element to be hidden (not visible) with a specific locator at the driver
  • ElementIsNotVisibleInElement to wait for an element to be hidden (not visible) with a specific locator within another element
  • ElementIsNotVisibleInElementWrapper to wait for an element to be hidden (not visible) with a specific locator within an element wrapper
  • ElementIsNotVisibleInPage to wait for an element to be hidden (not visible) with a specific locator within a page object
  • FrameAvailableToSwitchTo to wait for a frame within the driver to be available and then switching the driver context to that frame

All WaitUntil methods within the platform have been updated to incorporate a retry mechanism, as well as supporting wait conditions that return values other than Booleans. These methods have also been update to return the result of the condition also.

PR checklist

  • Have Legerity sample tests been added or updated, run locally, and all pass
  • Have added or updated support for platform specific element wrappers been reflected in the Page Object Generator
  • Have code styling rules been run on all new source file changes
  • Have relevant articles in the docs been added or updated for all new source file changes
  • Have major breaking changes been made and are documented

Other information

@jamesmcroft jamesmcroft requested a review from a team as a code owner February 16, 2023 14:29
Copy link
Contributor

@tom-made tom-made left a comment

Choose a reason for hiding this comment

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

This includes breaking changes. Is this expected to be part of the v1 release?

@jamesmcroft
Copy link
Member Author

This includes breaking changes. Is this expected to be part of the v1 release?

@tom-made that's correct 😄

@jamesmcroft jamesmcroft merged commit a125f9a into main Feb 16, 2023
@jamesmcroft jamesmcroft deleted the by-extras branch February 16, 2023 14:33
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