예제 #1
0
 public function hitsAreIncrementedIfCountClicksIsOn(\Step\Acceptance\weblink $I)
 {
     $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 weblink categories');
     $I->waitForText('Uncategorised', '30', ['css' => 'h3']);
     $I->checkForPhpNoticesOrWarnings();
     $I->comment('I open the uncategorised Weblink Category');
     $I->click(['link' => 'Uncategorised']);
     // Check that hits is 0
     $I->waitForText('Uncategorised', '30', ['css' => 'h2']);
     $I->expectTo('see the weblink 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->moveBack();
     $I->expectTo('see that hits is 1');
     $I->see('Hits: 1', ['class' => 'list-hits']);
 }
예제 #2
0
 /**
  * Create a weblink in the backend and confirm it exists and is visible in the Frontend
  *
  * @param   \Step\Acceptance\Weblink  $I
  */
 public function createWeblinkAndConfirmFrontend(\Step\Acceptance\weblink $I)
 {
     $I->am('Administrator');
     $I->wantToTest('Listing a category of Weblinks in frontend');
     $I->doAdministratorLogin();
     $I->createWeblink($this->title, $this->url);
     // Menu link
     $I->createMenuItem($this->menuItem, 'Weblinks', 'List All Web Link Categories', 'Main Menu');
     // Go to the frontend
     $I->comment('I want to check if the menu entry exists in the frontend');
     $I->amOnPage('index.php?option=com_weblinks');
     $I->expectTo('see weblink categories');
     $I->waitForText('Uncategorised', '30', ['css' => 'h3']);
     $I->checkForPhpNoticesOrWarnings();
     $I->comment('I open the uncategorised Weblink Category');
     $I->click(['link' => 'Uncategorised']);
     $I->waitForText('Uncategorised', '30', ['css' => 'h2']);
     $I->expectTo('see the weblink we created');
     $I->seeElement(['link' => $this->title]);
     $I->seeElement(['xpath' => "//a[@href='{$this->url}']"]);
 }
예제 #3
0
 public function administratorCreateWeblink(\Step\Acceptance\weblink $I)
 {
     $I->am('Administrator');
     $I->wantToTest('Weblink creation in /administrator/');
     $I->doAdministratorLogin();
     // Get the weblink StepObject
     $I->amGoingTo('Navigate to Weblinks page in /administrator/');
     $I->amOnPage('administrator/index.php?option=com_weblinks');
     $I->waitForText('Web Links', '30', ['css' => 'h1']);
     $I->expectTo('see weblinks page');
     $I->checkForPhpNoticesOrWarnings();
     $I->amGoingTo('try to save a weblink with a filled title and URL');
     $I->clickToolbarButton('New');
     $I->waitForText('Web Link: New', '30', ['css' => 'h1']);
     $I->fillField(['id' => 'jform_title'], $this->title);
     $I->fillField(['id' => 'jform_url'], $this->url);
     $I->clickToolbarButton('Save & Close');
     $I->waitForText('Web Links', '30', ['css' => 'h1']);
     $I->expectTo('see a success message and the weblink added after saving the weblink');
     $I->see('Web link successfully saved', ['id' => 'system-message-container']);
     $I->see($this->title, ['id' => 'weblinkList']);
 }
예제 #4
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']);
 }
 /**
  * After the tests, the Smart Search content plugin must be disabled, ready for the next test.
  */
 public function administratorDisableSmartsearchWeblinksPlugin(\Step\Acceptance\weblink $I, $scenario)
 {
     $scenario->skip('Temporarilly skipped, see: https://github.com/joomla-extensions/weblinks/issues/239');
     $I->am('Administrator');
     $I->wantToTest('Disabling the Smart Search content plugin, ready for the next test run');
     $I->doAdministratorLogin();
     $I->amGoingTo('Navigate to Plugins page in /administrator/ and disable the Smart Search Content plugin');
     $I->amOnPage('administrator/index.php?option=com_plugins&view=plugins');
     $I->searchForItem('Smart Search - Web Links');
     $I->waitForText('Plugins', 30, ['class' => 'page-title']);
     $I->waitForElement(['link' => 'Smart Search - Web Links']);
     $I->checkOption(['id' => 'cb0']);
     $I->clickToolbarButton('Unpublish');
     // Note: The button is called "Disable", but we need to call it "Unpublish" here.
     $I->waitForText('Plugin successfully disabled', 30, ['class' => 'alert-message']);
 }