All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.selenide-core.7.7.0.source-code.select-options-by-value.js Maven / Gradle / Ivy

The newest version!
(function (select, values) {
  import 'selects.js'

  function checkMissingOptionsValues() {
    const missingOptionsValues = values.filter(value => !optionByValue(select, value))
    return missingOptionsValues.length > 0 ? {optionsNotFound: missingOptionsValues} : null
  }

  function checkDisabledOptionsValues() {
    const disabledOptionsValues = values.filter(value => optionByValue(select, value).disabled);
    return disabledOptionsValues.length > 0 ? {disabledOptions: disabledOptionsValues} : null
  }

  return checkState(select) || checkMissingOptionsValues() || checkDisabledOptionsValues() || applyChanges(select, () => {
    for (let requestedValue of values) {
      optionByValue(select, requestedValue).selected = 'selected'
    }
  })
})(arguments[0], arguments[1])





© 2015 - 2025 Weber Informatics LLC | Privacy Policy