Skip to content

findByText still fails after adding await. #519

Closed as not planned
Closed as not planned
@InduKrish

Description

@InduKrish

This is related to ticket #513

with by getByText, the test passed, and attached is the screenshot.

   const header = await this.screen.findByTestId('erow-GroupCode-0');
    console.log(" header" + header)
    const base = this.within(header).getByText("LINEHOLDER")
    console.log("base value" + base);
    const check = this.within(header).getByText("check")
    console.log(" value " + check)
    await expect(base).toContainText(text);

Screen Shot 2022-09-20 at 10 15 18 AM

when I tried to test this findByText with await as suggested by #513, and i see the following error
const header = await this.screen.findByTestId('erow-GroupCode-0');
console.log(" header" + header)

    const base = await this.within(header).findByText("LINEHOLDER")
    console.log("base value" + base);

    const check = await this.within(header).findByText("check")
    console.log(" value " + check)

    await expect(base).toContainText(text);

Screen Shot 2022-09-20 at 10 14 50 AM

html structure:

Screen Shot 2022-09-20 at 10 23 35 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions