Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: container.parent.execute is not a function #46

Closed
segovia opened this issue Jan 4, 2023 · 6 comments
Closed

TypeError: container.parent.execute is not a function #46

segovia opened this issue Jan 4, 2023 · 6 comments

Comments

@segovia
Copy link
Contributor

segovia commented Jan 4, 2023

The error in the title "TypeError: container.parent.execute is not a function" happens with webdriverio v8 when you use a testing library query nested within another element.

I believe this issue is related to the fix done for: #42

I have a proposed solution that I will link in the comments.

segovia added a commit to segovia/webdriverio-testing-library that referenced this issue Jan 4, 2023
@segovia
Copy link
Contributor Author

segovia commented Jan 4, 2023

Here is the pull request. You are free to edit the commit. The naming might be sub-optimal.

#47

@olivierwilkinson
Copy link
Collaborator

@segovia Thank you very much for raising this! I'll have a look at your PR as soon as I get the chance 🙌

olivierwilkinson pushed a commit that referenced this issue Jan 16, 2023
Closes issue #46.

When using WebdriverIO v8 we encounter `TypeError: container.parent.execute is not a function`. This is due to the execute function being moved off of Elements. Traverse up through the Element's parents until we find one with `execute` and use that to inject DTL and to execute the query. Using the parent to execute does not change the behaviour of `within` since the passed Element is still used as the container for the query.
@segovia
Copy link
Contributor Author

segovia commented Jan 17, 2023

Since the code was merged, do we have a release in sight?

@olivierwilkinson
Copy link
Collaborator

Since the code was merged, do we have a release in sight?

Yup! Sorry I was looking to release and got caught up fixing the builds again.

@olivierwilkinson
Copy link
Collaborator

@segovia this has just been released, sorry for the delay! You should be able to use v3.2.1 now 😄

@segovia
Copy link
Contributor Author

segovia commented Jan 17, 2023

That's awesome! Thanks!

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

No branches or pull requests

2 participants