Lines Matching defs:text

232      * An expectation for checking if the given text is present in the specified element.
233 * To check exact text match use elementTextIs() condition.
238 * @param string $text The text to be presented in the element.
239 * @return static Condition returns whether the text is present in the element.
241 public static function textToBePresentInElement(WebDriverBy $by, $text)
243 return self::elementTextContains($by, $text);
247 * An expectation for checking if the given text is present in the specified element.
248 * To check exact text match use elementTextIs() condition.
251 * @param string $text The text to be presented in the element.
252 * @return static Condition returns whether the partial text is present in the element.
254 public static function elementTextContains(WebDriverBy $by, $text)
257 function (WebDriver $driver) use ($by, $text) {
261 return mb_strpos($element_text, $text) !== false;
270 * An expectation for checking if the given text exactly equals the text in specified element.
271 * To check only partial substring of the text use elementTextContains() condition.
274 * @param string $text The expected text of the element.
275 * @return static Condition returns whether the element has text value equal to given one.
277 public static function elementTextIs(WebDriverBy $by, $text)
280 function (WebDriver $driver) use ($by, $text) {
282 return $driver->findElement($by)->getText() == $text;
291 * An expectation for checking if the given regular expression matches the text in specified element.
295 * @return static Condition returns whether the element has text value equal to given one.
311 * An expectation for checking if the given text is present in the specified elements value attribute.
316 * @param string $text The text to be presented in the element value.
317 * @return static Condition returns whether the text is present in value attribute.
319 public static function textToBePresentInElementValue(WebDriverBy $by, $text)
321 return self::elementValueContains($by, $text);
325 * An expectation for checking if the given text is present in the specified elements value attribute.
328 * @param string $text The text to be presented in the element value.
329 * @return static Condition returns whether the text is present in value attribute.
331 public static function elementValueContains(WebDriverBy $by, $text)
334 function (WebDriver $driver) use ($by, $text) {
338 return mb_strpos($element_text, $text) !== false;
388 * An expectation for checking that an element with text is either invisible or not present on the DOM.
391 * @param string $text The text of the element.
392 * @return static Condition returns whether the text is found in the element located.
394 public static function invisibilityOfElementWithText(WebDriverBy $by, $text)
397 function (WebDriver $driver) use ($by, $text) {
399 return !($driver->findElement($by)->getText() === $text);