* {{> rightClick }} *
(locator, context)
| 1139 | * |
| 1140 | */ |
| 1141 | async rightClick(locator, context) { |
| 1142 | const locateFn = prepareLocateFn.call(this, context) |
| 1143 | |
| 1144 | const res = await findClickable.call(this, locator, locateFn) |
| 1145 | if (context) { |
| 1146 | assertElementExists(res, locator, 'Clickable element', `was not found inside element ${new Locator(context)}`) |
| 1147 | } else { |
| 1148 | assertElementExists(res, locator, 'Clickable element') |
| 1149 | } |
| 1150 | |
| 1151 | const el = selectElement(res, locator, this) |
| 1152 | |
| 1153 | await el.moveTo() |
| 1154 | |
| 1155 | if (this.browser.isW3C) { |
| 1156 | return el.click({ button: 'right' }) |
| 1157 | } |
| 1158 | // JSON Wire version |
| 1159 | await this.browser.buttonDown(2) |
| 1160 | } |
| 1161 | |
| 1162 | /** |
| 1163 | * Performs click at specific coordinates. |
nothing calls this directly
no test coverage detected