diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/index.js b/src/index.js index 5345587..d240be0 100644 --- a/src/index.js +++ b/src/index.js @@ -31,18 +31,24 @@ puppeteer.launch({ headless: true }) page.waitForNavigation() // Wait until the next page loads ]); - // Launch a meeting + // Launch the conference in a new tab const conferencePagePromise = new Promise(resolve => browser.on( 'targetcreated', target => resolve(target.page()) )); await clickElementBySelector(page, 'input#join_button_input'); const conferencePage = await conferencePagePromise; - await attendConference(conferencePage); - // Fill up the attendance - await page.goBack(); - await clickElementBySelector(page, 'li.attendance'); + // Prepare onJoin callback + const fillAttendance = async () => { + await page.goBack(); + await clickElementBySelector(page, 'li.attendance'); + // TODO: actually fill the attendance + console.log('Attendance filled'); + }; + + await attendConference(conferencePage, fillAttendance); + await browser.close(); }) .catch(e => console.log(e)); |