{"id":18438746,"url":"https://github.com/webdriverio-community/wdio-gmail-service","last_synced_at":"2025-04-07T21:32:00.183Z","repository":{"id":65378405,"uuid":"367357716","full_name":"webdriverio-community/wdio-gmail-service","owner":"webdriverio-community","description":"A WebdriverIO plugin to fetch e-mails from Google Mail.","archived":false,"fork":false,"pushed_at":"2025-03-31T19:10:27.000Z","size":1602,"stargazers_count":7,"open_issues_count":1,"forks_count":5,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-02T08:07:55.876Z","etag":null,"topics":["gmail","wdio","wdio-plugin","wdio-service","webdriverio"],"latest_commit_sha":null,"homepage":"https://webdriver.io/docs/wdio-gmail-service","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webdriverio-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"tidelift":"npm/wdio-gmail-service","open_collective":"webdriverio","github":["christian-bromann","webdriverio"]}},"created_at":"2021-05-14T12:36:31.000Z","updated_at":"2025-03-31T19:08:57.000Z","dependencies_parsed_at":"2023-02-12T00:15:14.486Z","dependency_job_id":"7478287c-9142-4f3f-9c17-f11286f08644","html_url":"https://github.com/webdriverio-community/wdio-gmail-service","commit_stats":{"total_commits":457,"total_committers":7,"mean_commits":65.28571428571429,"dds":0.07002188183807445,"last_synced_commit":"8d1aba7eba25afa5fbd5cbaad9a3efe4fc1eedcb"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-gmail-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-gmail-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-gmail-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webdriverio-community%2Fwdio-gmail-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webdriverio-community","download_url":"https://codeload.github.com/webdriverio-community/wdio-gmail-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732585,"owners_count":20986891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gmail","wdio","wdio-plugin","wdio-service","webdriverio"],"created_at":"2024-11-06T06:21:33.868Z","updated_at":"2025-04-07T21:31:59.768Z","avatar_url":"https://github.com/webdriverio-community.png","language":"TypeScript","funding_links":["https://tidelift.com/funding/github/npm/wdio-gmail-service","https://opencollective.com/webdriverio","https://github.com/sponsors/christian-bromann","https://github.com/sponsors/webdriverio"],"categories":["Plugins"],"sub_categories":["Services"],"readme":"# WebdriverIO Gmail Service [![Test](https://github.com/webdriverio-community/wdio-gmail-service/actions/workflows/test.yml/badge.svg)](https://github.com/webdriverio-community/wdio-gmail-service/actions/workflows/test.yml)\n\nA WebdriverIO plugin to fetch e-mails from Google Mail using [Gmail Tester](https://github.com/levz0r/gmail-tester).\n\n## Installation\n\nThe easiest way is to keep `wdio-gmail-service` as a `devDependency` in your package.json.\n\n```json\n{\n  \"devDependencies\": {\n    \"wdio-gmail-service\": \"^2.0.0\"\n  }\n}\n```\n\nYou can simply do it by:\n\n```sh\nnpm install wdio-gmail-service --save-dev\n```\n\n## Usage\n\n### Gmail Authentication\n\nYou'll need to follow the instructions at [Gmail Tester](https://github.com/levz0r/gmail-tester) to create the `credentials.json` (the OAuth2 Authentication file) and `token.json` (the OAuth2 token).\n\n### Configuration\n\nAdd the service by adding `gmail` to the service list, e.g.:\n\n```js\n// wdio.conf.js\nimport path from 'path'\n\nexport const config = {\n    // ...\n    services: [['gmail', {\n        credentialsJsonPath: path.join(process.cwd(), './credentials.json'),\n        tokenJsonPath: join(process.cwd(), './token.json'),\n        intervalSec: 10,\n        timeoutSec: 60\n    }]]\n    // ...\n};\n```\n\n## Service Options\n\n### credentialsJsonPath\nAbsolute path to a credentials JSON file.\n\nType: `string`\n\nRequired: `true`\n\n### tokenJsonPath\nAbsolute path to a token JSON file.\n\nType: `string`\n\nRequired: `true`\n\n### intervalSec\nThe interval between Gmail inbox checks.\n\nType: `number`\n\nDefault: `10`\n\nRequired: `false`\n\n### timeoutSec\nThe maximum time to wait for finding the email for the given filters.\n\nType: `number`\n\nDefault: `60`\n\nRequired: `false`\n\n\n## Writing tests\n\nIn your WebdriverIO test, you can now check if an email was received.\n\n```js\ndescribe('Example', () =\u003e {\n    it('Should check email', () =\u003e {\n        // perform some actions that will send an email to setup gmail account\n        const emails = await browser.checkInbox({ from: 'AccountSupport@ubi.com', subject: 'Ubisoft Password Change Request' });\n        expect(emails[0].body.html).toContain('https://account-uplay.ubi.com/en-GB/action/change-password?genomeid=')\n    })\n})\n```\n\n## `checkInbox` parameters\n\nThe command parameters require at least one of `from`, `to`, or `subject`:\n\n### `from`\nFilter on the email address of the receiver.\n\nType: `String`\n\n### `to`\nFilter on the email address of the sender.\n\nType: `String`\n\n### `subject`\nFilter on the subject of the email.\n\nType: `String`\n\n### `includeBody`\nSet to true to fetch decoded email bodies.\n\nType: `boolean`\n\n### `includeAttachments`\nSet to true to fetch the base64-encoded email attachments.\n\nType: `boolean`\n\n### `before`\nFilter messages received before the specified date.\n\nType: `Date`\n\n### `after`\nFilter messages received after the specified date.\n\nType: `Date`\n\n### `label`\nThe default label is 'INBOX', but can be changed to 'SPAM', 'TRASH' or a custom label. For a full list of built-in labels, see https://developers.google.com/gmail/api/guides/labels?hl=en\n\nType: `String`\n\n---\n\nFor more information on WebdriverIO see the [homepage](https://webdriver.io).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdriverio-community%2Fwdio-gmail-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebdriverio-community%2Fwdio-gmail-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebdriverio-community%2Fwdio-gmail-service/lists"}