MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / updateActions

Function updateActions

javascript/selenium-webdriver/bidi/input.js:106–133  ·  view source on GitHub ↗
(actions)

Source from the content-addressed store, hash-verified

104}
105
106async function updateActions(actions) {
107 const _actions = []
108 for (const action of actions) {
109 const sequenceList = action.actions
110 let updatedSequenceList = []
111
112 if (action.type === 'pointer' || action.type === 'wheel') {
113 for (const sequence of sequenceList) {
114 if ((sequence.type === 'pointerMove' || sequence.type === 'scroll') && sequence.origin instanceof WebElement) {
115 const element = sequence.origin
116 const elementId = await element.getId()
117 sequence.origin = {
118 type: 'element',
119 element: { sharedId: elementId },
120 }
121 }
122 updatedSequenceList.push(sequence)
123 }
124
125 const updatedAction = { ...action, actions: updatedSequenceList }
126 _actions.push(updatedAction)
127 } else {
128 _actions.push(action)
129 }
130 }
131
132 return _actions
133}
134
135async function getInputInstance(driver) {
136 let instance = new Input(driver)

Callers 1

performMethod · 0.85

Calls 1

getIdMethod · 0.65

Tested by

no test coverage detected