Frontend Robot can integrate with Netlify thanks to smart triggers. You can automatically run a test suite just after a successful deployment and if your code is stored on Github, you can see the test results beside the commit or PR that triggered the deployment.
To automatically run a test suite after a deployment, we need to add Frontend Robot’s smart trigger as an outgoing webhook on Netlify.
First, go to your project’s Site Settings on Netlify.
Then click on Build and Deploy on the menu and scroll down to the Deploy Notifications sections.
Now, let’s add a new outgoing webhook. Click on Add Notification and select Outgoing Webook from the menu.
In the modal that opens, select Deploy succeeded for the Event to listen for field. In the URL to notify field, copy/paste the smart trigger URL for the test suite you want to run after each deploy. Follow the instructions in the smart trigger documentation to obtain the URL for a test suite. You can leave the JWT Secret Token field empty. Click Save and we are done!
Now each time Netlify will complete the deployment of your project, Frontend Robot will run the test suite linked to the smart trigger.
TIP: in your tests instead of hardcoding your deployment’s URL, you can use the built-in variable
${_ENVIRONMENT_URL}
, which is passed to the test suite every time the smart trigger is invoked from Netlify. If you still want to run the test suite manually, you can specify a default deployment url by using the expression${_ENVIRONMENT_URL || "https://your-default-env-url.com"}
If Netlify is deploying your project from Github, you can attach the results of your Frontend Robot tests to the commit or PR that originated the deploy.
To enable the feature, all you have to do is connecting the Github organization of the repo to your Frontend Robot organization. Go to the organization’s settings on Frontend Robot and then click on the Integrations tab.
Click on Connect Organization and follow the instructions. For convenience we recommend to allow access to all the repositories on the organization.