Skip to content

A set of functions that could be helpful when testing email verification

Notifications You must be signed in to change notification settings

AHaydar/gmail-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail helper

Email verification using gmail api

A set of functions that can be used to interact with a gmail account (e.g. retrieve labels, messages, delete messages, etc.). Could be used in E2E tests to verify emails sent from the system under test. More details at: https://medium.com/@ali.haydar/email-verification-gmail-helper-utility-2e6858d83244

  • Note: this project is a poc at the moment. It is not complete and misses a few functions to be fully functional (e.g. list Messages). Contributions are most welcome

Setup

Pre-requisites

Installation

  • Clone this repository: git clone https://github.com/AHaydar/gmail-helper.git
  • Run npm install to install the used node modules

Usage example

When doing E2E tests, lots of times the email verification are skipped because of the hassle of implementation, and the dependencies on external services (e.g. an email client).

// retrieve the content of an email message
import { getMessageContent } from 'gmailHelper';

const messageContent = getMessageContent('123') // 123 is the ID of the message

expect(messageContent).to.have.string('bar'); // This requires to have Chai installed and imported in this file

Development setup

Same as Installation - to re-create the project from scratch check the following post: https://medium.com/@ali.haydar/email-verification-gmail-helper-utility-2e6858d83244

Meta

Ali Haydar – @Alee_Haydar

This project does not require a Contributor License Agreement.

Contributing

  1. Fork it (https://github.com/AHaydar/gmail-helper/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

About

A set of functions that could be helpful when testing email verification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published