Skip to content

Ability to search for and navigate via elements within an element via a component #61

Open
@robdmoore

Description

@robdmoore

At the moment you need to do code like this:

Panel: UiComponent

    WebElement // After this is initialised this needs to be set

    ClickClose()
        var closeElement = WebElement.FindElement(By.CssSelector("div.close"))
        closeElement.Click()
        var close = GetComponent<ConfirmPanelClose>()
        close.WebElement = closeElement
        return close
    Manage()
        WebElement.FindElement(By.CssSelector(".manage")).Click()
        return GetComponent<ManagementPage>()

ConfirmPanelClose : UiComponent

    WebElement

    ClickConfirm()
        WebElement.FindElement(By.TagName("a")).Click()

It would be cool if you could make use of a new base class, something like:

UiComponentWithElement : UiComponent
    SetElement(IWebElement)
    Element
    WithinMyElement
        Find()
        Navigate()
        ...

And then the above would become something like: ...

Panel: UiComponentWithElement

    ClickClose()
        var close = WithinMyElement.Find().Element<ConfirmPanelClose>(By.CssSelector("div.close"))
        close.Element.Click()
        return close
    Manage()
        return WithinMyElement.Navigate().To<ManagementPage>(By.CssSelector(".manage"))

ConfirmPanelClose : UiComponentWithElement

    ClickConfirm()
        WithinMyElement.Find().Element(By.TagName("a")).Click()

When we get a Find().Elements() it would be cool if that could have an overload that takes a UiComponentWithElement generic type too...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions