pageType);
11 |
12 | static PageFactory createInstanceFor(Browser browser) {
13 | return new ByteBuddyPageFactory(browser);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/webtester-support-junit4/src/main/java/info/novatec/testit/webtester/junit/exceptions/NotOfInjectableFieldTypeException.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.junit.exceptions;
2 |
3 | import java.lang.reflect.Field;
4 |
5 |
6 | @SuppressWarnings("serial")
7 | public class NotOfInjectableFieldTypeException extends IllegalTestClassStructureException {
8 |
9 | public NotOfInjectableFieldTypeException(Field field) {
10 | super("the configuration value field '" + field
11 | + "' is not of an injectable type! Injectable types are: Boolean, Integer, Long, Float, Double and String");
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/webtester-core/src/main/java/info/novatec/testit/webtester/waiting/Sleeper.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.waiting;
2 |
3 | /**
4 | * Implementations of this interface can be used to trigger a 'sleep' state for a certain amount of time.
5 | *
6 | * @since 2.0
7 | */
8 | public interface Sleeper {
9 | /**
10 | * Sleep for the given amount of milliseconds.
11 | *
12 | * @param milliseconds the milliseconds to sleep
13 | * @throws InterruptionException in case the sleep operation is interrupted
14 | * @since 2.0
15 | */
16 | void sleep(long milliseconds) throws InterruptionException;
17 | }
18 |
--------------------------------------------------------------------------------
/webtester-core/src/main/java/info/novatec/testit/webtester/events/AbstractEvent.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.events;
2 |
3 | import java.time.LocalDateTime;
4 |
5 | /**
6 | * Base class for all events.
7 | *
8 | * It stores the event's creation timestamp as a property.
9 | *
10 | * @see Event
11 | * @see EventListener
12 | * @see EventSystem
13 | * @since 2.0
14 | */
15 | public abstract class AbstractEvent implements Event {
16 |
17 | private final LocalDateTime timestamp = LocalDateTime.now();
18 |
19 | @Override
20 | public LocalDateTime getTimestamp() {
21 | return timestamp;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/webtester-support-assertj3/src/main/java/info/novatec/testit/webtester/support/assertj/assertions/pagefragments/PageFragmentAssert.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.support.assertj.assertions.pagefragments;
2 |
3 | import info.novatec.testit.webtester.pagefragments.PageFragment;
4 |
5 |
6 | /**
7 | * Contains assertions for all {@link PageFragment page fragments}.
8 | *
9 | * @since 2.0
10 | */
11 | public class PageFragmentAssert extends AbstractPageFragmentAssert {
12 |
13 | public PageFragmentAssert(PageFragment actual) {
14 | super(actual, PageFragmentAssert.class);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/webtester-support-junit5/src/main/java/info/novatec/testit/webtester/junit5/internal/TestClassModelFactory.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.junit5.internal;
2 |
3 | /**
4 | * Implementations of this interface are used to create {@link TestClassModel} instances.
5 | *
6 | * @since 2.1
7 | */
8 | public interface TestClassModelFactory {
9 |
10 | /**
11 | * Creates a new {@link TestClassModel} for the given {@code testClass}.
12 | *
13 | * @param testClass the class to create the model from
14 | * @return the created model
15 | * @since 2.1
16 | */
17 | TestClassModel create(Class> testClass);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/webtester-core/src/main/java/info/novatec/testit/webtester/waiting/TimeoutException.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.waiting;
2 |
3 | import info.novatec.testit.webtester.WebTesterException;
4 |
5 |
6 | /**
7 | * This {@link WebTesterException} is thrown in case a wait operation timed out.
8 | *
9 | * @see Wait
10 | * @see WaitUntil
11 | * @since 2.0
12 | */
13 | public class TimeoutException extends WebTesterException {
14 |
15 | public TimeoutException(String message) {
16 | super(message);
17 | }
18 |
19 | public TimeoutException(String message, Throwable cause) {
20 | super(message, cause);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/webtester-support-junit5/src/main/java/info/novatec/testit/webtester/junit5/extensions/NoManagedBrowserException.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.junit5.extensions;
2 |
3 | import info.novatec.testit.webtester.browser.Browser;
4 |
5 |
6 | /**
7 | * This exception is thrown in case at least one managed {@link Browser} is needed in order to execute the operations of an
8 | * extension but non was defined.
9 | *
10 | * @since 2.1
11 | */
12 | public class NoManagedBrowserException extends TestClassFormatException {
13 |
14 | public NoManagedBrowserException() {
15 | super("There is no managed browser to use!");
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/webtester-support-junit4/src/main/java/info/novatec/testit/webtester/junit/exceptions/NoUniquePrimaryBrowserException.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.junit.exceptions;
2 |
3 | import info.novatec.testit.webtester.junit.annotations.Primary;
4 |
5 |
6 | @SuppressWarnings("serial")
7 | public class NoUniquePrimaryBrowserException extends IllegalTestClassStructureException {
8 |
9 | private static final String MESSAGE =
10 | "There is no unique primary browser! @" + Primary.class.getSimpleName() + " must not be declared more then once!";
11 |
12 | public NoUniquePrimaryBrowserException() {
13 | super(MESSAGE);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/webtester-core/src/main/java/info/novatec/testit/webtester/WebTesterException.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester;
2 |
3 | /**
4 | * Base exception type for all exceptions directly thrown by WebTester.
5 | *
6 | * @since 2.0
7 | */
8 | @SuppressWarnings("serial")
9 | public class WebTesterException extends RuntimeException {
10 |
11 | protected WebTesterException(String message) {
12 | super(message);
13 | }
14 |
15 | protected WebTesterException(String message, Throwable cause) {
16 | super(message, cause);
17 | }
18 |
19 | protected WebTesterException(Throwable cause) {
20 | super(cause);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/webtester-core/src/test/resources/html/nested-page-fragments.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | ContentArea Test
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/webtester-core/src/test/resources/html/pagefragments/div.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | DIV Test Page
9 | This page contains elements for testing the functionality of the Div page fragment class.
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | | A DIV |
18 | This is a DIV |
19 |
20 |
21 | | Not a DIV |
22 | This is not a DIV |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/webtester-core/src/main/java/info/novatec/testit/webtester/css/CssProperties.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.css;
2 |
3 | import lombok.experimental.UtilityClass;
4 |
5 |
6 | /**
7 | * This class provides constants for CSS property names used by WebTester's features.
8 | *
9 | * @see StyleChanger
10 | * @since 2.0
11 | */
12 | @UtilityClass
13 | public class CssProperties {
14 |
15 | public static final String BACKGROUND_COLOR = "backgroundColor";
16 |
17 | public static final String OUTLINE_COLOR = "outlineColor";
18 | public static final String OUTLINE_STYLE = "outlineStyle";
19 | public static final String OUTLINE_WIDTH = "outlineWidth";
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/webtester-support-junit5/src/main/java/info/novatec/testit/webtester/junit5/extensions/configuration/unmarshaller/DefaultUnmarshaller.java:
--------------------------------------------------------------------------------
1 | package info.novatec.testit.webtester.junit5.extensions.configuration.unmarshaller;
2 |
3 | import java.util.Optional;
4 |
5 | import info.novatec.testit.webtester.config.Configuration;
6 |
7 |
8 | public class DefaultUnmarshaller implements ConfigurationUnmarshaller