Nearsoft\SeleniumClient\WebElement::waitForElementUntilTextIsChanged PHP Метод

waitForElementUntilTextIsChanged() публичный Метод

Wait until current element's text has changed
public waitForElementUntilTextIsChanged ( String $targetText, integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement
$targetText String
$timeOutSeconds integer
Результат Nearsoft\SeleniumClient\WebElement
    public function waitForElementUntilTextIsChanged($targetText, $timeOutSeconds = 5)
    {
        $wait = true;
        while ($wait) {
            $currentText = $this->getText();
            if ($currentText == $targetText) {
                $wait = false;
            } else {
                if ($timeOutSeconds <= 0) {
                    throw new Exceptions\WebDriverWaitTimeout("Timeout for waitForElementUntilTextIsChange.");
                }
            }
            sleep(1);
            $timeOutSeconds = $timeOutSeconds - 1;
        }
        return $this;
    }