WebdriverIO plugin for fetching emails from Gmail using the Gmail API. Integrates with WebdriverIO tests to poll inbox for emails matching filters (from, to, subject, date range, label). Uses gmail-tester for OAuth2 authentication. Version 2.1.0 supports Node >=18, TypeScript types included. Key differentiator: seamless integration with WebdriverIO's browser object via custom command 'checkInbox'.
npm install wdio-gmail-serviceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure the Gmail service in wdio.conf.js and use browser.checkInbox in a test.
Update Node.js to v18 or later.
Use path.join(process.cwd(), 'file.json') or absolute paths.
Ensure the service is correctly configured in wdio.conf.js. Call browser.checkInbox only inside WebdriverIO tests (before/after hooks work).
Implement external token refresh or regenerate token.json before expiry.
Check email array length and assert non-empty. Consider increasing timeoutSec.
Ensure services includes ['gmail', {...}] with correct options. Check path to configuration files.Use path.join(process.cwd(), 'file.json') for both paths.
Regenerate token.json via Gmail Tester steps. Ensure credentials.json is valid.