This project uses gmail-tester with Google API and OAuth to check the inbox for specific emails using Node.js.
- Connects to Gmail using Google API & OAuth.
- Searches for emails matching specific criteria (subject, sender, recipient).
- Waits for emails to arrive within a specified time frame.
- Prints results in the terminal.
git clone https://github.com/velespitt/test-automation
cd test-automation/mail-testnpm install gmail-testerYou need credentials.json and gmail_token.json for authentication.
- Follow this guide to generate your credentials.json.
- Run authentication to generate gmail_token.json:
node gmail-tester/init.js
node mail-test.js- Error: Invalid Credentials? Ensure
credentials.jsonandgmail_token.jsonare correctly set up. - Email not found? Check if the email exists and matches the filters.
- Permission issues? Enable Gmail API in your Google Cloud Console.
Contributions are welcome! If you'd like to improve this project:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License.
✅ Happy Coding!