diff options
Diffstat (limited to 'src/attendConference.js')
| -rw-r--r-- | src/attendConference.js | 21 | 
1 files changed, 21 insertions, 0 deletions
diff --git a/src/attendConference.js b/src/attendConference.js new file mode 100644 index 0000000..b7f744f --- /dev/null +++ b/src/attendConference.js @@ -0,0 +1,21 @@ +const clickElementByXPath = (page, xPath) => page +  .waitForXPath(xPath) +  .then(item => item.click()); + +const attendConference = async page => { +    // Join as "Listen only" +    await clickElementByXPath(page, '//span[contains(text(),"Listen only")]'); +    console.log('Joined the conference'); + +    // Wait 5 seconds +    await page.waitForTimeout(5000); +    console.log('Time to leave!') + +    // Leave audio and close the tab +    await clickElementByXPath(page, '//button[contains(@aria-label,"Leave audio")]'); +    await page.waitForTimeout(1500); +    await page.close(); +    console.log('Left the conference'); +}; + +module.exports = attendConference;  |