MCPcopy Create free account
hub / github.com/angular/components / getSliderValue

Function getSliderValue

src/material/slider/slider.e2e.spec.ts:129–137  ·  view source on GitHub ↗

Returns the current value of the slider.

(
    slider: webdriver.WebElement,
    thumbPosition: Thumb,
  )

Source from the content-addressed store, hash-verified

127
128 /** Returns the current value of the slider. */
129 async function getSliderValue(
130 slider: webdriver.WebElement,
131 thumbPosition: Thumb,
132 ): Promise<number> {
133 const inputs = await slider.findElements(webdriver.By.css('.mdc-slider__input'));
134 return thumbPosition === Thumb.END
135 ? Number(await inputs[inputs.length - 1].getAttribute('value'))
136 : Number(await inputs[0].getAttribute('value'));
137 }
138
139 /** Focuses on the MatSlider at the coordinates corresponding to the given thumb. */
140 async function focusSliderThumb(

Callers 3

slider.e2e.spec.tsFile · 0.85
focusSliderThumbFunction · 0.85
slideToValueFunction · 0.85

Calls 1

getAttributeMethod · 0.65

Tested by

no test coverage detected