Skip to content

[Feature] WithAttribute function to chain elements on the same level with different attributes #10177

Description

Right now we need to repeat lines of code to get to the element with more than one attribute.

We would like to have an implementation that will help us with defining for example elements and then filter them by additional attribute:

[Example of what we want]:

image

[What we have?]
Right now we need to duplicate part of the standardProducts:

async chooseStandardProduct(dataProductName: string): Promise<void> {
   await this.page.locator(`[e2e-target-name="standard"][e2e-target-name="${dataProductName}"`]).click()
}

Thanks to that solution we can decrease code duplication. Similar solution already have testcafe.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions