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')); }
/** * @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; }
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())); }
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())); }
function test1() { $user = new User(); $user->setEmail("*****@*****.**"); $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')); }
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()); }
/** * Получить токен для полного доступа * @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; }
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())); }
/** * 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()); }
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()); }
/** * 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(); }
/** * 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()); }
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())); }
function test1() { $user = new User(); $user->setEmail("*****@*****.**"); $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()); }
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(); }
public function testPostFinishAddVariantOnlyDescribedOnGenomicLevelToCMT() { $this->logout(); $this->login('collaborator', 'test1234'); $this->driver->get(ROOT_URL . "/src/"); // Move mouse to Screenings tab and click 'view all screenings' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_screenings")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allVariantsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all screenings')); $allVariantsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings$/', $this->driver->getCurrentURL())); // $element = $this->driver->findElement(WebDriverBy::cssSelector("#0000000002 > td.ordered")); $element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='0000000002']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings\\/0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Screenings")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add variant to screening")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&target=0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//table[2]/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Genome&target=0000000002$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="allele"]/option[text()="Maternal (confirmed)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="chromosome"]/option[text()="X"]')); $option->click(); $this->enterValue(WebDriverBy::name("VariantOnGenome/DNA"), "g.40702876G>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(); for ($second = 0;; $second++) { if ($second >= 60) { $this->fail("timeout"); } try { if ($this->isElementPresent(WebDriverBy::cssSelector("table[class=info]"))) { break; } } catch (Exception $e) { } sleep(1); } $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())); }
public function login() { $this->driver->get('https://web.skype.com'); $this->driver->wait()->until(function () { return WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id('username')); }); $this->driver->findElement(WebDriverBy::id('username'))->sendKeys($this->username); $this->driver->findElement(WebDriverBy::id('password'))->sendKeys($this->password); $this->driver->findElement(WebDriverBy::cssSelector('form'))->submit(); $this->waitForSelector('[name=query]'); sleep(15); return true; }
public function find(RemoteWebDriver $webDriver) { switch ($this->type) { case self::ID: return $webDriver->findElement(WebDriverBy::id($this->value)); case self::CSS_SELECTOR: return $webDriver->findElement(WebDriverBy::cssSelector($this->value)); case self::LINK_TEXT: return $webDriver->findElement(WebDriverBy::linkText($this->value)); default: throw new \LogicException('Invalid element search type: ' . $this->type); } }
public function testAddSummaryVariantVCFFile() { // Mouse hover over Submit tab, to make 'submit new data' link visible. $tabElement = $this->driver->findElement(WebDriverBy::xpath("//img[@id='tab_submit']")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $element = $this->driver->findElement(WebDriverBy::linkText("Submit new data")); $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("//tr[3]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr/td[2]/b")); $element->click(); $this->driver->get(ROOT_URL . "/src/variants/upload?create&type=VCF"); $this->enterValue(WebDriverBy::name("variant_file"), ROOT_PATH . "../tests/test_data_files/ShortVCFfilev1.vcf"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="hg_build"]/option[text()="hg19"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="dbSNP_column"]/option[text()="VariantOnGenome/Reference"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genotype_field"]/option[text()="Use Phred-scaled genotype likelihoods (PL)"]')); $option->click(); $this->check(WebDriverBy::name("allow_mapping")); $this->check(WebDriverBy::name("allow_create_genes")); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Upload VCF file']")); $element->click(); $this->assertEquals("25 variants were imported, 1 variant could not be imported.", $this->driver->findElement(WebDriverBy::id("lovd__progress_message"))->getText()); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']")); $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())); for ($second = 0;; $second++) { if ($second >= 600) { $this->fail("timeout"); } $this->driver->get(ROOT_URL . "/src/ajax/map_variants.php"); if (strcmp("0 99 There are no variants to map in the database", $this->driver->findElement(WebDriverBy::tagName("body"))->getText())) { break; } $this->assertNotContains("of 25 variants", $this->driver->findElement(WebDriverBy::tagName("body"))->getText()); sleep(1); } }
public function testAddVCFFileToCMTIndividual() { $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Are you sure you are done with submitting the variants found with this screening[\\s\\S][\\s\\S]*$/', $this->getConfirmation())); $this->chooseOkOnNextConfirmation(); $element = $this->driver->findElement(WebDriverBy::xpath("//tr[3]/td[2]/b")); $element->click(); // $element = $this->driver->findElement(WebDriverBy::cssSelector("#0000000002 > td.ordered")); $element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='0000000002']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&target=0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//tr[3]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create&target=0000000002$/', $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\\/variants\\/upload[\\s\\S]create&type=VCF&target=0000000002$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("variant_file"), ROOT_PATH . "../tests/test_data_files/ShortVCFfilev1.vcf"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="hg_build"]/option[text()="hg19"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="dbSNP_column"]/option[text()="VariantOnGenome/Reference"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genotype_field"]/option[text()="Use Phred-scaled genotype likelihoods (PL)"]')); $option->click(); $this->check(WebDriverBy::name("allow_mapping")); $this->check(WebDriverBy::name("allow_create_genes")); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Upload VCF file']")); $element->click(); $this->assertEquals("25 variants were imported, 1 variant could not be imported.", $this->driver->findElement(WebDriverBy::id("lovd__progress_message"))->getText()); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000002$/', $this->driver->getCurrentURL())); for ($second = 0;; $second++) { if ($second >= 600) { $this->fail("timeout"); } $this->driver->get(ROOT_URL . "/src/ajax/map_variants.php"); if (strcmp("0 99 There are no variants to map in the database", $this->driver->findElement(WebDriverBy::tagName("body"))->getText())) { break; } $this->assertNotContains("of 25 variants", $this->driver->findElement(WebDriverBy::tagName("body"))->getText()); sleep(1); } }
public function testAddVCFFileToIVAIndividual() { // wait for page redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000003$/', $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\\/variants[\\s\\S]create&target=0000000003$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//tr[3]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\s\\S]create&target=0000000003$/', $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\\/variants\\/upload[\\s\\S]create&type=VCF&target=0000000003$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("variant_file"), ROOT_PATH . "../tests/test_data_files/ShortVCFfilev1.vcf"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="hg_build"]/option[text()="hg19"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="dbSNP_column"]/option[text()="VariantOnGenome/Reference"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genotype_field"]/option[text()="Use Phred-scaled genotype likelihoods (PL)"]')); $option->click(); $this->check(WebDriverBy::name("allow_mapping")); $this->check(WebDriverBy::name("allow_create_genes")); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Upload VCF file']")); $element->click(); $this->assertEquals("25 variants were imported, 1 variant could not be imported.", $this->driver->findElement(WebDriverBy::id("lovd__progress_message"))->getText()); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']")); $element->click(); for ($second = 0;; $second++) { if ($second >= 600) { $this->fail("timeout"); } $this->driver->get(ROOT_URL . "/src/ajax/map_variants.php"); if (strcmp("0 99 There are no variants to map in the database", $this->driver->findElement(WebDriverBy::tagName("body"))->getText())) { break; } $this->assertNotContains("of 25 variants", $this->driver->findElement(WebDriverBy::tagName("body"))->getText()); sleep(1); } // Test whether a variant was parsed correctly via mutalyzer. $this->driver->get(ROOT_URL . '/src/genes/ARSD'); $element = $this->driver->findElement(WebDriverBy::xpath('//tr[@class="data"]/td[text()="X"]')); $element->click(); $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath('//td[text()="p.(Gln318His)"]'))); }
public function testAddSummaryVariantSeattleseqFile() { // Mouse hover over Submit tab, to make 'submit new data' link visible. $tabElement = $this->driver->findElement(WebDriverBy::xpath("//img[@id='tab_submit']")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $element = $this->driver->findElement(WebDriverBy::linkText("Submit new data")); $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("//tr[3]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/upload[\\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\\/upload[\\s\\S]create&type=SeattleSeq$/', $this->driver->getCurrentURL())); $this->enterValue(WebDriverBy::name("variant_file"), ROOT_PATH . "../tests/test_data_files/ShortSeattleSeqAnnotation138v1.txt"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="hg_build"]/option[text()="hg19"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="dbSNP_column"]/option[text()="VariantOnGenome/Reference"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="autocreate"]/option[text()="Create genes and transcripts"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="statusid"]/option[text()="Public"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Upload SeattleSeq file']")); $this->clickNoTimeout($element); for ($second = 0;; $second++) { if ($second >= 300) { $this->fail("timeout"); } try { if ($this->isElementPresent(WebDriverBy::xpath("//input[@value='Continue »']"))) { break; } } catch (Exception $e) { } sleep(1); } $this->assertContains("138 variants were imported, 1 variant could not be imported.", $this->driver->findElement(WebDriverBy::id("lovd__progress_message"))->getText()); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Continue »']")); $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())); }
public function testConfirmVariantToCMTIndividual() { // Wait for redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000001$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//div/table/tbody/tr/td/table/tbody/tr[2]/td[2]")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*Are you sure you are done with submitting the variants found with this screening[\\s\\S][\\s\\S]*$/', $this->getConfirmation())); $this->chooseOkOnNextConfirmation(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/individual\\/00000001$/', $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\\/screenings[\\s\\S]create&target=00000001$/', $this->driver->getCurrentURL())); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Template[]"]/option[text()="RNA (cDNA)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Template[]"]/option[text()="Protein"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="Single Base Extension"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="Single-Strand DNA Conformation polymorphism Analysis (SSCP)"]')); $option->click(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="Screening/Technique[]"]/option[text()="SSCA, fluorescent (SSCP)"]')); $option->click(); // $this->addSelection(WebDriverBy::name("genes[]"), "value=GJB1"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="genes[]"]/option[@value="GJB1"]')); $option->click(); $this->check(WebDriverBy::name("variants_found")); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="owned_by"]/option[text()="LOVD3 Admin (#00001)"]')); $option->click(); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Create screening information entry']")); $element->click(); $this->assertEquals("Successfully created the screening entry!", $this->driver->findElement(WebDriverBy::cssSelector("table[class=info]"))->getText()); // Wait for redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("Submission of")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/submit\\/screening\\/0000000002$/', $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\\/variants[\\s\\S]create&target=0000000002$/', $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\\/screenings\\/0000000002[\\s\\S]confirmVariants$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("check_0000000001")); $element->click(); $this->enterValue(WebDriverBy::xpath("//td/input[@type='password']"), "test1234"); $element = $this->driver->findElement(WebDriverBy::xpath("//input[@value='Save variant list']")); $element->click(); $confirmElementSelector = WebDriverBy::xpath('//td[text()="Successfully confirmed the variant entry!"]'); $this->waitUntil(WebDriverExpectedCondition::presenceOfElementLocated($confirmElementSelector)); }
public function testCreateIndividualDiagnosedWithCMT() { $element = $this->driver->findElement(WebDriverBy::id("tab_submit")); $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(); $this->enterValue(WebDriverBy::name("Individual/Reference"), "{PMID:Fokkema et al (2011):21520333}"); $this->enterValue(WebDriverBy::name("Individual/Remarks"), "No Remarks"); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="active_diseases[]"]/option[text()="CMT (Charcot Marie Tooth Disease)"]')); $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()); }
private function captcha() { $path = \Yii::getAlias('@runtime/tmp') . '/' . time() . '_' . rand() . '.png'; $this->driver->takeScreenshot($path); $coordinates = $this->driver->findElement(WebDriverBy::cssSelector('.captchaImage'))->getCoordinates()->onPage(); if (Image::crop($path, $coordinates->getX(), $coordinates->getY(), 300, 60)) { if (\Yii::$app->get('captcha')->run($path)) { $this->driver->findElement(WebDriverBy::id('CaptchaInput'))->click(); $this->driver->findElement(WebDriverBy::id('CaptchaInput'))->sendKeys(\Yii::$app->get('captcha')->result()); $this->driver->findElement(WebDriverBy::name('submit_captcha'))->click(); sleep(2); } } else { throw new Exception('Проблема при обрезании картинки'); } }
public function login() { $this->open->open('http://www.gmail.com/'); $this->testCase->assertElementExists('Email'); $this->testCase->assertElementExists('next'); $element = $this->webdriver->byId('Email'); $element->sendKeys($this->accountInformation->getEmailAddress()); $element = $this->webdriver->byId('next'); $element->click(); $this->webdriver->wait()->until(WebDriverExpectedCondition::elementToBeClickable(WebDriverBy::id('Passwd'))); $this->testCase->assertElementExists('Passwd'); $this->testCase->assertElementExists('signIn'); $element = $this->webdriver->byId('Passwd'); $element->sendKeys($this->accountInformation->getPassword()); $element = $this->webdriver->byId('signIn'); $element->click(); $this->webdriver->wait()->until(WebDriverExpectedCondition::titleContains('Inbox')); }
/** * Test if recursion is still working * * @throws \Facebook\WebDriver\Exception\NoSuchElementException * @throws \Facebook\WebDriver\Exception\TimeOutException */ public function testRecursion() { $this->webDriver->get('http://www.google.be'); $this->webDriver->findElement(WebDriverBy::id('lst-ib'))->sendKeys('Recursion')->submit(); $this->webDriver->wait(10, 300)->until(function ($webDriver) { /** @var WebDriver $webDriver */ try { $webDriver->findElement(WebDriverBy::cssSelector('a.spell')); return true; } catch (NoSuchElementException $ex) { return false; } }); $aSpellElement = $this->webDriver->findElement(WebDriverBy::cssSelector('a.spell')); $this->assertEquals("Recursion", $aSpellElement->getText()); $aSpellElement->click(); $this->takeScreenshot(__FUNCTION__); }
public function testPostFinishAddVariantOnlyDescribedOnGenomicLevelToIVAIndividual() { $this->driver->get(ROOT_URL . "/src/screenings/IVD"); $element = $this->driver->findElement(WebDriverBy::id("tab_screenings")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings\\/IVD$/', $this->driver->getCurrentURL())); // $element = $this->driver->findElement(WebDriverBy::cssSelector("#0000000002 > td.ordered")); $element = $this->driver->findElement(WebDriverBy::xpath("//td[text()='0000000002']")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/screenings\\/0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Screenings")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Add variant to screening")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&target=0000000002$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::xpath("//table[2]/tbody/tr[2]/td[2]/b")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants[\\s\\S]create&reference=Genome&target=0000000002$/', $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.40702876G>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(); $option = $this->driver->findElement(WebDriverBy::xpath('//select[@name="effect_concluded"]/option[text()="Effect unknown"]')); $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 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())); // wait for page redirect $this->waitUntil(WebDriverExpectedCondition::titleContains("View genomic variant")); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000333$/', $this->driver->getCurrentURL())); }
public function testCurateSubmittedData() { $element = $this->driver->findElement(WebDriverBy::id("tab_variants")); $element->click(); // Move mouse to Variants tab and click 'view all genomic variants' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_variants")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allVariantsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all genomic variants')); $allVariantsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::linkText("0000000001")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000001$/', $this->driver->getCurrentURL())); $this->assertEquals("Pending", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Variants")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Publish (curate) variant entry")); $element->click(); $this->assertEquals("Public", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); $element = $this->driver->findElement(WebDriverBy::linkText("00000001")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/individuals\\/00000001$/', $this->driver->getCurrentURL())); $this->assertEquals("Pending", $this->driver->findElement(WebDriverBy::xpath("//tr[8]/td"))->getText()); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Individuals")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Publish (curate) individual entry")); $element->click(); $this->assertEquals("Public", $this->driver->findElement(WebDriverBy::xpath("//tr[8]/td"))->getText()); // Move mouse to Variants tab and click 'view all genomic variants' option. $tabElement = $this->driver->findElement(WebDriverBy::id("tab_variants")); $this->driver->getMouse()->mouseMove($tabElement->getCoordinates()); $allVariantsLink = $this->driver->findElement(WebDriverBy::partialLinkText('View all genomic variants')); $allVariantsLink->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants$/', $this->driver->getCurrentURL())); $element = $this->driver->findElement(WebDriverBy::linkText("0000000002")); $element->click(); $this->assertTrue((bool) preg_match('/^[\\s\\S]*\\/src\\/variants\\/0000000002$/', $this->driver->getCurrentURL())); $this->assertEquals("Pending", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); $element = $this->driver->findElement(WebDriverBy::id("viewentryOptionsButton_Variants")); $element->click(); $element = $this->driver->findElement(WebDriverBy::linkText("Publish (curate) variant entry")); $element->click(); $this->assertEquals("Public", $this->driver->findElement(WebDriverBy::xpath("//tr[13]/td/span"))->getText()); }
/** * Check if the ultimate answer isn't changed * * @throws \Facebook\WebDriver\Exception\NoSuchElementException * @throws \Facebook\WebDriver\Exception\TimeOutException */ public function testUltimateQuestion() { $this->webDriver->get('http://www.google.be'); $this->webDriver->findElement(WebDriverBy::id('lst-ib'))->sendKeys('Answer to the Ultimate Question of Life, the Universe, and Everything'); $this->webDriver->wait(10, 300)->until(function ($webDriver) { /** @var WebDriver $webDriver */ try { $webDriver->findElement(WebDriverBy::id('cwos')); return true; } catch (NoSuchElementException $ex) { return false; } }); $element = $this->webDriver->findElement(WebDriverBy::id('cwos')); $this->assertEquals('42', $element->getText()); $this->takeScreenshot(__FUNCTION__); $element = $this->webDriver->findElement(WebDriverBy::id('cwmcwd')); $this->takeScreenshot(__FUNCTION__ . '-detail', $element); }