Skip to content

Commit 45ee58a

Browse files
📦 Update build-system devDependencies (#40066)
* 📦 Update build-system devDependencies * Override types --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Rozenberg <rodaniel@amp.dev>
1 parent 41bce1d commit 45ee58a

3 files changed

Lines changed: 44 additions & 34 deletions

File tree

‎build-system/tasks/e2e/package-lock.json‎

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build-system/tasks/e2e/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"description": "amp e2e",
66
"devDependencies": {
77
"@babel/register": "7.24.6",
8-
"@types/selenium-webdriver": "4.1.22",
8+
"@types/selenium-webdriver": "4.1.23",
99
"babel-regenerator-runtime": "6.5.0",
1010
"chromedriver": "119.0.1",
1111
"geckodriver": "4.4.1",
12-
"selenium-webdriver": "4.21.0"
12+
"selenium-webdriver": "4.22.0"
1313
}
1414
}

‎build-system/tasks/e2e/selenium-webdriver-controller.js‎

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ async function waitFor(driver, valueFn, condition, opt_mutate) {
6565
return Boolean(condition(value));
6666
};
6767

68+
/* TODO: fix incorrect typing. */
69+
/** @type {any} */
6870
const result = await driver.wait(
6971
expectCondition(valueFn, conditionValue, opt_mutate)
7072
);
7173

72-
return result.value; // Unbox the value.
74+
return result;
7375
}
7476

7577
class SeleniumWebDriverController {
@@ -156,7 +158,11 @@ class SeleniumWebDriverController {
156158
throw e;
157159
}
158160
});
159-
const webElements = await this.driver.wait(condition, ELEMENT_WAIT_TIMEOUT);
161+
/* TODO: fix incorrect typing. */
162+
/** @type {WebElement[]} */
163+
const webElements = /** @type {?} */ (
164+
await this.driver.wait(condition, ELEMENT_WAIT_TIMEOUT)
165+
);
160166
return webElements.map((webElement) => new ElementHandle(webElement));
161167
}
162168

@@ -192,19 +198,23 @@ class SeleniumWebDriverController {
192198
async findElementsXPath(xpath) {
193199
await this.maybeInstallXpath_();
194200
const label = 'for at least one element to be located ' + xpath;
195-
const webElements = await this.driver.wait(
196-
new Condition(label, async () => {
197-
const root = await this.getRoot_();
198-
const results = await this.evaluate(
199-
(xpath, root) => {
200-
return window.queryXpath(xpath, root);
201-
},
202-
xpath,
203-
root
204-
);
205-
return results;
206-
}),
207-
ELEMENT_WAIT_TIMEOUT
201+
/* TODO: fix incorrect typing. */
202+
/** @type {WebElement[]} */
203+
const webElements = /** @type {?} */ (
204+
await this.driver.wait(
205+
new Condition(label, async () => {
206+
const root = await this.getRoot_();
207+
const results = await this.evaluate(
208+
(xpath, root) => {
209+
return window.queryXpath(xpath, root);
210+
},
211+
xpath,
212+
root
213+
);
214+
return results;
215+
}),
216+
ELEMENT_WAIT_TIMEOUT
217+
)
208218
);
209219
return webElements.map((webElement) => new ElementHandle(webElement));
210220
}
@@ -295,7 +305,7 @@ class SeleniumWebDriverController {
295305
*/
296306
pasteFromClipboard() {
297307
return this.driver
298-
.actions()
308+
.actions({async: false, bridge: undefined})
299309
.keyDown(SeleniumKey.SHIFT)
300310
.keyDown(SeleniumKey.INSERT)
301311
.keyUp(SeleniumKey.SHIFT)

0 commit comments

Comments
 (0)