com.atlassian.confluence.pageobjects.trace
Class TraceContext

java.lang.Object
  extended by com.atlassian.confluence.pageobjects.trace.TraceContext

public class TraceContext
extends java.lang.Object

Provides utility methods for waiting for ajax results. To send events from the javascript side, call AJS.trace(key, args...). To turn on logging:

org.apache.log4j.Logger.getLogger(TraceContext.class).setLevel(org.apache.log4j.Level.DEBUG);
This is JIRA's TraceContext. See trace.js for the javascript side.

See Also:
Tracer, Tracing to fix flakiness in Webdriver TODO remove and replace with equivalent atlassian-webdriver version, when SELENIUM-229 is fixed.

Constructor Summary
TraceContext()
           
 
Method Summary
 void bindTraceToEvents(java.lang.String... eventNames)
          Ensures AJS.trace is invoked with each time any of the given events is triggered.
 Tracer checkpoint()
          Returns a tracer containing the current state of trace list.
 com.atlassian.pageobjects.elements.query.TimedCondition condition(Tracer tracer, java.lang.String key)
          Waits for the occurrence of a trace with the given key after the given tracer.
 boolean exists(Tracer tracer, java.lang.String key)
           
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getArguments(Tracer tracer, java.lang.String key)
           
 void waitFor(Tracer tracer, java.lang.String key)
          Waits for the occurrence of a trace with the given key after the given tracer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceContext

public TraceContext()
Method Detail

checkpoint

public Tracer checkpoint()
Returns a tracer containing the current state of trace list.


waitFor

public void waitFor(Tracer tracer,
                    java.lang.String key)
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

exists

public boolean exists(Tracer tracer,
                      java.lang.String key)

getArguments

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getArguments(Tracer tracer,
                                                                                     java.lang.String key)

condition

public com.atlassian.pageobjects.elements.query.TimedCondition condition(Tracer tracer,
                                                                         java.lang.String key)
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

bindTraceToEvents

public void bindTraceToEvents(java.lang.String... eventNames)
Ensures AJS.trace is invoked with each time any of the given events is triggered. AJS.trace is called with the same name as the event.

Parameters:
eventNames - the event names to bind to.


Copyright © 2003-2014 Atlassian. All Rights Reserved.