Tuesday, 2 April 2019

Checking if contact form's works (automated testing)

I have a website with a contact formular. It's vital for my business, that I get all messages, that are being sent by this formular. And I've seen SOOO many examples of contact forms breaking due to dependency-updates or script collisions.

So my plan was to make an automated test, that will fill out a contact formular every day, ensuring that there's no errors. And also (and most importantly), checking that the message is received in the other end.

I'm using WordPress Formidable forms, but it's okay, if it's something that needs to be custom made. I've previously used Contact Form 7 with Flamingo, which was good. But the downside was, that if I didn't receive an email, then it failed silently, - and then I could recover non-received messages with Flamingo. And I need to know immidiately, if messages doesn't arrive in my inbox.

Checking the front-end

In order to ensure that the form doesn't break, before the mail was sent, then I'm planning to do it using Nightwatchjs.

Checking that the message is received

This is the part that I'm not sure how to do... Verifying the sending/receiving part.

So if my main e-mail was inbox@example.org, then I was thinking, that if I could setup an extra mail, like robot@example.org, and then send all mails to both emails, - and then... Ehm... Do something with that?

How do I do this? Or are there any frameworks for this, that will make it easier?



from Checking if contact form's works (automated testing)

No comments:

Post a Comment