npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

autotest-mail-reader

v2.0.0

Published

Provide possibility to read user mails, set in test framework

Downloads

5

Readme

Autotest mail reader

This is a simple module for Autotest framework. It is give possibility to handle your email and use it data at autotest scenarios. All what you need to do is import one of main instance and work with it like a function. you have to enter

💬 Note from maintainers

This module is purely for demonstration and educational purposes. Its setup and configuration resemble typical testing problem, but it's not a full-fledged product. Use this app to learn, experiment, tinker, and practice application testing with email witout UI.

Happy Testing!

What new:

  • Created a single entry point through the Read Messages class;
  • Basic initialization of the object is moved to the options object;
  • Added the ability to select a method for processing the received information (regex or pure data)

Features

Built with Imap-simple, Lodash and TypeScript

How to create google app password

An app password is a 16-digit code that gives an unsafe app or device access to your Google account. These passwords can only be used if 2-Step Verification is enabled. you can find information on how to create and implement it here.

Functions settings fields

To access your mail data, you need to pass a number of required parameters in the option object

ReadOptions

interface ReadOptions {
    email: string,
    password: string,
    boxName: string,
    searchCriteria: any[],
    markSeen?: boolean
}

Optionals

regexSearchExpression ? : RegExp

Examples

Example with console output

import {ReadMessages} from "autotest-mail-reader"

const options = {
    email: "[email protected]",
    password: "your_app_password",
    boxName: "INBOX",
    searchCriteria: ["UNSEEN"],
    markSeen: false
}
const body = () => new ReadMessages(options).textFromBody()
body().then((data: any) => {
    console.log(`data: ${data[0]}`)
})

Cypress with TypeScript

You need to change file cypress/plugin/index.ts like:

import {ReadMessages} from "autotest-mail-reader"

export default (on, config) => {
    on("task", {
        getLastMessages() {
            const options = {
                email: "[email protected]",       // folder in mail to open
                password: "your_app_password", // google app password
                boxName: "INBOX",              // mail box name 
                searchCriteria: ["UNSEEN"],    // array, where you need to provide search criterias
                markSeen: false                // if true mark your receive email read
            }
            const regex = search_information_at_regex_viev // exampl /\d{3}/             
            return new ReadMessages(options, regex).textFromSubject()
        }
    })
}

After that you can use this Cypress task

 it("enter data received from email", () => {
    cy.visit("visit sorce")
    cy.task("getLastMessages").then((data: any) => {
        cy.get("an input field or something similar")
            .type(data[0])
    })
})

API framework

TO - DO

License

license