diff --git a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesModule.java b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesModule.java
index 22194cc1..d013b7ed 100644
--- a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesModule.java
+++ b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesModule.java
@@ -22,6 +22,9 @@
import com.applitools.eyes.selenium.Eyes;
import com.google.inject.AbstractModule;
+/**
+ * Eyes Guice module. Provides an {@link Eyes} instance.
+ */
public class EyesModule extends AbstractModule {
@Override
diff --git a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesProvider.java b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesProvider.java
index 17cbf691..897bb01d 100644
--- a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesProvider.java
+++ b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/guice/EyesProvider.java
@@ -25,6 +25,16 @@
import com.google.inject.Provider;
import com.google.inject.name.Named;
+/**
+ * Provides a thread-scoped {@link Eyes} instance. Bound in {@link EyesModule}.
+ *
+ * Requires {@code eyes.apiKey} property.
+ *
+ * Additional configurable options:
+ *
+ * Example usage: + *
+ * public class ExampleTest { + * @Rule + * @Inject + * public WithEyes withEyes; + * + * public void test() { + * // test actions + * withEyes.getEyes().checkWindow("Example checkpoint"); + * } + * } + *+ */ public class WithEyes implements TestRule { private final WebDriver webDriver; @@ -42,14 +59,23 @@ public WithEyes(WebDriver webDriver, Eyes eyes, @Named("eyes.appName") String ap this.appName = appName; } + /** + * @return the avaialable WebDriver instance + */ public WebDriver getWebDriver() { return webDriver; } + /** + * @return the configured and initialized {@link Eyes} instance. + */ public Eyes getEyes() { return eyes; } + /** + * {@inheritDoc} + */ @Override public Statement apply(Statement base, Description description) { return new Statement() { diff --git a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyes.java b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyes.java index 33cd5560..b898bab4 100644 --- a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyes.java +++ b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyes.java @@ -26,6 +26,9 @@ import org.junit.jupiter.api.extension.ExtendWith; +/** + * Meta-annotation enabling the {@link WithEyesExtension}. + */ @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @ExtendWith(WithEyesExtension.class) diff --git a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyesExtension.java b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyesExtension.java index 512e10f7..bb0fe7fa 100644 --- a/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyesExtension.java +++ b/bb-eyes/src/main/java/com/cognifide/qa/bb/eyes/junit5/WithEyesExtension.java @@ -34,8 +34,16 @@ import com.google.inject.Injector; import com.google.inject.Key; +/** + * JUnit 5 extension that provides {@link Eyes} capabilities. + */ public class WithEyesExtension implements BeforeEachCallback, AfterEachCallback { + /** + * Opens an {@link Eyes} session before the test. + *