saucelabs / sauce_bindings

Making test automation with Sauce Labs insanely simple
https://saucelabs.github.io/sauce_bindings
MIT License
23 stars 16 forks source link

Make public getSauceUsernamee() and getSauceAccessKey() #167

Open nadvolod opened 4 years ago

nadvolod commented 4 years ago

I'm trying to use these methods in one of my tests to read the values but they are private. A hinderance to users I believe.


    private String getSauceUsername() {
        if (this.getSystemProperty("SAUCE_USERNAME") != null) {
            return this.getSystemProperty("SAUCE_USERNAME");
        } else if (this.getEnvironmentVariable("SAUCE_USERNAME") != null) {
            return this.getEnvironmentVariable("SAUCE_USERNAME");
        } else {
            throw new SauceEnvironmentVariablesNotSetException("Sauce Username was not provided");
        }
    }

    private String getSauceAccessKey() {
        if (this.getSystemProperty("SAUCE_ACCESS_KEY") != null) {
            return this.getSystemProperty("SAUCE_ACCESS_KEY");
        } else if (this.getEnvironmentVariable("SAUCE_ACCESS_KEY") != null) {
            return this.getEnvironmentVariable("SAUCE_ACCESS_KEY");
        } else {
            throw new SauceEnvironmentVariablesNotSetException("Sauce Access Key was not provided");
        }
    }
titusfortner commented 4 years ago

I thought we decided that was a feature, not a bug since it was going to be all handled by ENV.

you could just do: System.getEnv("SAUCE_USERNAME")

What is the use case for getting it? We should be abstracting everything you can do with it...

nadvolod commented 4 years ago

@titusfortner I think the Set can be private. But the Get can be public. Use Cases: