Skip to content

Commit

Permalink
Browserstack plugin now allows either BROWSERSTACK_USER or BROWSERSTA…
Browse files Browse the repository at this point in the history
…CK_USERNAME, and BROWSERSTACK_KEY or BROWSERSTACK_ACCESS_KEY environment variables
  • Loading branch information
wakaleo committed Dec 4, 2023
1 parent 3b6549a commit 62b5db1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ public static BrowserStackCredentials from(EnvironmentVariables environmentVaria

public String getUser() {
String userDefinedInSerenityConf = EnvironmentSpecificConfiguration.from(environmentVariables).getOptionalProperty("browserstack.user").orElse("");
return Optional.ofNullable(environmentVariables.getValue("BROWSERSTACK_USER")).orElse(userDefinedInSerenityConf);
Optional<String> browserstackUser = Optional.ofNullable(environmentVariables.getValue("BROWSERSTACK_USER"));
Optional<String> browserstackUsername = Optional.ofNullable(environmentVariables.getValue("BROWSERSTACK_USERNAME"));
return browserstackUser.orElse(browserstackUsername.orElse(userDefinedInSerenityConf));
}

public String getAccessKey() {
String keyDefinedInSerenityConf = EnvironmentSpecificConfiguration.from(environmentVariables).getOptionalProperty("browserstack.key").orElse("");
return Optional.ofNullable(environmentVariables.getValue("BROWSERSTACK_KEY")).orElse(keyDefinedInSerenityConf);
Optional<String> browserstackKey = Optional.ofNullable(environmentVariables.getValue("BROWSERSTACK_KEY"));
Optional<String> browserstackAccessKey = Optional.ofNullable(environmentVariables.getValue("BROWSERSTACK_ACCESS_KEY"));
return browserstackKey.orElse(browserstackAccessKey.orElse(keyDefinedInSerenityConf));
}

public boolean areDefined() {
Expand Down

0 comments on commit 62b5db1

Please sign in to comment.