Example #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']);
 }