Currently facing a challenge with writing a test using testcafe and testing library.
Given the site's unique characteristics, we are unable to utilize the standard testing library role with name/label queries as our tests run across 50+ different locales without needing translations during the tests.
To address this limitation, I retrieve my form container and then extract the two input fields using TL's within and query functions.
The issue arises when trying to destructure the returned 2 input fields for individual use, resulting in the following error:
Error: Type 'Selector' must have a 'Symbol.iterator' method that returns an iterator.ts(2488)
My Selectors are structured as follows:
// Container holding the form
export const ComponentContainer = Selector("[data-testid=ComponentContainer]");
// Retrieves 2 input fields for username/password
export const InputFields = within(ComponentContainer).queryAllByRole("textbox");
// Attempting to destructure these inputs and export them as named Selectors
export const [UsernameField, PasswordField] = LoginPageContainer
Seeking guidance on understanding this error and finding a solution - Any assistance would be appreciated!
Thank you