Skip to content

Nightwatch Testing Library injects testing library and simmer on each call of getByRole, getByText etc #315

@davidholyko

Description

@davidholyko

I have an example here from a simple test

https://github.com/davidholyko/nightwatch-sandbox/blob/3d34d1b35a7476619a9d5f4caa0d2a3b3fc43289/src/tests/06-nwtl-example.ts

Whenever getByRole or a query function is called, the injectNWTL function

injectNWTL(browser)

I believe causes page crash errors eventually when we have enough of these. the execute scripts are fairly large (> 30,000 characters).

In webdriver flavor, there seems to be some extra code to conditionally inject the script if it has not already been loaded

https://github.com/testing-library/webdriverio-testing-library/blob/2eeee0106b1bd687045bbd111f041f0022e62103/src/index.ts#L61-L86

Image

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