Class TraceContext
java.lang.Object
com.atlassian.jira.pageobjects.util.TraceContext
Provides utility methods for waiting for ajax results. To send events from the javascript side, call JIRA.trace(key, args...).
To turn on logging:
org.apache.log4j.Logger.getLogger(TraceContext.class).setLevel(org.apache.log4j.Level.DEBUG);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a tracer containing the current state of trace list.com.atlassian.pageobjects.elements.query.TimedCondition
Waits for the occurrence of a trace with the given key after the given tracer.com.atlassian.pageobjects.elements.query.TimedCondition
Waits for the occurrence of a trace with the given key and optionally arguments after the given tracer.com.atlassian.pageobjects.elements.query.TimedCondition
Waits for the occurrence of a trace with the given key and optionally arguments after the given tracer.com.atlassian.pageobjects.elements.query.TimedCondition
Return aTimedCondition
that waits for the occurrence of a trace at some point after the page load.static void
consumeCheckpoint
(Consumer<Tracer> consumer) <T> T
doWithCheckpoint
(Supplier<T> supplier) Used together withCheckpointTracer
annotation to inject page objects withTracer
instance obtained just beforesupplier
invocation.boolean
boolean
Check whether trace record of given key exists, also test argument if argumentPattern is providedboolean
Check whether trace record of given key exists, also test argument if argumentPattern is providedgetArguments
(Tracer tracer, String key) void
Waits for the occurrence of a trace with the given key after the given tracer.void
Waits for the occurrence of a trace with the given key and optionally test argument against given argumentPatternvoid
Waits for the occurrence of a trace with the given key and optionally test argument against given argumentMatcher
-
Constructor Details
-
TraceContext
public TraceContext()
-
-
Method Details
-
checkpoint
Returns a tracer containing the current state of trace list. -
doWithCheckpoint
Used together withCheckpointTracer
annotation to inject page objects withTracer
instance obtained just beforesupplier
invocation.- Type Parameters:
T
-- Parameters:
supplier
- Action to perform- Returns:
- value returned by
supplier
- See Also:
-
consumeCheckpoint
-
waitFor
Waits for the occurrence of a trace with the given key after the given tracer.- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch for
-
waitFor
Waits for the occurrence of a trace with the given key and optionally test argument against given argumentPattern- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch forargumentPattern
- test argument of JIRA.trace call(after key argument)
-
waitFor
Waits for the occurrence of a trace with the given key and optionally test argument against given argumentMatcher- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch forargumentMatcher
- test argument of JIRA.trace call(after key argument).
-
exists
-
exists
Check whether trace record of given key exists, also test argument if argumentPattern is provided- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch forargumentPattern
- test argument of JIRA.trace call(after key argument)- Returns:
-
exists
Check whether trace record of given key exists, also test argument if argumentPattern is provided- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch forargumentMatcher
- test argument of JIRA.trace call(after key argument).- Returns:
-
getAllTraceIds
-
getArguments
-
conditionFromPageLoad
Return aTimedCondition
that waits for the occurrence of a trace at some point after the page load.- Parameters:
key
- the key to check for.- Returns:
- a
TimedCondition
that waits for the occurrence of a trace at some point after the page load.
-
condition
Waits for the occurrence of a trace with the given key after the given tracer.- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch for
-
condition
public com.atlassian.pageobjects.elements.query.TimedCondition condition(Tracer tracer, String key, Pattern argumentPattern) Waits for the occurrence of a trace with the given key and optionally arguments after the given tracer.- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch forargumentPattern
- check consecutive arguments of JIRA.trace call(after key argument)
-
condition
public com.atlassian.pageobjects.elements.query.TimedCondition condition(Tracer tracer, String key, @Nullable org.hamcrest.Matcher<?> argumentMatcher) Waits for the occurrence of a trace with the given key and optionally arguments after the given tracer.- Parameters:
tracer
- checkpoint. Only traces after this checkpoint will be inspected.key
- tracer key to watch forargumentMatcher
- check consecutive arguments of JIRA.trace call(after key argument)
-