-
Notifications
You must be signed in to change notification settings - Fork 16
Visual testing API #182
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
Visual testing API #182
Conversation
Issues
======
- Added 8
Complexity increasing per file
==============================
- java/src/main/java/com/saucelabs/saucebindings/visual/SauceVisualOptions.java 4
- java/src/test/java/com/saucelabs/saucebindings/integration/VisualE2ETest.java 1
- java/src/test/java/com/saucelabs/saucebindings/SauceVisualSession.java 3
See the complete overview on Codacy |
public class SauceVisualOptions { | ||
private final MutableCapabilities visualCapabilities; | ||
private String visualProjectName; | ||
private String viewportSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Perhaps 'viewportSize' could be replaced by a local variable.
|
||
public class SauceVisualOptions { | ||
private final MutableCapabilities visualCapabilities; | ||
private String visualProjectName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused private fields such as 'visualProjectName'.
public class SauceVisualOptions { | ||
private final MutableCapabilities visualCapabilities; | ||
private String visualProjectName; | ||
private String viewportSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused private fields such as 'viewportSize'.
import org.openqa.selenium.MutableCapabilities; | ||
|
||
public class SauceVisualOptions { | ||
private final MutableCapabilities visualCapabilities; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Perhaps 'visualCapabilities' could be replaced by a local variable.
|
||
@Getter | ||
@Setter | ||
private String hubUrl = "https://hub.screener.io/wd/hub"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import com.saucelabs.saucebindings.visual.SauceVisualOptions; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.var; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'lombok.var'
|
||
public class SauceVisualOptions { | ||
private final MutableCapabilities visualCapabilities; | ||
private String visualProjectName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Perhaps 'visualProjectName' could be replaced by a local variable.
|
||
import com.saucelabs.saucebindings.SauceVisualSession; | ||
import com.saucelabs.saucebindings.visual.SauceVisualOptions; | ||
import lombok.var; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy found an issue: Avoid unused imports such as 'lombok.var'
Should we have a separate session class for Visual? We could do something as simple as:
We don't necessarily need a VisualOptions class either:
We could even use a
|
@titusfortner I really like your approach. It's certainly cleaner. I went to separate classes because it seemed like that's the same direction we were going in mobile. So I tried to keep it similar. Regardless, I do want to iron out the use case below. To me, there is ambiguity when using/re-using methods because it means that they will have different behavior depending on whether you are using functional or visual, potentially breaking SRP.
This seems like a blend of both and solves the ambiguity:
|
Superceded by #256 |
This is PR designed to iron out the visual API. Once we agree on it we can work on making it happen.
Here is a real world example of a current usage of Screener for visual testing https://github.com/saucelabs-training/demo-java/blob/master/java8/visual-e2e/visuale2e.junit4.examples/src/test/java/com/saucedemo/VisualCrossPlatformTests.java