本文整理汇总了PHP中Facebook\WebDriver\WebDriverBy::id方法的典型用法代码示例。如果您正苦于以下问题:PHP WebDriverBy::id方法的具体用法?PHP WebDriverBy::id怎么用?PHP WebDriverBy::id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook\WebDriver\WebDriverBy
的用法示例。
在下文中一共展示了WebDriverBy::id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUselessFileDetectorSendKeys
public function testUselessFileDetectorSendKeys()
{
$this->driver->get($this->getTestPath('upload.html'));
$file_input = $this->driver->findElement(WebDriverBy::id('upload'));
$file_input->sendKeys($this->getFilePath());
self::assertEquals($this->getFilePath(), $file_input->getAttribute('value'));
}
示例2: write_in_input
/**
* @param $web
* @param $input_id
* @param $value
* @return mixed
*/
function write_in_input(RemoteWebDriver $web, $input_id, $value)
{
$input = $web->findElement(WebDriverBy::id($input_id));
$input->click();
$web->getKeyboard()->sendKeys($value);
return $input;
}
示例3: testAddSummaryVariantOnlyDescribedOnGenomicLevel
public function testAddSummaryVariantOnlyDescribedOnGenomicLevel()
{
// Wait for redirect
$this->waitUntil(WebDriverExpectedCondition::titleContains("View genomic variant"));
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000003$/', $this->driver->getCurrentURL()));
$element = $this->driver->findElement(WebDriverBy::id("tab_submit"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit$/', $this->driver->getCurrentURL()));
$element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*Please reconsider to submit individual data as well, as it makes the data you submit much more valuable![\\s\\S]*$/', $this->getConfirmation()));
$this->chooseOkOnNextConfirmation();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create$/', $this->driver->getCurrentURL()));
$element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]/b"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Genome$/', $this->driver->getCurrentURL()));
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Paternal (confirmed)"]'));
$option->click();
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="chromosome"]/option[text()="15"]'));
$option->click();
$this->enterValue(WebDriverBy::name("VariantOnGenome/DNA"), "g.40702976G>T");
$element = $this->driver->findElement(WebDriverBy::linkText("PubMed"));
$element->click();
// Move mouse to let browser hide tooltip of pubmed link (needed for chrome)
$this->driver->getMouse()->mouseMove(null, 200, 200);
$this->enterValue(WebDriverBy::name("VariantOnGenome/Reference"), "{PMID:Fokkema et al (2011):21520333}");
$this->enterValue(WebDriverBy::name("VariantOnGenome/Frequency"), "11/10000");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_reported"]/option[text()="Effect unknown"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create variant entry']"));
$element->click();
$this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()));
}
示例4: testPostFinishAddPhenotypeInfoToIVAIndividual
public function testPostFinishAddPhenotypeInfoToIVAIndividual()
{
$element = $this->driver->findElement(WebDriverBy::id("tab_individuals"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/IVD$/', $this->driver->getCurrentURL()));
// $element = $this->driver->findElement(WebDriverBy::cssSelector("#00000002 > td.ordered"));
$element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='00000002']"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000002$/', $this->driver->getCurrentURL()));
$element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals"));
$element->click();
$element = $this->driver->findElement(WebDriverBy::linkText("Add phenotype information to individual"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes[\\s\\S]create&target=00000002$/', $this->driver->getCurrentURL()));
$this->enterValue(WebDriverBy::name("Phenotype/Additional"), "Additional phenotype information");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Phenotype/Inheritance"]/option[text()="Familial"]'));
$option->click();
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]'));
$option->click();
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create phenotype information entry']"));
$element->click();
$this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()));
// Wait for page redirect.
$this->waitUntil(WebDriverExpectedCondition::titleContains("View phenotype"));
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes\\/0000000003$/', $this->driver->getCurrentURL()));
}
示例5: User
function test1()
{
$user = new User();
$user->setEmail("test@example.com");
$user->setUsername("test");
$user->setPassword("ouhosu");
$this->em->persist($user);
$tree = new Tree();
$tree->setTitleAdmin('Tree');
$tree->setPublicId('tree');
$tree->setOwner($user);
$this->em->persist($tree);
$treeVersion = new TreeVersion();
$treeVersion->setTree($tree);
$treeVersion->setPublicId('version');
$this->em->persist($treeVersion);
$startNode = new Node();
$startNode->setTreeVersion($treeVersion);
$startNode->setTitle("START HERE");
$startNode->setPublicId('start');
$this->em->persist($startNode);
$endNode = new Node();
$endNode->setTreeVersion($treeVersion);
$endNode->setTitle("END HERE");
$endNode->setPublicId('end');
$this->em->persist($endNode);
$nodeOption = new NodeOption();
$nodeOption->setTitle("LETS GO HERE");
$nodeOption->setTreeVersion($treeVersion);
$nodeOption->setNode($startNode);
$nodeOption->setDestinationNode($endNode);
$nodeOption->setPublicId('option');
$this->em->persist($nodeOption);
$treeVersionPublished = new TreeVersionPublished();
$treeVersionPublished->setTreeVersion($treeVersion);
$treeVersionPublished->setPublishedBy($user);
$this->em->flush();
$tvsn = new TreeVersionStartingNode();
$tvsn->setNode($startNode);
$tvsn->setTreeVersion($treeVersion);
$this->em->persist($tvsn);
$published = new TreeVersionPublished();
$published->setTreeVersion($treeVersion);
$this->em->persist($published);
$this->em->flush();
// ######################################################## LOAD PAGE
$this->driver->get('http://localhost/app_dev.php/tree/tree/demo/cascade');
$startLink = $this->driver->findElement(WebDriverBy::id('StartTreeLink'));
$this->assertEquals('Start Tree!', $startLink->getText());
// ######################################################## Start Tree
$startLink->click();
sleep($this->sleepOnActionWithNetwork);
$nodeTitle = $this->driver->findElement(WebDriverBy::id('DemoHere'));
$this->assertEquals(0, strpos($nodeTitle->getText(), 'START HERE'));
// ######################################################## LOAD PAGE
$this->driver->findElement(WebDriverBy::id('DemoHere'))->findElement(WebDriverBy::cssSelector('option[value="option"]'))->click();
sleep($this->sleepOnActionNoNetwork);
$nodeTitle = $this->driver->findElement(WebDriverBy::id('DemoHere'));
$this->assertGreaterThan(0, strpos($nodeTitle->getText(), 'END HERE'));
}
示例6: testCreateIndividualDiagnosedWithCMT
public function testCreateIndividualDiagnosedWithCMT()
{
$element = $this->driver->findElement(WebDriverBy::id("tab_submit"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit$/', $this->driver->getCurrentURL()));
$element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr/td[2]/b"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals[\\s\\S]create$/', $this->driver->getCurrentURL()));
$this->enterValue(WebDriverBy::name("Individual/Lab_ID"), "12345CMT");
$element = $this->driver->findElement(WebDriverBy::linkText("PubMed"));
$element->click();
// Move mouse to let browser hide tooltip of pubmed link (needed for chrome)
$this->driver->getMouse()->mouseMove(null, 200, 200);
$this->enterValue(WebDriverBy::name("Individual/Reference"), "{PMID:Fokkema et al (2011):21520333}");
$this->enterValue(WebDriverBy::name("Individual/Remarks"), "No Remarks");
$this->enterValue(WebDriverBy::name("Individual/Remarks_Non_Public"), "Still no remarks");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="active_diseases[]"]/option[text()="CMT (Charcot Marie Tooth Disease)"]'));
$option->click();
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]'));
$option->click();
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create individual information entry']"));
$element->click();
$this->assertEquals("Successfully created the individual information entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText());
}
示例7: getToken
/**
* Получить токен для полного доступа
* @param $url string
* @param $recursion bool
*/
public function getToken($url, $recursion = true)
{
$this->driver->get($url);
$this->driver->findElement(WebDriverBy::name('email'))->sendKeys($this->login);
$this->driver->findElement(WebDriverBy::name('pass'))->sendKeys($this->password);
$this->driver->findElement(WebDriverBy::id('install_allow'))->click();
sleep(3);
while ($this->driver->findElements(WebDriverBy::xpath('//input[@name=\'captcha_key\']'))) {
$this->captcha();
$this->driver->findElement(WebDriverBy::name('pass'))->sendKeys($this->password);
$this->driver->findElement(WebDriverBy::id('install_allow'))->click();
sleep(3);
}
$this->driver->wait(60, 1000)->until(WebDriverExpectedCondition::titleContains('VK | Request Access'));
$this->driver->findElement(WebDriverBy::id('install_allow'))->click();
$this->driver->wait(60, 1000)->until(WebDriverExpectedCondition::titleContains('OAuth Blank'));
$urlCurrent = $this->driver->getCurrentURL();
$parseUrl = parse_url($urlCurrent);
if (!isset($parseUrl['fragment']) && $recursion == true) {
return $this->getToken($url, false);
}
$query = $parseUrl['fragment'];
parse_str($query, $data);
return $data;
}
示例8: testPostFinishAddPhenotypeInfoToCMTIndividual
public function testPostFinishAddPhenotypeInfoToCMTIndividual()
{
// Wait for redirect
$this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of"));
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000003$/', $this->driver->getCurrentURL()));
// Move mouse to Individuals tab and click 'view all individuals' option.
$tabElement = $this->driver->findElement(WebDriverBy::id("tab_individuals"));
$this->driver->getMouse()->mouseMove($tabElement->getCoordinates());
$allIndividualsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all individuals'));
$allIndividualsLink->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals$/', $this->driver->getCurrentURL()));
$element = $this->driver->findElement(WebDriverBy::cssSelector("td.ordered"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000001$/', $this->driver->getCurrentURL()));
$element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals"));
$element->click();
$element = $this->driver->findElement(WebDriverBy::linkText("Add phenotype information to individual"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes[\\s\\S]create&target=00000001$/', $this->driver->getCurrentURL()));
$this->enterValue(WebDriverBy::name("Phenotype/Additional"), "Additional phenotype information");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Phenotype/Inheritance"]/option[text()="Familial"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create phenotype information entry']"));
$element->click();
$this->assertTrue((bool) preg_match('/^Successfully processed your submission and sent an email notification to the relevant curator[\\s\\S]*$/', $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()));
// Wait for redirect
$this->waitUntil(WebDriverExpectedCondition::titleContains("View phenotype"));
$this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/phenotypes\\/0000000002$/', $this->driver->getCurrentURL()));
}
示例9: testHomepageProjects
/**
* Test homepage goes to projects page.
*
*/
public function testHomepageProjects()
{
# Get homepage url.
$this->driver->get('http://docs.seleniumhq.org/');
# Click projects menu link.
$link = $this->driver->findElement(WebDriverBy::id('menu_projects'));
$link->click();
# Assert projects url.
$this->assertSame('http://docs.seleniumhq.org/projects/', $this->driver->getCurrentURL());
}
示例10: testSecondInsertImport
public function testSecondInsertImport()
{
$this->driver->get(ROOT_URL . "/src/import");
$this->enterValue(WebDriverBy::name("import"), ROOT_PATH . "../tests/test_data_files/SecondInsertImport.txt");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="mode"]/option[text()="Add only, treat all data as new"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
$element->click();
$this->assertEquals("Done importing!", $this->driver->findElement(WebDriverBy::id("lovd_sql_progress_message_done"))->getText());
}
示例11: testGetCustomWindowSize
/**
* Get custom window size
*/
public function testGetCustomWindowSize()
{
$capabilities = [WebDriverCapabilityType::BROWSER_NAME => 'firefox'];
$this->webDriver = RemoteWebDriver::create('http://' . self::HOST . '/wd/hub', $capabilities);
$this->webDriver->manage()->window()->setSize(new WebDriverDimension(640, 900));
$this->webDriver->get('http://whatsmy.browsersize.com/');
$foundWidth = $this->webDriver->findElement(WebDriverBy::id('info_ww'))->getText();
self::assertTrue($foundWidth == 640 || $foundWidth == 632, $foundWidth);
$this->webDriver->quit();
}
示例12: testSuccessLogin
/**
* Successful authentication test
*/
public function testSuccessLogin()
{
$this->webDriver->get($this->authenticationPageUrl);
$this->webDriver->findElement(WebDriverBy::id('login'))->sendKeys($this->login);
$this->webDriver->findElement(WebDriverBy::id('password'))->sendKeys($this->password);
$this->webDriver->findElement(WebDriverBy::cssSelector('button[type="submit"]'))->click();
$this->webDriver->wait(5);
$nameElement = $this->webDriver->findElement(WebDriverBy::xpath('/html/body/nav/div[1]/a/div/span[1]'));
$this->assertEquals('Andrei Troskov', $nameElement->getText());
}
示例13: testUpdatetImport
public function testUpdatetImport()
{
$this->driver->get(ROOT_URL . "/src/import");
$this->enterValue(WebDriverBy::name("import"), ROOT_PATH . "../tests/test_data_files/UpdateImport.txt");
$option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="mode"]/option[text()="Update existing data (in beta)"]'));
$option->click();
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Import file']"));
$element->click();
$this->assertTrue((bool) preg_match('/^[\\s\\S]*The following sections are modified and updated in the database: Columns, Diseases, Individuals, Phenotypes, Screenings, Variants_On_Genome, Variants_On_Transcripts\\.$/', $this->driver->findElement(WebDriverBy::id("lovd_sql_progress_message_done"))->getText()));
}
示例14: User
function test1()
{
$user = new User();
$user->setEmail("test@example.com");
$user->setUsername("test");
$user->setPassword("ouhosu");
$this->em->persist($user);
$tree = new Tree();
$tree->setTitleAdmin('Tree');
$tree->setPublicId('tree');
$tree->setOwner($user);
$this->em->persist($tree);
$treeVersion = new TreeVersion();
$treeVersion->setTree($tree);
$treeVersion->setPublicId('version');
$treeVersion->setFeatureLibraryContent(true);
$this->em->persist($treeVersion);
$startNode = new Node();
$startNode->setTreeVersion($treeVersion);
$startNode->setTitle("START HERE");
$startNode->setPublicId('start');
$this->em->persist($startNode);
$libraryContent = new LibraryContent();
$libraryContent->setTreeVersion($treeVersion);
$libraryContent->setBodyText('TREE CONTENT');
$this->em->persist($libraryContent);
$nodeHasLibraryContent = new NodeHasLibraryContent();
$nodeHasLibraryContent->setSort(0);
$nodeHasLibraryContent->setNode($startNode);
$nodeHasLibraryContent->setLibraryContent($libraryContent);
$this->em->persist($nodeHasLibraryContent);
$treeVersionPublished = new TreeVersionPublished();
$treeVersionPublished->setTreeVersion($treeVersion);
$treeVersionPublished->setPublishedBy($user);
$this->em->flush();
$tvsn = new TreeVersionStartingNode();
$tvsn->setNode($startNode);
$tvsn->setTreeVersion($treeVersion);
$this->em->persist($tvsn);
$published = new TreeVersionPublished();
$published->setTreeVersion($treeVersion);
$this->em->persist($published);
$this->em->flush();
// ######################################################## LOAD PAGE
$this->driver->get('http://localhost/app_dev.php/tree/tree/demo');
$startLink = $this->driver->findElement(WebDriverBy::id('StartTreeLink'));
$this->assertEquals('Start Tree!', $startLink->getText());
// ######################################################## Start Tree
$startLink->click();
sleep($this->sleepOnActionWithNetwork);
$nodeTitle = $this->driver->findElement(WebDriverBy::id('DemoHere'))->findElement(WebDriverBy::className('node'))->findElement(WebDriverBy::className('title'));
$this->assertEquals('START HERE', $nodeTitle->getText());
$nodeBody = $this->driver->findElement(WebDriverBy::id('DemoHere'))->findElement(WebDriverBy::className('node'))->findElement(WebDriverBy::className('body'));
$this->assertEquals('TREE CONTENT', $nodeBody->getText());
}
示例15: testCreateGenderColumn
public function testCreateGenderColumn()
{
$this->driver->get(ROOT_URL . "/src/columns/Individual/Gender");
$element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Columns"));
$element->click();
$element = $this->driver->findElement(WebDriverBy::linkText("Enable column"));
$element->click();
$this->enterValue(WebDriverBy::name("password"), "test1234");
$element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Add/enable custom data column Individual/Gender']"));
$element->click();
}