Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,6 @@ class WebDriver extends Helper {
*
*/
async click(locator, context = null) {
const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick'
const locateFn = prepareLocateFn.call(this, context)

const res = await findClickable.call(this, locator, locateFn)
Expand All @@ -1090,7 +1089,7 @@ class WebDriver extends Helper {
}
const elem = selectElement(res, locator, this)
highlightActiveElement.call(this, elem)
return this.browser[clickMethod](getElementId(elem))
return this.browser.elementClick(getElementId(elem))
}

/**
Expand Down Expand Up @@ -1390,7 +1389,6 @@ class WebDriver extends Helper {
* {{> checkOption }}
*/
async checkOption(field, context = null) {
const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick'
const locateFn = prepareLocateFn.call(this, context)

const res = await findCheckable.call(this, field, locateFn)
Expand All @@ -1403,15 +1401,14 @@ class WebDriver extends Helper {
const isSelected = await isElementChecked(this.browser, elementId)

if (isSelected) return Promise.resolve(true)
return this.browser[clickMethod](elementId)
return this.browser.elementClick(elementId)
}

/**
* Appium: not tested
* {{> uncheckOption }}
*/
async uncheckOption(field, context = null) {
const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick'
const locateFn = prepareLocateFn.call(this, context)

const res = await findCheckable.call(this, field, locateFn)
Expand All @@ -1424,7 +1421,7 @@ class WebDriver extends Helper {
const isSelected = await isElementChecked(this.browser, elementId)

if (!isSelected) return Promise.resolve(true)
return this.browser[clickMethod](elementId)
return this.browser.elementClick(elementId)
}

/**
Expand Down
Loading