Create the BROWSER environment variable
Learn how to create the BROWSER environment variable for the tests using a bash task.
We'll cover the following...
Our pipeline only cleans the artifacts and compiles the code for now.
To run the tests, we need to provide the browser name as an environment variable so the driver
can be created in the setUp()
method of the test class:
Press + to interact
@BeforeMethodpublic void setUp(){String browserName = System.getenv("BROWSER");this.driver = DriverFactory.getDriver(browserName);}
Add the environment variable
The environment variable is added to the pipeline ...