Class EventStream
- All Implemented Interfaces:
- HasHandlers
Experimental Features for more information.A
EventStream captures event details as JavaScript objects as they are handled by the EventHandler.  The event target canvas ID and 
 class name as well the locator are included, as available. 
 Event-specific data (for example, the String for keyboard events) are also included where appropriate.  See EventStreamEvent for more information.  You can configure the stream to capture
 most DOM event types and other useful events, such as relogins and JavaScript
 errors that are triggered by events: 
| Event Category | Includes (source DOM eventType(s) or description) | Controlling Attribute | From DOM Event? | 
|---|---|---|---|
| click events | mouseDown,mouseUp,click,dblClick | captureClickEvents | Y | 
| move events | mouseMove,mouseOut | captureMoveEvents | Y | 
| key events | keyDown,keyPress,keyUp | captureKeyEvents | Y | 
| drag events | dragStart,dragMove,dragStop | captureDragEvents | Y | 
| context menu events | contextMenu | captureMenuEvents | Y | 
| mouse wheel events | mouseWheel | captureWheelEvents | Y | 
| page events | load,unload,resize | capturePageEvents | Y | 
| login events | Successful reloginvia theRPCManager | captureLoginEvents | N | 
| Reifyfile events | Project and screen (auto)saves and loads | captureDSFileEvents | N | 
| event errors | JavaScript exceptions | captureEventErrors | N | 
 Note that several types of DOM events can be collapsed so that one event is
 reported instead of many if they occur over the same target.  You can enable collapsing for move and drag events, key events, wheel events, and page events.  A stream capture limit is also supported via circular buffering,
 so that only the most recent events are preserved.  All available events can be returned as an array of EventStreamEvent via getEvents(). 
 A EventStream will start capturing events as soon as it's created by default, but if you
 set autoStart: false, you can start capturing manually
 by calling start().  Calling end() will end capturing and return the EventStreamData.
- 
Field SummaryFields inherited from class com.smartgwt.client.core.BaseClassconfig, configOnly, factoryCreated, factoryProperties, id, scClassName
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreate()end()Ends event capturing and returns theEventStreamData.Creates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands.getAsSeleneseCommands(SeleneseSettings settings) Creates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands.Creates and returns Selenese that represents the events captured by the stream.getAsSeleneseHTML(SeleneseSettings settings) Creates and returns Selenese that represents the events captured by the stream.booleanWhether the stream should automatically begin capturing events.booleanWhether mouse button-driven events (or their touch equivalents) should be captured by the stream.booleanWhether dragging-related events should be captured by the stream.booleanWhether to capture JavaScript errors.booleanWhether keyboard input events should be captured by the stream.booleanWhetherrelogins are captured by the stream.booleanWhether opening a context menu should be captured by the stream.booleanWhether mouse or touch motion-related events (other than dragging) should be captured by the stream.booleanWhether page-level events such as a page load or resize should be captured by the stream.booleanWhether mouse wheel events should be captured by the stream.booleanWhether to collapse adjacentkeyPressevents into one event where possible.booleanbooleanWhether adjacgent page events with the sameeventTypeshould be collapsed into a single event.booleanWhether mouse wheel events with the sametargetIDand scroll directions should be collapsed into a single event, containing a sum of thedelta offsetsfrom the original events.static StringGenerates a Cypress command snippet for a single event using our custom SC commands.getCypressScript(EventStream eventStream) Builds a full Cypress test file by framing event commands in describe/it blocks.getCypressScript(EventStream eventStream, String targetUrl) getCypressScript(EventStream eventStream, String targetUrl, String testName) getCypressScript(EventStream eventStream, String targetUrl, String testName, String testDescription) Builds a full Cypress test file by framing event commands in describe/it blocks.static String[]getCypressScriptFromData(EventStreamEvent... events) Translates an array of EventStreamEvent objects into an array of Cypress command strings.Returns all available captured events, oldest first.getJsObj()Maximum number of events that will be stored by thisEventStream.intNumber of seconds that must elapse before another event error will be reported.static EventStreamgetOrCreateRef(JavaScriptObject jsObj) Returns when this stream started capturing events (i.e.booleanstatic voidrunEvents(EventStreamEvent[] events, int speed, TextAreaItem textAreaLog, Function callback) Replays a sequence of recorded events in the live UI and logs each step.setAutoStart(boolean autoStart) Whether the stream should automatically begin capturing events.setCaptureClickEvents(boolean captureClickEvents) Whether mouse button-driven events (or their touch equivalents) should be captured by the stream.setCaptureDragEvents(boolean captureDragEvents) Whether dragging-related events should be captured by the stream.setCaptureEventErrors(boolean captureEventErrors) Whether to capture JavaScript errors.setCaptureKeyEvents(boolean captureKeyEvents) Whether keyboard input events should be captured by the stream.setCaptureLoginEvents(boolean captureLoginEvents) Whetherrelogins are captured by the stream.setCaptureMenuEvents(boolean captureMenuEvents) Whether opening a context menu should be captured by the stream.setCaptureMoveEvents(boolean captureMoveEvents) Whether mouse or touch motion-related events (other than dragging) should be captured by the stream.setCapturePageEvents(boolean capturePageEvents) Whether page-level events such as a page load or resize should be captured by the stream.setCaptureWheelEvents(boolean captureWheelEvents) Whether mouse wheel events should be captured by the stream.setCollapseKeyEvents(boolean collapseKeyEvents) Whether to collapse adjacentkeyPressevents into one event where possible.setCollapseMoveEvents(boolean collapseMoveEvents) setCollapsePageEvents(boolean collapsePageEvents) Whether adjacgent page events with the sameeventTypeshould be collapsed into a single event.setCollapseWheelEvents(boolean collapseWheelEvents) Whether mouse wheel events with the sametargetIDand scroll directions should be collapsed into a single event, containing a sum of thedelta offsetsfrom the original events.voidsetEventErrorListener(EventErrorCallback callback) Installs a callback that will be called when the EventStream reports anevent error, subject to theerror reporting interval.voidsetMaxSize(Integer maxSize) Maximum number of events that will be stored by thisEventStream.setMinErrorReportingInterval(int minErrorReportingInterval) Number of seconds that must elapse before another event error will be reported.voidstart()Starts capturing all enabled events.Methods inherited from class com.smartgwt.client.core.BaseClassaddDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName
- 
Constructor Details- 
EventStreampublic EventStream()
- 
EventStream
 
- 
- 
Method Details- 
getOrCreateRef
- 
setJavaScriptObject- Overrides:
- setJavaScriptObjectin class- BaseClass
 
- 
create
- 
isCreatedpublic boolean isCreated()
- 
getJsObj
- 
getOrCreateJsObj- Overrides:
- getOrCreateJsObjin class- BaseClass
 
- 
setAutoStartWhether the stream should automatically begin capturing events. If false, the steam won't start capturing events untilstart()is called.- Parameters:
- autoStart- New autoStart value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getAutoStartpublic boolean getAutoStart()Whether the stream should automatically begin capturing events. If false, the steam won't start capturing events untilstart()is called.- Returns:
- Current autoStart value. Default value is true
 
- 
setCaptureClickEventsWhether mouse button-driven events (or their touch equivalents) should be captured by the stream.Includes such eventTypes asmouseDown,mouseUp,click,doubleClk,pointerDown,pointerUp,pointerCancel,touchStart,touchEnd, andtouchCancel.- Parameters:
- captureClickEvents- New captureClickEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureClickEventspublic boolean getCaptureClickEvents()Whether mouse button-driven events (or their touch equivalents) should be captured by the stream.Includes such eventTypes asmouseDown,mouseUp,click,doubleClk,pointerDown,pointerUp,pointerCancel,touchStart,touchEnd, andtouchCancel.- Returns:
- Current captureClickEvents value. Default value is true
 
- 
setCaptureDragEventsWhether dragging-related events should be captured by the stream. Multiple "drag move" type events that have the sameeventTypeandtargetIDwill be collapsed into one ifcollapseMoveEventsis true.Includes such eventTypes as:- dragStart,- dragRepositionStart,- dragResizeStart,- dragSelectStart,
- 
 dragMove,dragRepositionMove,dragResizeMove,dragSelectMove,
- dragStop,- dragRepositionStop,- dragResizeStop,- dragSelectStop,
- drop,- dropOver, and- dragLeave.
 - Parameters:
- captureDragEvents- New captureDragEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureDragEventspublic boolean getCaptureDragEvents()Whether dragging-related events should be captured by the stream. Multiple "drag move" type events that have the sameeventTypeandtargetIDwill be collapsed into one ifcollapseMoveEventsis true.Includes such eventTypes as:- dragStart,- dragRepositionStart,- dragResizeStart,- dragSelectStart,
- 
 dragMove,dragRepositionMove,dragResizeMove,dragSelectMove,
- dragStop,- dragRepositionStop,- dragResizeStop,- dragSelectStop,
- drop,- dropOver, and- dragLeave.
 - Returns:
- Current captureDragEvents value. Default value is true
 
- 
setCaptureEventErrorsWhether to capture JavaScript errors. If an already-captured event triggered the error, the details will attached to that event. Otherwise, a separate event will be created, with theeventTypeof the last dispatched DOM event (i.e., there is no special "error"eventType.)EventStreamEventrecords annotated or specially-reported with error details will contain anerrorTracewith the error stack trace, and athreadCodereporting the thread ID from theEventHandlerresponsible for the error.- Parameters:
- captureEventErrors- New captureEventErrors value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureEventErrorspublic boolean getCaptureEventErrors()Whether to capture JavaScript errors. If an already-captured event triggered the error, the details will attached to that event. Otherwise, a separate event will be created, with theeventTypeof the last dispatched DOM event (i.e., there is no special "error"eventType.)EventStreamEventrecords annotated or specially-reported with error details will contain anerrorTracewith the error stack trace, and athreadCodereporting the thread ID from theEventHandlerresponsible for the error.- Returns:
- Current captureEventErrors value. Default value is true
 
- 
setCaptureKeyEventsWhether keyboard input events should be captured by the stream. For non-modifier keys, which includes all the self-inserting visible keyboard characters, we capture only thekeyPress, askeyDown/keyUpare generally not useful. Conversely, for modifier keys (e.g. Shift), we capture only thekeyDownandkeyUp. events, and not thekeyPress.If collapseKeyEventsis true, multiple adjacent keyPress events may be collapsed into a single event for greater readability and a more compact event trace.Note that if an error is thrown while handling an event, it will get reported regardless of this setting and the above capturing rules, but see minErrorReportingInterval. So for example an error handling akeyDownwould still generally end up in the event trace, even for a self-inserting key such as "A".- Parameters:
- captureKeyEvents- New captureKeyEvents value. Default value is false
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureKeyEventspublic boolean getCaptureKeyEvents()Whether keyboard input events should be captured by the stream. For non-modifier keys, which includes all the self-inserting visible keyboard characters, we capture only thekeyPress, askeyDown/keyUpare generally not useful. Conversely, for modifier keys (e.g. Shift), we capture only thekeyDownandkeyUp. events, and not thekeyPress.If collapseKeyEventsis true, multiple adjacent keyPress events may be collapsed into a single event for greater readability and a more compact event trace.Note that if an error is thrown while handling an event, it will get reported regardless of this setting and the above capturing rules, but see minErrorReportingInterval. So for example an error handling akeyDownwould still generally end up in the event trace, even for a self-inserting key such as "A".- Returns:
- Current captureKeyEvents value. Default value is false
 
- 
setCaptureLoginEventsWhetherrelogins are captured by the stream. Login events are non-DOM events originating from theRPCManagerrather than theEventHandler. Login events have atransaction URL.Includes the eventTyperelogin.- Parameters:
- captureLoginEvents- New captureLoginEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureLoginEventspublic boolean getCaptureLoginEvents()Whetherrelogins are captured by the stream. Login events are non-DOM events originating from theRPCManagerrather than theEventHandler. Login events have atransaction URL.Includes the eventTyperelogin.- Returns:
- Current captureLoginEvents value. Default value is true
 
- 
setCaptureMenuEventsWhether opening a context menu should be captured by the stream. This may occur due to mouse or keyboard interaction.Includes the eventTypecontextMenu.- Parameters:
- captureMenuEvents- New captureMenuEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureMenuEventspublic boolean getCaptureMenuEvents()Whether opening a context menu should be captured by the stream. This may occur due to mouse or keyboard interaction.Includes the eventTypecontextMenu.- Returns:
- Current captureMenuEvents value. Default value is true
 
- 
setCaptureMoveEventsWhether mouse or touch motion-related events (other than dragging) should be captured by the stream. Multple adjacent "move events" having the sameeventTypeandtargetIDwill be collapsed into one ifcollapseMoveEventsis true.Includes such eventTypes asmouseMove,pointerMove,touchMove, andmouseOut.- Parameters:
- captureMoveEvents- New captureMoveEvents value. Default value is false
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureMoveEventspublic boolean getCaptureMoveEvents()Whether mouse or touch motion-related events (other than dragging) should be captured by the stream. Multple adjacent "move events" having the sameeventTypeandtargetIDwill be collapsed into one ifcollapseMoveEventsis true.Includes such eventTypes asmouseMove,pointerMove,touchMove, andmouseOut.- Returns:
- Current captureMoveEvents value. Default value is false
 
- 
setCapturePageEventsWhether page-level events such as a page load or resize should be captured by the stream. Multple adjacent page events having the same eventType will be collapsed into one ifcollapsePageEventsis true.Includes such eventTypes asload,unload, andresize.- Parameters:
- capturePageEvents- New capturePageEvents value. Default value is false
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCapturePageEventspublic boolean getCapturePageEvents()Whether page-level events such as a page load or resize should be captured by the stream. Multple adjacent page events having the same eventType will be collapsed into one ifcollapsePageEventsis true.Includes such eventTypes asload,unload, andresize.- Returns:
- Current capturePageEvents value. Default value is false
 
- 
setCaptureWheelEventsWhether mouse wheel events should be captured by the stream. If the preceding "wheel event" has the sametargetIDand scroll directions, it will be replaced by the current one, subject tocollapseWheelEvents, with thedelta offsetsin the "collapsed" event getting adjusted to be the sum of those from all the original events.Includes the eventTypemouseWheel.- Parameters:
- captureWheelEvents- New captureWheelEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getCaptureWheelEventspublic boolean getCaptureWheelEvents()Whether mouse wheel events should be captured by the stream. If the preceding "wheel event" has the sametargetIDand scroll directions, it will be replaced by the current one, subject tocollapseWheelEvents, with thedelta offsetsin the "collapsed" event getting adjusted to be the sum of those from all the original events.Includes the eventTypemouseWheel.- Returns:
- Current captureWheelEvents value. Default value is true
 
- 
setCollapseKeyEventsWhether to collapse adjacentkeyPressevents into one event where possible. Self-inserting keys will generally be collapsed by concatenating them into a single string,EventStreamEvent.keyNames. On the other hand, special keys such as "Esc" and "Backspace" will only be collapsed for repeating sequences of the same key, which will be reported asEventStreamEvent.count.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Parameters:
- collapseKeyEvents- New collapseKeyEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
- See Also:
 
- 
getCollapseKeyEventspublic boolean getCollapseKeyEvents()Whether to collapse adjacentkeyPressevents into one event where possible. Self-inserting keys will generally be collapsed by concatenating them into a single string,EventStreamEvent.keyNames. On the other hand, special keys such as "Esc" and "Backspace" will only be collapsed for repeating sequences of the same key, which will be reported asEventStreamEvent.count.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Returns:
- Current collapseKeyEvents value. Default value is true
- See Also:
 
- 
setCollapseMoveEventsWhether mouse or touch-motion related events (including dragging) with the sameeventTypeandtargetIDshould be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Parameters:
- collapseMoveEvents- New collapseMoveEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
- See Also:
 
- 
getCollapseMoveEventspublic boolean getCollapseMoveEvents()Whether mouse or touch-motion related events (including dragging) with the sameeventTypeandtargetIDshould be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Returns:
- Current collapseMoveEvents value. Default value is true
- See Also:
 
- 
setCollapsePageEventsWhether adjacgent page events with the sameeventTypeshould be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Parameters:
- collapsePageEvents- New collapsePageEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
- See Also:
 
- 
getCollapsePageEventspublic boolean getCollapsePageEvents()Whether adjacgent page events with the sameeventTypeshould be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Returns:
- Current collapsePageEvents value. Default value is true
- See Also:
 
- 
setCollapseWheelEventsWhether mouse wheel events with the sametargetIDand scroll directions should be collapsed into a single event, containing a sum of thedelta offsetsfrom the original events.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Parameters:
- collapseWheelEvents- New collapseWheelEvents value. Default value is true
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
- See Also:
 
- 
getCollapseWheelEventspublic boolean getCollapseWheelEvents()Whether mouse wheel events with the sametargetIDand scroll directions should be collapsed into a single event, containing a sum of thedelta offsetsfrom the original events.Note that if an error is thrown while handling an event, it won't be collapsed, but see minErrorReportingInterval.- Returns:
- Current collapseWheelEvents value. Default value is true
- See Also:
 
- 
setMaxSizeMaximum number of events that will be stored by thisEventStream. AftermaxSizeevents are captured, the oldest events will be overwritten. Set this property tonullto capture events without ever overwriting.- Parameters:
- maxSize- New maxSize value. Default value is 10000
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
 
- 
getMaxSizeMaximum number of events that will be stored by thisEventStream. AftermaxSizeevents are captured, the oldest events will be overwritten. Set this property tonullto capture events without ever overwriting.- Returns:
- Current maxSize value. Default value is 10000
 
- 
setMinErrorReportingIntervalpublic EventStream setMinErrorReportingInterval(int minErrorReportingInterval) throws IllegalStateException Number of seconds that must elapse before another event error will be reported. This allows you to avoid the stream getting flooded with likely duplicate errors that may be rapidly and repeatedly reported, due to mouseMove or repeatedly executing code. Setting the property to zero disables it (avoiding any timestamp checking).Note that when an error is reported by the Framework, this property will be ignored if the last captured event triggered the error and has no errorTrace, so that it effectively only prevents adding new events to the stream specifically to report errors. However, anerrorTraceattached to an event within the reporting interval of the previous error won't prevent that event from beingcollapsed.- Parameters:
- minErrorReportingInterval- New minErrorReportingInterval value. Default value is 10
- Returns:
- EventStreaminstance, for chaining setter calls
- Throws:
- IllegalStateException- this property cannot be changed after the underlying component has been created
- See Also:
 
- 
getMinErrorReportingIntervalpublic int getMinErrorReportingInterval()Number of seconds that must elapse before another event error will be reported. This allows you to avoid the stream getting flooded with likely duplicate errors that may be rapidly and repeatedly reported, due to mouseMove or repeatedly executing code. Setting the property to zero disables it (avoiding any timestamp checking).Note that when an error is reported by the Framework, this property will be ignored if the last captured event triggered the error and has no errorTrace, so that it effectively only prevents adding new events to the stream specifically to report errors. However, anerrorTraceattached to an event within the reporting interval of the previous error won't prevent that event from beingcollapsed.- Returns:
- Current minErrorReportingInterval value. Default value is 10
- See Also:
 
- 
endEnds event capturing and returns theEventStreamData. Once ended, capturing cannot be restarted without losing all stored events.- Returns:
- See Also:
 
- 
getAsSeleneseCommandsCreates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands. Compare withgetAsSeleneseHTML(), where you'll also find more common details.Just as when retrieving the Selenese as HTML, if a transformSelenese()function has been defined, it's called before returning the Selenese.- Returns:
- See Also:
 
- 
getAsSeleneseCommandsCreates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands. Compare withgetAsSeleneseHTML(), where you'll also find more common details.Just as when retrieving the Selenese as HTML, if a transformSelenese()function has been defined, it's called before returning the Selenese.- Parameters:
- settings-
- Returns:
- See Also:
 
- 
getAsSeleneseHTMLCreates and returns Selenese that represents the events captured by the stream. This Selenese contains Smart GWT-specific locators (scLocators), and Smart GWT command extensions (e.g. "waitForElementClickable") that are discussed in ourSeleniumoverview.This method returns the Selenese as a string of HTML table rows, just as in an rctest.html file that you can directly execute with Selenium. Does not include the leading or trailing HTML, such as the <BODY> and <TBODY> tags; you'll need to wrap what's returned with the appropriate outer HTML tags to properly embed the table. If you'd rather have the Selenese returned as an array of Selenium commands, callgetAsSeleneseCommands()instead.To customize the returned Selenese, see transformSelenese(). Note that if the stream hasrolled over, the Selenese for the lost events will not be returned.For example, in your Entrypointclass definition, you can declare a stream member like:EventStream eventStream = new EventStream();... time passes where end user is interacting with your app .... Then to retrieve the Selenese you can call something like:String rcTestHTML = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">" + "<body><table><tbody>" + MyApp.eventStream.getAsSeleneseHTML(true) + "</tbody></table></body></html>";- Returns:
- See HTML
- See Also:
 
- 
getAsSeleneseHTMLCreates and returns Selenese that represents the events captured by the stream. This Selenese contains Smart GWT-specific locators (scLocators), and Smart GWT command extensions (e.g. "waitForElementClickable") that are discussed in ourSeleniumoverview.This method returns the Selenese as a string of HTML table rows, just as in an rctest.html file that you can directly execute with Selenium. Does not include the leading or trailing HTML, such as the <BODY> and <TBODY> tags; you'll need to wrap what's returned with the appropriate outer HTML tags to properly embed the table. If you'd rather have the Selenese returned as an array of Selenium commands, callgetAsSeleneseCommands()instead.To customize the returned Selenese, see transformSelenese(). Note that if the stream hasrolled over, the Selenese for the lost events will not be returned.For example, in your Entrypointclass definition, you can declare a stream member like:EventStream eventStream = new EventStream();... time passes where end user is interacting with your app .... Then to retrieve the Selenese you can call something like:String rcTestHTML = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">" + "<body><table><tbody>" + MyApp.eventStream.getAsSeleneseHTML(true) + "</tbody></table></body></html>";- Parameters:
- settings-
- Returns:
- See HTML
- See Also:
 
- 
getCypressScriptBuilds a full Cypress test file by framing event commands in describe/it blocks. It adds a beforeEach with cy.visit, viewport setup, optional waits, and then the test steps.- Parameters:
- eventStream- Stream of events to convert.
- Returns:
- Complete Cypress spec code ready to paste into a `.spec.js`.
- See Also:
 
- 
getCypressScript
- 
getCypressScript
- 
getCypressScriptpublic String getCypressScript(EventStream eventStream, String targetUrl, String testName, String testDescription) Builds a full Cypress test file by framing event commands in describe/it blocks. It adds a beforeEach with cy.visit, viewport setup, optional waits, and then the test steps.- Parameters:
- eventStream- Stream of events to convert.
- targetUrl- URL to visit in beforeEach; defaults to current page.
- testName- Name of the it() block; defaults to "Test".
- testDescription- Description of the describe() block; defaults to "Testing".
- Returns:
- Complete Cypress spec code ready to paste into a `.spec.js`.
- See Also:
 
- 
getEventsReturns all available captured events, oldest first. At mostmaxSizeevents will be returned.- Returns:
- See Also:
 
- 
getStartTimeReturns when this stream started capturing events (i.e. whenstart()got called).- Returns:
- See Also:
 
- 
setEventErrorListenerInstalls a callback that will be called when the EventStream reports anevent error, subject to theerror reporting interval. The callback will be passed all retainedEventStreamEvents captured by the stream since the last time it was called.- Parameters:
- callback- Callback to fire when the stream encounters an event error, subject to the reporting interval
- See Also:
 
- 
startpublic void start()Starts capturing all enabled events. See the overview ofEventStreamfor a list of filter properties you can configure to control which events are captured.If called after end(), capturing will restart, but all previously stored events will be lost.- See Also:
 
- 
getCypressEventScriptGenerates a Cypress command snippet for a single event using our custom SC commands.- Parameters:
- event- The event to translate into a Cypress command.
- Returns:
- A snippet like 'cy.getSC(locator).click()' or '.dblclick()', assuming our custom commands are loaded.
- See Also:
 
- 
getCypressScriptFromDataTranslates an array of EventStreamEvent objects into an array of Cypress command strings.- Parameters:
- events- Array of events to convert.
- Returns:
- List of Cypress command snippets.
- See Also:
 
- 
runEventspublic static void runEvents(EventStreamEvent[] events, int speed, TextAreaItem textAreaLog, Function callback) Replays a sequence of recorded events in the live UI and logs each step.- Parameters:
- events- Events to replay one by one.
- speed- Milliseconds delay between each event.
- textAreaLog- Component where outcomes will be logged.
- callback- Invoked once all events have been processed.
- See Also:
 
 
-