示例#1
0
    public function testWaitUntilElementIsRemoved()
    {
        $script = <<<SCRIPT
<html><script>
setTimeout(
    function(){
        document.getElementById('test').removeChild(document.getElementById('a'));
    },
    2000
);
</script>
<body>
<div id="test"><div id="a">test</div></div>
</body>
</html>
SCRIPT;
        $filename = tempnam(sys_get_temp_dir(), 'test');
        $fh = fopen($filename, 'w+');
        fwrite($fh, $script);
        fclose($fh);
        chmod($filename, 0666);
        $this->commandOpen('file://' . $filename);
        unlink($filename);
        $element = $this->webdriver->byId('a');
        $this->webdriver->wait()->until(ExpectedCondition::elementRemoved($element));
        $this->assertElementNotExists('a');
    }
示例#2
0
 public function execute(WebDriverElement $testElement = null)
 {
     if ($testElement instanceof WebDriverElement) {
         $this->webDriver->wait()->until(ExpectedCondition::elementRemoved($testElement));
     }
     $this->webDriver->wait()->until(ExpectedCondition::elementExists($this->theme->getGuaranteedPageLoadedElementDisplayedXpath(), WebDriver::BY_XPATH));
     $element = $this->webDriver->byXpath($this->theme->getGuaranteedPageLoadedElementDisplayedXpath());
     $this->webDriver->wait()->until(ExpectedCondition::visibilityOf($element));
 }
示例#3
0
 public function save()
 {
     $this->webDriver->executeScript('window.scrollTo(0, 0);');
     $this->webDriver->wait()->until(ExpectedCondition::elementExists($this->adminThemeConfiguration->getSystemConfigurationSaveButtonXpath(), AbstractTestCase::BY_XPATH));
     $this->testCase->assertElementDisplayed($this->adminThemeConfiguration->getSystemConfigurationSaveButtonXpath(), AbstractTestCase::BY_XPATH);
     $element = $this->webDriver->byXpath($this->adminThemeConfiguration->getSystemConfigurationSaveButtonXpath());
     $element->click();
     $this->webDriver->wait()->until(ExpectedCondition::elementRemoved($element));
     $this->testCase->assertElementDisplayed($this->adminThemeConfiguration->getSystemConfigSaveSuccessfulXpath(), WebDriver::BY_XPATH);
 }
示例#4
0
文件: Username.php 项目: magium/auth0
 public function execute()
 {
     $element = $this->webDriver->byId('a0-signin_easy_email');
     $element->clear();
     $element->sendKeys($this->username);
     $element = $this->webDriver->byId('a0-signin_easy_password');
     $element->clear();
     $element->sendKeys($this->password);
     $body = $this->webDriver->byXpath('//body');
     $element = $this->webDriver->byXpath('//div[@class="a0-action"]/button');
     $element->click();
     $this->webDriver->wait()->until(ExpectedCondition::elementRemoved($body));
 }