QA Wolf provides a getInbox method that returns:
- email: your team's email address
- waitForMessage: function that waits for an email message to the test address
Let's use getInbox and waitForMessage in our test.
Below we 1) get an email address, 2) fill out the form, and 3) wait for a message and assert it's content.
const { context } = await launch();
const page = await context.newPage();
await page.goto("https://ismyemailworking.com");
// use our test email to fill out the form
const { email, waitForMessage } = getInbox();
await page.fill("#verify_email", email);
await page.click("#content_cob_check");
// wait for a message and check it starts with "Congratulations"
const message = await waitForMessage();
console.log(message);
assert(message.text.startsWith("Congratulations"));
QA Wolf - Ship confidently
Set up browser tests in minutes to discover bugs before your users do
πΊ What is QA Wolf?
QA Wolf helps you create, run, and debug end-to-end tests directly from the browser. We aspire to be the easiest way for developers to set up browser tests.
We found browser testing too difficult and often gave up on it entirely in our previous jobs. We built QA Wolf for people like us who want to ship confidently
π€ Is QA Wolf a good fit for you?
|
|
---|---|
|
|
|
|
|
Top comments (0)