public class Detective extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Detective.LogLevel |
| Modifier and Type | Field and Description |
|---|---|
static String |
PARAMETER_NAME_USER_MESSAGES |
| Constructor and Description |
|---|
Detective() |
| Modifier and Type | Method and Description |
|---|---|
static geb.Browser |
_browser(geb.Browser browser,
groovy.lang.Closure script) |
static geb.Browser |
_browser(groovy.lang.Closure script)
Creates a new browser object via the default constructor and executes the closure
with the browser instance as the closure's delegate.
|
static <T> org.hamcrest.Matcher<T> |
allOf(org.hamcrest.Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.
|
static <T> org.hamcrest.Matcher<T> |
anyOf(org.hamcrest.Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches Any of the specified matchers.
|
static <T> void |
assertThat(String reason,
T actual,
org.hamcrest.Matcher<T> matcher)
Asserts that
actual satisfies the condition specified by
matcher. |
static <T> void |
assertThat(T actual,
org.hamcrest.Matcher<T> matcher)
Asserts that
actual satisfies the condition specified by
matcher. |
static TraceRecord |
debug(String message) |
static EchoTask |
echoTask() |
static <T> org.hamcrest.Matcher<T> |
equalTo(T operand) |
static TraceRecord |
error(String message) |
static TraceRecord |
error(String message,
Throwable e) |
static DslBuilder |
feature() |
static com.typesafe.config.Config |
getConfig() |
static List<String> |
getUserMessage(Parameters params) |
static HttpClientTask |
httpclientTask() |
static TraceRecord |
info(String message) |
static groovy.json.JsonBuilder |
jsonBuilder() |
static groovy.json.JsonBuilder |
jsonBuilder(groovy.lang.Closure c) |
static Object |
jsonParser(String json) |
static void |
logUserMessage(Parameters params,
String msg)
The message is not only print into console, but aslo added into the output result section
|
static void |
logUserMessageAsTable(Parameters params,
String title,
Object table) |
static geb.Browser |
newBrowser()
The browser is the centre of Geb.
|
static <T> org.hamcrest.Matcher<T> |
not(T value) |
static String |
randomId() |
static TraceRecord |
record(TraceRecord record) |
static TraceRecord |
recordLog(Detective.LogLevel level,
String message) |
static DslBuilder |
story() |
static <T> org.hamcrest.Matcher<T> |
subsetOf(T operand) |
static groovy.xml.MarkupBuilder |
xmlBuilder(groovy.lang.Closure c) |
static Object |
xmlParser(String xml) |
public static final String PARAMETER_NAME_USER_MESSAGES
public static DslBuilder story()
public static DslBuilder feature()
public static groovy.json.JsonBuilder jsonBuilder()
public static groovy.json.JsonBuilder jsonBuilder(groovy.lang.Closure c)
public static groovy.xml.MarkupBuilder xmlBuilder(groovy.lang.Closure c)
public static TraceRecord record(TraceRecord record)
public static TraceRecord recordLog(Detective.LogLevel level, String message)
public static TraceRecord info(String message)
public static TraceRecord error(String message)
public static TraceRecord error(String message, Throwable e)
public static TraceRecord debug(String message)
public static void logUserMessage(Parameters params, String msg)
public static void logUserMessageAsTable(Parameters params, String title, Object table)
public static List<String> getUserMessage(Parameters params)
public static EchoTask echoTask()
public static HttpClientTask httpclientTask()
public static <T> org.hamcrest.Matcher<T> equalTo(T operand)
public static <T> org.hamcrest.Matcher<T> subsetOf(T operand)
public static <T> org.hamcrest.Matcher<T> not(T value)
public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? super T>... matchers)
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))public static <T> org.hamcrest.Matcher<T> anyOf(org.hamcrest.Matcher<? super T>... matchers)
assertThat("myValue", anyOf(startsWith("my"), containsString("Val")))public static <T> void assertThat(T actual,
org.hamcrest.Matcher<T> matcher)
actual satisfies the condition specified by
matcher. If not, an AssertionError is thrown with
information about the matcher and failing value. Example:
assertThat(0, is(1)); // fails:
// failure message:
// expected: is <1>
// got value: <0>
assertThat(0, is(not(1))) // passes
T - the static type accepted by the matcher (this can flag obvious
compile-time problems such as assertThat(1, is("a"))actual - the computed value being comparedmatcher - an expression, built of Matchers, specifying allowed
valuesCoreMatchers,
org.junit.matchers.JUnitMatcherspublic static <T> void assertThat(String reason, T actual, org.hamcrest.Matcher<T> matcher)
actual satisfies the condition specified by
matcher. If not, an AssertionError is thrown with
the reason and information about the matcher and failing value. Example:
:
assertThat("Help! Integers don't work", 0, is(1)); // fails:
// failure message:
// Help! Integers don't work
// expected: is <1>
// got value: <0>
assertThat("Zero is one", 0, is(not(1))) // passes
T - the static type accepted by the matcher (this can flag obvious
compile-time problems such as assertThat(1, is("a"))reason - additional information about the erroractual - the computed value being comparedmatcher - an expression, built of Matchers, specifying allowed
valuesCoreMatchers,
org.junit.matchers.JUnitMatcherspublic static String randomId()
public static com.typesafe.config.Config getConfig()
public static geb.Browser newBrowser()
WebDriver implementation and references
a Page object that provides access to the content.
Browser objects dynamically delegate all method calls and property read/writes that it doesn't implement to the current
page instance via propertyMissing() and methodMissing().
If a call come from This class, it resolved first
Then get.Browser
Then currentPage
Browserpublic static geb.Browser _browser(groovy.lang.Closure script)
public static geb.Browser _browser(geb.Browser browser,
groovy.lang.Closure script)
Copyright © 2019. All rights reserved.