[tests] avoid false positives in Frontend Weblinks Test

This commit is contained in:
javier gomez 2016-02-09 11:10:55 +01:00
parent 789f5ca534
commit fde1d3618c
1 changed files with 19 additions and 2 deletions

View File

@ -70,6 +70,7 @@ class FrontendWeblinksCest
$I->waitForText('Uncategorised','30', ['css' => 'h3']);
$I->checkForPhpNoticesOrWarnings();
$I->comment('I open the uncategorised Weblink Category');
$I->waitForElement(['link' => 'Uncategorised'], 60);
$I->click(['link' => 'Uncategorised']);
// Check that hits is 0
@ -81,7 +82,17 @@ class FrontendWeblinksCest
// Click on the link, go back, and check that hits is still 0
$I->click(['link' => $title]);
$I->moveBack();
$I->amOnPage('index.php?option=com_weblinks');
$I->waitForElement(['link' => 'Uncategorised'], 60);
$I->click(['link' => 'Uncategorised']);
$I->comment('I search the weblink: ' . $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 still 0');
$I->see('Hits: 0', ['class' => 'list-hits']);
}
@ -116,9 +127,15 @@ class FrontendWeblinksCest
// Click on the link, go back, and check that hits is 1
$I->click(['link' => $title]);
$I->amOnPage('index.php?option=com_weblinks');
$I->waitForText('Uncategorised','30', ['css' => 'h3']);
$I->comment('I open the uncategorised Weblink Category');
$I->waitForElement(['link' => 'Uncategorised'], 60);
$I->click(['link' => 'Uncategorised']);
$I->comment('I search the weblink: ' . $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']);
}