I have a problem similar to link, I think in that link guys are using typescript files. I have defined selectors in the js files, I tried to do it this way:
class Page {
constructor(sampleText){
this.optionsButton = Selector('#options').withText(sampleText);
}
}
export default new Page();
but when I try to call selector from test file
test('sampleTest', async t=> {
await t.click(Page.optionsButton('sometext');
)}
I got an error:
ERROR Cannot prepare tests due to the following error: The "text" argument (undefined) is not of expected type (string or a regular expression).
How to solve this issue ?