-
Notifications
You must be signed in to change notification settings - Fork 5
Recorder API
The Recorder from Cypress Support Pro plugin has module architecture. It consists of two parts: Recorder Manager (including UI) and Recorder Generator. The latter can be replaced by the user and so they can customize the action capture and code generation behavior.
When the user starts recording from IDE, the plugin will upload both manager and generator parts into the Chrome instance of Cypress Runner.
Recorder Manager communicates with the generator part using the following functions:
IntellijCypressRecorder.start = function () {}
IntellijCypressRecorder.stop = function () {}
IntellijCypressRecorder.pullCode = function () {}
Called when recording is to be started/resumed. Recorder Manager call this automatically at start of Cypress Runner and later call this on each start recording button click from the user.
Called when recording is to be paused. Recorder Manager call this when the user clicks stop recording button.
Called when Recorder Manager needs to get the code generated at this point. Generator is expected to clean the buffer of code so the subsequent calls do not include code returned at this point.
The generator has to override and implement the functions above. See this default implementation of the generator as a sample.
The user can now select your implementation of generator in a run configuration: