Follow-up: Update within_testid and find_by_testid helper to include context
The following discussion from !137762 (merged) should be addressed:
-
@robyrne started a discussion: (+3 comments) suggestion (non-blocking): I think we should look at updating the helper
within_testid
to handle a scenario like this.I'm wondering if we could update the helper from:
def within_testid(testid, **kwargs, &block) page.within("[data-testid='#{testid}']", **kwargs, &block) end
To something like:
def within_testid(testid, **kwargs, context: page, &block) context.within("[data-testid='#{testid}']", **kwargs, &block) end
I think this would make resolving some of these rubocop exceptions easier too.
All helper methods in dom_helpers should be updated. This should help reduce reworking some tests to satisfy the rubocop rule.
Edited by Ross Byrne