I am encountering an error message
'Cannot read property 'keyboard' of undefined'
and I'm not sure how to fix it. I just want to check if the keyboard is visible on the screen, but this specific line of code seems to be causing the issue.
wait t.expect(this.searchKeyboard.keyboard.visible).ok({ timeout: 3000 });
Code:
class SearchPage extends BasePage {
searchKeyboard: SearchKeyboardModel;
constructor() {
super();
}
async enterSearchKeyword(keyword: string) {
await t.expect(this.searchKeyboard.keyboard.visible).ok({ timeout: 3000 });
}
}
...
export class SearchKeyboardModel {
keyboard: Selector;
constructor() {
this.keyboard = getByTestId('qa-keypad-wrapper');
}
...