Sign in to Percy and create a new project. You can name the project "todo" if you'd like. After you've created the project, you'll be shown a token environment variable.
In the shell window you're working in, export the token environment variable:
Unix
$ export PERCY_TOKEN="<your token here>"Windows
$ set PERCY_TOKEN="<your token here>"
# PowerShell
$ $Env:PERCY_TOKEN="<your token here>"npm install --save-dev @percy/cli
We can pass the URL in runtime with the below command
npx percy exec -- mvn test -Durl=https://www.browserstack.com/
To execute the Test in Non-Prod Environment use the below command:
npx percy exec -- mvn test -Durl=https://k8s.bsstag.com/
Set PERCY_BRANCH to Production PERCY_BRANCH=production npx percy exec -- mvn test
Change the URL in TestWebsite.java file
PERCY_BRANCH=staging PERCY_TARGET_BRANCH=production npx percy exec -- mvn test
Verify the Build in Percy