I just noticed your question while doing another search and thought I should respond. I have been doing this type of thing for a few years now in a productions system where I use selenium checks as synthetic monitors to run specific test cases against commerce websites and then return the success/failure and exec time into a monitoring system.
In order to prevent having to checkout code changes test them locally and then promote from branch to master , I set up git Ci to test the checks that were pushed to a remote branch (against a test system), if they passed the Ci reports green and then all I need to do is review and accept the merge request.
The way the system works is controlled by a couple of scripts that are run by the ci - first script pulls the selenium java and compiles (pass/fail). If it passes the second script , uses sed to replace the host/port(from prod host port to test host port) , compiles and runs the selenium check against the test system (pass/fail)- at that point if its green I have branch code that will work and just need to accept merge request. The merge to master is the only manual stop performed.. as once the merge to master branch happens there is a cron controlled script on prod which tests master every 5minutes for changes and if found pulls the new jar with the new checks to prod where they are being run regularly (also by cron).
I trigger the ci pipeline (which tests any changes) on push events because then I know all the time if a branch is green and as such ok to merge.
I did not implement an automatic merge to master step as I wanted to have a human review first before going to prod. I would expect that the merge to master could also be automated if that was needed.
The basic setup is :
- local dev environment on the workstation with git/java/available selenium hub to test with.
- test environment is two node hub in aws ecs (you can setup this with docker too, then migrate to aws)
- prod environment is in aws ec2 stand allow med size server (the git ci runner is also on the prod environment and runs the tests against the selenium test environment.)