I am having a strange issue with puppeteer, I have the following code:
try {
await Promise.all([
page.waitForSelector(HomeSelector.profileButton),
cursor.click(HomeSelector.profileButton),
page.waitForNavigation({ waitUntil: 'networkidle2' })
]);
// Never responds in headless mode
await page.waitForSelector(ProfileSelector.nameField);
resolve();
} catch(error) {
reject(error);
}
When I run puppeteer with headless: false it successfully waits for the selector nameField however with headless: true I just get the timeout error TimeoutError: waiting for selector .
I have tried changing the waitForNavigation parameter and that doesn't make a difference, I have also taken a screenshot of the website to confirm the elements are there.
Has anyone else faced this issue before? Any ideas how to go around fixing it?