-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(e2e): webdriverio 9 #6559
Changes from 2 commits
565dcac
c787b1e
22bc605
8141ca5
fafb842
bbad9de
7c96f04
a429a4b
9f7b97b
5392836
ef9baaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ interface ClickOptions { | |
|
||
export async function clickVisible( | ||
browser: CompassBrowser, | ||
selector: string | ChainablePromiseElement<WebdriverIO.Element>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ChainablePromiseElement is not generic anymore |
||
selector: string | ChainablePromiseElement, | ||
options?: ClickOptions | ||
): Promise<void> { | ||
const waitOptions = { timeout: options?.timeout }; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ export async function resetConnectForm(browser: CompassBrowser): Promise<void> { | |
|
||
const connectionTitleSelector = Selectors.ConnectionModalTitle; | ||
|
||
const connectionTitle = await browser.$(connectionTitleSelector); | ||
const connectionTitle = browser.$(connectionTitleSelector); | ||
await connectionTitle.waitUntil(async () => { | ||
return (await connectionTitle.getText()) === 'New Connection'; | ||
}); | ||
|
@@ -305,9 +305,7 @@ export async function getConnectFormState( | |
await browser.clickVisible(Selectors.ConnectionFormAdvancedToggle); | ||
|
||
await browser.waitUntil(async () => { | ||
const advancedButton = await browser.$( | ||
Selectors.ConnectionFormAdvancedToggle | ||
); | ||
const advancedButton = browser.$(Selectors.ConnectionFormAdvancedToggle); | ||
return (await advancedButton.getAttribute('aria-expanded')) === 'false'; | ||
}); | ||
} | ||
|
@@ -319,8 +317,8 @@ async function getCheckedRadioValue( | |
browser: CompassBrowser, | ||
selector: string | ||
): Promise<string | null> { | ||
const elements = await browser.$$(selector); | ||
for (const element of elements) { | ||
const elements = browser.$$(selector); | ||
for await (const element of elements) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. browser.$$ returns a chainable element promise array so a) it isn't a promise itself anymore and b) we have to async iterate over the result. |
||
if (await element.isSelected()) { | ||
return element.getValue(); | ||
} | ||
|
@@ -333,7 +331,7 @@ async function getCheckboxValue( | |
browser: CompassBrowser, | ||
selector: string | ||
): Promise<boolean | null> { | ||
const element = await browser.$(selector); | ||
const element = browser.$(selector); | ||
if (!(await element.isExisting())) { | ||
return null; // as opposed to true for checked and false for not | ||
} | ||
|
@@ -345,7 +343,7 @@ async function getText( | |
browser: CompassBrowser, | ||
selector: string | ||
): Promise<string | null> { | ||
const element = await browser.$(selector); | ||
const element = browser.$(selector); | ||
if (!(await element.isExisting())) { | ||
return null; | ||
} | ||
|
@@ -366,7 +364,7 @@ async function getValue( | |
browser: CompassBrowser, | ||
selector: string | ||
): Promise<string | null> { | ||
const element = await browser.$(selector); | ||
const element = browser.$(selector); | ||
if (!(await element.isExisting())) { | ||
return null; | ||
} | ||
|
@@ -880,8 +878,8 @@ export async function setConnectFormState( | |
// for whatever reasons sometimes the first one or two come through as empty strings | ||
await browser.waitUntil(async () => { | ||
allText = []; | ||
const options = await browser.$$('#select-key-menu [role="option"]'); | ||
for (const option of options) { | ||
const options = browser.$$('#select-key-menu [role="option"]'); | ||
for await (const option of options) { | ||
const _text = await option.getText(); | ||
const text = _text.trim(); | ||
allText.push(text); | ||
|
@@ -904,7 +902,7 @@ export async function setConnectFormState( | |
).to.be.true; | ||
|
||
// make sure the menu goes away once we clicked on the option | ||
const menu = await browser.$('#select-key-menu'); | ||
const menu = browser.$('#select-key-menu'); | ||
await menu.waitForExist({ reverse: true }); | ||
|
||
// value | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
browser.$() now returns a chainable promise element which isn't a promise itself anymore.