Example #1
0
 public function hitsAreIncrementedIfCountClicksIsOn(\Step\Acceptance\weblink $I, $scenario)
 {
     $scenario->skip('Temporarily skipped for drone, see: https://github.com/joomla-extensions/weblinks/issues/261');
     $title = 'Weblink' . $this->faker->randomNumber();
     $url = $I->getConfiguration('counter_test_url');
     $I->am('Administrator');
     $I->wantToTest('Hits are incremented if Count Clicks is on');
     $I->doAdministratorLogin();
     $I->createWeblink($title, $url, "Yes");
     // Go to the frontend
     $I->amOnPage('index.php?option=com_weblinks');
     $I->expectTo('see web link categories');
     $I->waitForText('Uncategorised', '30', ['css' => 'h3']);
     $I->checkForPhpNoticesOrWarnings();
     $I->comment('I open the uncategorised Web Link Category');
     $I->click(['link' => 'Uncategorised']);
     // Check that hits is 0
     $I->waitForText('Uncategorised', '30', ['css' => 'h2']);
     $I->expectTo('see the web link we created');
     $I->seeElement(['link' => $title]);
     $I->expectTo('see that hits is 0');
     $I->see('Hits: 0', ['class' => 'list-hits']);
     // Click on the link, go back, and check that hits is 1
     $I->click(['link' => $title]);
     $I->amOnPage('index.php?option=com_weblinks');
     $I->comment('I open the uncategorised Web Link Category');
     $I->waitForElement(['link' => 'Uncategorised'], 60);
     $I->click(['link' => 'Uncategorised']);
     $I->comment('I search the web link: ' . $title);
     $I->waitForElement(['id' => 'filter-search'], 60);
     $I->fillField(['id' => 'filter-search'], $title);
     $I->pressKey(['id' => 'filter-search'], \Facebook\WebDriver\WebDriverKeys::ENTER);
     $I->wait(1);
     $I->waitForText('Uncategorised', '30', ['css' => 'h2']);
     $I->expectTo('see that hits is 1');
     $I->see('Hits: 1', ['class' => 'list-hits']);
 }
 /**
  * Index the current content.
  */
 public function administratorRunTheIndexer(\Step\Acceptance\weblink $I, $scenario)
 {
     $scenario->skip('Temporarilly skipped, see: https://github.com/joomla-extensions/weblinks/issues/239');
     $I->am('Administrator');
     $I->wantToTest('Smart Search Indexer');
     $I->doAdministratorLogin();
     $I->amGoingTo('Navigate to Smart Search page in /administrator/ and index the content');
     $I->amOnPage('administrator/index.php?option=com_finder');
     $I->waitForText('Smart Search: Indexed Content', 30, ['class' => 'page-title']);
     $I->click(['xpath' => "//div[@id='toolbar']//button[contains(text()[normalize-space()], 'Index')]"]);
     $I->comment('I wait while smart search indexes the links');
     $I->wait(2);
     $I->waitForText($this->title, 30, '#j-main-container');
 }