Skip to content

[java] validate capturePerformance requirements in build() #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ public class ChromeConfigurations extends VDCConfigurations<ChromeConfigurations
public ChromeConfigurations setCapturePerformance() {
sauceOptions.sauce().setExtendedDebugging(true);
sauceOptions.sauce().setCapturePerformance(true);
if (sauceOptions.sauce().getName() == null) {
throw new InvalidSauceOptionsArgumentException("Need to call `setName()` before `setCapturePerformance`");
}
return this;
}

Expand All @@ -43,4 +40,12 @@ public ChromeConfigurations setExtendedDebugging() {
sauceOptions.sauce().setExtendedDebugging(true);
return this;
}

@Override
public SauceOptions build() {
if (sauceOptions.sauce().getCapturePerformance() && sauceOptions.sauce().getName() == null) {
throw new InvalidSauceOptionsArgumentException("Unable to setCapturePerformance() without also doing setName()");
}
return super.build();
}
}