Выше вы можете видеть элемент ввода с помощью селектора #account_email
. Но простой функциональный тест, который ожидает выбора и ввода в это поле, каждый раз терпит неудачу. Я не могу понять почему.
Есть ли синтаксическая ошибка ниже? Этот тип выбора подвержен ошибкам? Любые советы по исправлению этого приветствуются.
// A functonal test file being run by jest.js
// jest-puppeteer
test('[functional] log into shopify"', async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
// go to login page
await page.goto("https://partners.shopify.com/1185756/apps/3207477/test", {waitUntil : "load"});
console.log(page.url, `=====arrived at shopify login screen=====`);
// fill and submit form
const emailInput = await page.focus("#account_email");
await emailInput.type(process.env.SHOPIFY_PARTNER_EMAIL);
// error seen in terminal
TypeError: Cannot read property 'type' of undefined
22 | // email screen
23 | const emailInput = await page.focus("#account_email");
> 24 | await emailInput.type(process.env.SHOPIFY_PARTNER_EMAIL);
| ^
25 |
//