pentf
    Preparing search index...

    Function getMail

    • Retrieve and delete an email.

      Parameters

      • config: TaskConfig

        The pentf configuration object.

      • since: Date

        Earliest time the email can be sent. (To avoid finding the email of a prior test.)

      • to: string

        receiveer email address (config.email if you have just one email address, often the result of makeRandomEmail)

      • subjectContains: string | ((string: any) => boolean)

        Search string for the subject, or a callable to execute to match.

      • wait_times: number[] = ...

        How long to wait between checking email. By default, we wait about 3 minutes total.

      Returns Object

      Email object with html and text properties.

      const email = makeRandomEmail(config, 'myTestCase');
      const start = new Date();
      await ... // register with email
      const welcomeMail = await getMail(config, start, email, 'Welcome');
      assert.strictEqual(welcomeMail.text.includes('Hello'));
      assert.strictEqual(welcomeMail.html.includes('<p>Hello'));