Skip to content

Commit

Permalink
feat: set DriversPath via environment variable (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeBenting committed Jan 26, 2021
1 parent 771923b commit 9fc6c46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ browserOptions: # optional - will use default EasyRepro options if not set
width: 1920
height: 1080
startMaximized: false
driversPath: ChromeWebDriver # optional - [Recommended when running tests from Azure DevOps Microsoft-hosted agent](https://docs.microsoft.com/en-us/azure/devops/pipelines/test/continuous-test-selenium?view=azure-devops#decide-how-you-will-deploy-and-test-your-app)
applicationUser: # optional - populate if creating test data for users other than the current user
tenantId: SPECFLOW_POWERAPPS_TENANTID optional # mandatory
clientId: SPECFLOW_POWERAPPS_CLIENTID # mandatory
Expand All @@ -70,7 +71,7 @@ users: # mandatory
alias: a salesperson # mandatory
```

The URL, usernames, passwords, and application user details will be set from environment variable (if found). Otherwise, the value from the config file will be used. The browserOptions node supports anything in the EasyRepro `BrowserOptions` class.
The URL, driversPath, usernames, passwords, and application user details will be set from environment variable (if found). Otherwise, the value from the config file will be used. The browserOptions node supports anything in the EasyRepro `BrowserOptions` class.

### Writing feature files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ protected static TestConfiguration TestConfig
.Build()
.Deserialize<TestConfiguration>(File.ReadAllText(configPath));

testConfig.BrowserOptions.DriversPath = ConfigHelper.GetEnvironmentVariableIfExists(testConfig.BrowserOptions.DriversPath);

if (testConfig.BrowserOptions.DriversPath == Path.Combine(Directory.GetCurrentDirectory()))
{
if (Directory.GetFiles(testConfig.BrowserOptions.DriversPath, "*driver.exe").Length == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ browserOptions:
width: 1920
height: 1080
startMaximized: false
driversPath: ChromeWebDriver
applicationUser:
tenantId: POWERAPPS_SPECFLOW_BINDINGS_TEST_TENANTID
clientId: POWERAPPS_SPECFLOW_BINDINGS_TEST_CLIENTID
Expand Down

0 comments on commit 9fc6c46

Please sign in to comment.