https://github.com/bugnificent/mail-test
Simple inbox test with Node.js using Google API/OAuth 2.0.
https://github.com/bugnificent/mail-test
gmail-api javascript node-js npm
Last synced: 3 months ago
JSON representation
Simple inbox test with Node.js using Google API/OAuth 2.0.
- Host: GitHub
- URL: https://github.com/bugnificent/mail-test
- Owner: bugnificent
- License: mit
- Created: 2025-01-31T11:46:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-31T11:48:47.000Z (4 months ago)
- Last Synced: 2025-02-23T19:55:14.726Z (3 months ago)
- Topics: gmail-api, javascript, node-js, npm
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/gmail-tester
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gmail Tester with Google API & OAuth (Node.js)
This project uses `gmail-tester` with Google API and OAuth to check the inbox for specific emails using **Node.js**.
## 📌 Features
- 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.## 🚀 Installation
### 1️⃣ Clone the repository
```sh
git clone https://github.com/velespitt/test-automation
cd test-automation/mail-test
```### 2️⃣ Install dependencies
```sh
npm install gmail-tester
```### 3️⃣ Set up Google API credentials
You need **credentials.json** and **gmail_token.json** for authentication.- Follow [this guide](https://developers.google.com/gmail/api/quickstart/nodejs) to generate your **credentials.json**.
- Run authentication to generate **gmail_token.json**:
```sh
node gmail-tester/init.js
```## 📝 Usage
### Run the script to check inbox
```sh
node mail-test.js
```
## 🔧 Troubleshooting
- **Error: Invalid Credentials?** Ensure `credentials.json` and `gmail_token.json` are 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.## 🤝 Contributing
Contributions are welcome! If you'd like to improve this project:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit your changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Open a pull request.## 📜 License
This project is licensed under the [MIT License](LICENSE).---
✅ Happy Coding!