Reputation: 2618
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.
In order to ensure that the form doesn't break, before the mail was sent, then I'm planning to do it using Nightwatchjs.
This is the part that I'm not sure how to do... Verifying the sending/receiving part.
So if my main e-mail was [email protected], then I was thinking, that if I could setup an extra mail, like [email protected], 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?
Upvotes: 3
Views: 1694
Reputation: 7900
In your current scenario, there are 3 important things which you should consider while testing.
But before that, don't completely rely upon emails to alert you. Make sure whenever a form is submitted, backend persists the data in some DB and then email is triggered or both can happen parallelly.
Automating UI/functional tests can be time-consuming and also expensive. So I would suggest you break down your testing in two sections.
Upvotes: 2