// JavaScript example
async function testSignupFlow() {
// Create temp inbox
const inbox = await mailhook.createRandomAddress();
// Submit signup form
await page.fill('#email', inbox.address);
await page.click('#submit');
// Wait for and retrieve OTP
const emails = await mailhook.pollInbox(inbox.id, {
timeout: 30000
});
// Extract OTP from email
const otp = emails[0].textBody.match(/\d{6}/)[0];
// Complete verification
await page.fill('#otp', otp);
await page.click('#verify');
// Assert success
expect(await page.url()).toContain('/dashboard');
}