Github apps can trigger automated deployments at each commit or pull request and notify other integrations about it. Those integrations in turn, may trigger additional checks on those newly deployed environments. This handy workflow is enabled by the Github Deployment API and is currently supported by Zeit Now and Heroku.
Frontend Robot can hook into the Github Deployment API and automatically trigger a test suite run for each new successful deployment and display the results alongside the commit or PR that originated the deployment.
Connecting a Github repository to a test suite allows Frontend Robot to listen for new deployments created by other third party apps and automatically run the suite after the deployment successfully completes.
To connect a Github repository to a test suite, navigate to the suite’s Settings tab:
Then scroll down to the GitHub Deployment API trigger section:
If you have not connected your Github account yet, you can do it now. Just click on the Connect Github account button to be redirected to Github to authorize the Frontend Robot app.
Once Github is connected to your account, you can browse for the repository to connect. But before you can do that you must have installed the Frontend Robot app into the Github organization. To do that click on the link under the Organization selection field:
Once you have selected the desired organization and repository on Github you can then insert the name of the environment that will trigger the run of the suite.
Click Connect and we are done.
Now when a third party integration will complete the deployment of a commit or pull request on Github, Frontend Robot will start the tests in the suite and attach the results to the commit or pull request that triggered the deployment.
Some integrations, such as Zeit now, will give to each new deployment a different URL, and that may be a problem if you hardcoded the starting URL for your tests. To go around that, Frontend Robot will expose a variable called _ENVIRONMENT_URL
representing the URL of the new deployment, which you can use in your tests as starting URL.
TIP: If you want to have a default starting URL to use to run your tests manually from Frontend Robot (where the variable
_ENVIRONMENT_URL
is not defined) you can use the expression_ENVIRONMENT_URL || "https://your-default-env-url.com"
.