Overview
Thepanel.js file is responsible for managing the recording process, updating the event array with user interactions, and communicating with the background script. The script listens for events emitted by the WelcomePage and TestPage components, such as starting and stopping the recording process.
Event Listeners
describeStatement
This event listener listens for thedescribeStatement event triggered from the WelcomePage component. When the event is received, the describeObj.description value is updated with the input value from the event.
startRecording
This event listener listens for thestartRecording event triggered from the TestPage component. When the event is received, the recording state is set to true, the describeObj.itStatements[0].itStatement value is updated with the input value from the event, and the event array is cleared for a new test.
stopRecording
This event listener listens for thestopRecording event triggered from the TestPage component. When the event is received, the recording state is set to false, and an asynchronous function is called to import the describeCreator function and generate the test code. The generated test code is then sent as a message to the window.
Functions
describeCreatorImport
This asynchronous function imports thedescribeCreator function from the testCreator.js file and executes it with the describeObj value. The function returns a Promise that resolves to the generated test code.
panel.js file manages the recording process, updates the event array with user interactions, and communicates with the background script. The script listens for events emitted by the WelcomePage and TestPage components and handles them accordingly.
