Commit 3783dd3d authored by Matthieu FAURE's avatar Matthieu FAURE

Merge branch '684-fix-phpcs-errors-on-tests' into 'develop'

Resolve "Fix PHPCS errors on tests/"

Closes #684

See merge request !257
parents b02c1fb6 2f74fe79
Pipeline #5254 passed with stage
in 16 minutes and 3 seconds
......@@ -7,6 +7,7 @@
* @author julie gauthier <julie.gauthier@adullact.org>
* @license https://spdx.org/licenses/AGPL-3.0-or-later.html Affero General Public License
*/
namespace App\Test\Acceptance;
use App\TestSuite\Codeception\AcceptanceTester;
......
......@@ -60,5 +60,4 @@ class BasicTestsCest
}
//Todo check pages softwares, users and services providers
}
......@@ -48,7 +48,8 @@ class CheckResetPasswordActionCest
$I->click('//body/div[3]/main/div[3]/div/a'); // Forgot password link
$I->seeInCurrentUrl('/users/forgot-password');
$I->submitForm(
'#forgotPasswordForm', [
'#forgotPasswordForm',
[
'email' => 'dev-collectivite@comptoir-du-libre.org',
]
);
......
<?php
namespace App\Test\Acceptance;
use App\TestSuite\Codeception\AcceptanceTester;
class CheckSearchCest
{
// @codingStandardsIgnoreStart
public function _before(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
$I->amOnPage('/');
$I->seeInTitle('Comptoir du libre');
}
// @codingStandardsIgnoreStart
public function _after(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
}
// Note: MFaure 2019-07-15
// All following tests are commented out as we prefer having a working subset of F-tests
// than a larger non working set. Those F-tests will be re-factored, hopefully in a near future
// Nevertheless, we don't want to loose this code, hence we keep it commented.
// If not refactored by 2020-09-01, the commented code can be deleted
/*
// Test the search functionality from the home page
public function checkSearchWithWordUjdrhouigrfedft(AcceptanceTester $I)
{
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'Ujdrhouigrfedft'], 'submit');
$I->seeInCurrentUrl('pages/search?search=Ujdrhouigrfedft');
$I->See('Aucun résultat pour ');
$I->seeElement('//h2[1]');
$I->see('Aucun logiciel pour');
$I->seeElement('//h2[2]');
$I->see('Aucun utilisateur pour');
}
public function checkSearchWithWordMailWithoutAnySortBy(AcceptanceTester $I)
{
$SoftwareWithWordMail1st = '//ol/li[1]/div/a[@href="/fr/softwares/46"]'; // FusionDirectory
$SoftwareWithWordMail4th = '//ol/li[4]/div/a[@href="/fr/softwares/50"]'; // KeePass
$SoftwareWithWordMail5th = '//ol/li[5]/div/a[@href="/fr/softwares/28"]'; // LinShare
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'mail'], 'submit');
$I->seeInCurrentUrl('pages/search?search=mail');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordMail1st);
$I->seeElement($SoftwareWithWordMail4th);
$I->seeElement($SoftwareWithWordMail5th);
$I->dontSeeElement('//section[2]/ol');
}
public function checkSearchWithWordLibreWithoutAnySortBy(AcceptanceTester $I)
{
$SoftwareWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/softwares/47"]'; // Dolibarr
$SoftwareWithWordLibre4th = '//ol/li[4]/div/a[@href="/fr/softwares/15"]'; // idelibRe
$SoftwareWithWordLibre15th = '//ol/li[15]/div/a[@href="/fr/softwares/78"]'; // Ooo.HG
$UserWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/users/57"]'; // 2i2L
$UserWithWordLibre8th = '//ol/li[8]/div/a[@href="/fr/users/68"]'; // Opendsi
$UserWithWordLibre12th = '//ol/li[12]/div/a[@href="/fr/users/66"]'; // teclib
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'libre'], 'submit');
$I->seeInCurrentUrl('pages/search?search=libre');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordLibre1st);
$I->seeElement($SoftwareWithWordLibre4th);
$I->seeElement($SoftwareWithWordLibre15th);
$I->seeElement($UserWithWordLibre1st);
$I->seeElement($UserWithWordLibre8th);
$I->seeElement($UserWithWordLibre12th);
}
public function checkSearchWithWordLibReWithoutAnySortByCaseSensitive(AcceptanceTester $I)
{
$SoftwareWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/softwares/47"]'; // Dolibarr
$SoftwareWithWordLibre4th = '//ol/li[4]/div/a[@href="/fr/softwares/15"]'; // idelibRe
$SoftwareWithWordLibre15th = '//ol/li[15]/div/a[@href="/fr/softwares/78"]'; // Ooo.HG
$UserWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/users/57"]'; // 2i2L
$UserWithWordLibre8th = '//ol/li[8]/div/a[@href="/fr/users/68"]'; // Opendsi
$UserWithWordLibre12th = '//ol/li[12]/div/a[@href="/fr/users/66"]'; // teclib
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'LiBRe'], 'submit');
$I->seeInCurrentUrl('pages/search?search=LiBRe');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordLibre1st);
$I->seeElement($SoftwareWithWordLibre4th);
$I->seeElement($SoftwareWithWordLibre15th);
$I->seeElement($UserWithWordLibre1st);
$I->seeElement($UserWithWordLibre8th);
$I->seeElement($UserWithWordLibre12th);
}
public function checkSearchWithWordLibreWithFilterReview(AcceptanceTester $I)
{
$SoftwareWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/softwares/4"]'; // i parapheur
$SoftwareWithWordLibre4th = '//ol/li[4]/div/a[@href="/fr/softwares/26"]'; // Publik
$UserWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/users/57"]'; // 2i2L
$UserWithWordLibre8th = '//ol/li[8]/div/a[@href="/fr/users/68"]'; // Opendsi
$UserWithWordLibre12th = '//ol/li[12]/div/a[@href="/fr/users/66"]'; // teclib
$I->amOnPage('pages/search?search=LiBRe');
$I->selectOption('//form/div[2]/select', 'true');
$I->click('Filtrer');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordLibre1st);
$I->seeElement($SoftwareWithWordLibre4th);
$I->seeElement($UserWithWordLibre1st);
$I->seeElement($UserWithWordLibre8th);
$I->seeElement($UserWithWordLibre12th);
}
*/
}
<?php
namespace App\Test\Acceptance;
use App\TestSuite\Codeception\AcceptanceTester;
class CheckUsersSortByCest
{
// @codingStandardsIgnoreStart
public function _before(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
$I->amOnPage('/users');
$I->seeInTitle('Listes des utilisateurs');
}
// @codingStandardsIgnoreStart
public function _after(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
}
// Note: MFaure 2019-07-15
// All following tests are commented out as we prefer having a working subset of F-tests
// than a larger non working set. Those F-tests will be re-factored, hopefully in a near future
// Nevertheless, we don't want to loose this code, hence we keep it commented.
// If not refactored by 2020-09-01, the commented code can be deleted
/*
public function checkUsersSortByAscWithSoftwareDeclare(AcceptanceTester $I)
{
$UserSortByAscWithSoftware1st = ('//ol/li[1]/div/a["Administration1"]');
$UserSortByAscWithSoftware5th = ('//ol/li[5]/div/a["Association la Mouette"]');
$UserSortByAscWithSoftware22th = (
'//ol/li[22]/div/a[@title="Nom de l\'utilisateur : Conseil Départemental Côtes d\'Armor (22)"]'
);
$I->selectOption('//form/div[1]/select', 'true');
$I->click('Filtrer');
$I->seeOptionIsSelected('//form/div[1]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscWithSoftware1st);
$I->seeElement($UserSortByAscWithSoftware5th);
$I->seeElement($UserSortByAscWithSoftware22th);
}
public function checkUsersSortByAscWithReviewPosted(AcceptanceTester $I)
{
$UserSortByAscWithReview1st = ('//ol/li[1]/div/a[@href="/fr/users/45"]'); // Centre Régional Réunion
$UserSortByAscWithReview3th = ('//ol/li[3]/div/a[@href="/fr/users/42"]'); // Communauté d'Agglomération Sud...
$UserSortByAscWithReview6th = ('//ol/li[6]/div/a[@href="/fr/users/15"]'); // Ville de Paris
$I->selectOption('//form/div[2]/select', 'true');
$I->click('Filtrer');
$I->seeOptionIsSelected('//form/div[2]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscWithReview1st);
$I->seeElement($UserSortByAscWithReview3th);
$I->seeElement($UserSortByAscWithReview6th);
}
public function checkUsersSortByAscWithServiceProviderDeclareOnSoftware(AcceptanceTester $I)
{
$UserSortByAscWithServProvider1st = ('//ol/li[1]/div/a[@href="/fr/users/75"]'); // AF83
$UserSortByAscWithServProvider4th = ('//ol/li[4]/div/a[@href="/fr/users/6"]'); // Libriciel SCOP
$UserSortByAscWithServProvider10th = ('//ol/li[10]/div/a[@href="/fr/users/132"]'); // Syloé
$I->selectOption('//form/div[3]/select', 'true');
$I->click('Filtrer');
$I->seeOptionIsSelected('//form/div[3]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscWithServProvider1st);
$I->seeElement($UserSortByAscWithServProvider4th);
$I->seeElement($UserSortByAscWithServProvider10th);
}
public function checkUsersSortByAscAsAdministration(AcceptanceTester $I)
{
$UserSortByAscAsAdministration1st = ('//ol/li[1]/div/a[@href="/fr/users/204"]'); // Administration1
$UserSortByAscAsAdministration12th = (
'//ol/li[12]/div/a[@href="/fr/users/42"]'
); // Communauté d'Aglomeration Sud...
$UserSortByAscAsAdministration33th = ('//ol/li[33]/div/a[@href="/fr/users/47"]'); // Ville de Bezier
$I->selectOption('//form/div[4]/select', 'Administration');
$I->click('Filtrer');
// $I->seeOptionIsSelected('//form/div[4]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscAsAdministration1st);
$I->seeElement($UserSortByAscAsAdministration12th);
$I->seeElement($UserSortByAscAsAdministration33th);
}
public function checkUsersSortByAscAsPerson(AcceptanceTester $I)
{
$UserSortByAscAsPerson1st = ('//ol/li[1]/div/a[@href="/fr/users/131"]'); // benasse
$UserSortByAscAsPerson5th = ('//ol/li[5]/div/a[@href="/fr/users/84"]'); // Francois ELIE
$UserSortByAscAsPerson8th = ('//ol/li[8]/div/a[@href="/fr/users/71"]'); // Matthieu FAURE
$I->selectOption('//form/div[4]/select', 'Person');
$I->click('Filtrer');
// $I->seeOptionIsSelected('//form/div[4]/select', 'Individu');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscAsPerson1st);
$I->seeElement($UserSortByAscAsPerson5th);
$I->seeElement($UserSortByAscAsPerson8th);
}
*/
}
This diff is collapsed.
......@@ -12,6 +12,7 @@
* @author julie gauthier <julie.gauthier@adullact.org>
* @license https://spdx.org/licenses/AGPL-3.0-or-later.html Affero General Public License
*/
namespace App\Test\Acceptance;
use App\TestSuite\Codeception\AcceptanceTester;
......@@ -42,64 +43,77 @@ class UserAdministrationCheckActionsCest
$I->canSeeElement('#signinform');
}
// tests
// public function AddNewSoftware(AcceptanceTester $I)
// {
// $I->loginMe('fake-email@comptoir-du-libre.org133', 'pwdComptoirTest', 'canizares');
// $I->seeElement('div.message.success');
// $I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
// $I->click('//body/div[3]/main/section/div[1]/form/button'); // button 'Ajouter un logiciel'
// $I->fillField('//*[@id="softwarename"]', 'testSoftware1');
// $I->fillField('//*[@id="url-website"]', 'http://testSoftware1.fr');
// $I->fillField('//*[@id="url-repository"]', 'http://testSoftware1.git');
// $I->attachFile('//*[@id="photo"]', 'correctSoftwareLogo.jpg'); // can't fill field with a file out of Fixture file??
// $I->selectOption('//*[@id="licence-id"]', '13');
// $I->fillField('//*[@id="tags"]', 'tag');
// $I->click('//body/div[3]/main/div[3]/div/div/form/button');
// $I->seeElement('div.message.success');
// $I->logoutMe('canizares');
// $I->canSeeElement('#signinform');
// }
//
// public function AddSoftwareWithNameAlreadyExisting(AcceptanceTester $I)
// {
// $I->loginMe('fake-email@comptoir-du-libre.org133', 'pwdComptoirTest', 'canizares');
// $I->seeElement('div.message.success');
// $I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
// $I->click('//body/div[3]/main/section/div[1]/form/button'); // button 'Ajouter un logiciel'
// $I->fillField('//*[@id="softwarename"]', 'Alfresco');
// $I->fillField('//*[@id="url-website"]', 'http://testSoftware2.fr');
// $I->fillField('//*[@id="url-repository"]', 'http://testSoftware2.git');
// $I->attachFile('//*[@id="photo"]', 'correctSoftwareLogo.jpg'); // can't fill field with a file out of Fixture file ??
// $I->selectOption('//*[@id="licence-id"]', '14');
// $I->fillField('//*[@id="tags"]', 'tag');
// $I->click('//body/div[3]/main/div[3]/div/div/form/button'); // submit button
// $I->seeElement('div.error.error');
// $I->logoutMe('canizares');
// $I->canSeeElement('#signinform');
// }
//
// public function editSoftware(AcceptanceTester $I)
// {
// $I->loginMe('fake-email@comptoir-du-libre.org133', 'pwdComptoirTest', 'canizares');
// $I->seeElement('div.message.success');
// $I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
// $I->click('Alfresco');
// $I->seeInCurrentUrl('softwares/29');
// $I->click('//body/div[3]/main/section[1]/div[2]/ul/li[6]/a'); // button 'Modifier'
// $I->seeInCurrentUrl('softwares/edit/29');
// $I->fillField('//*[@id="softwarename"]', 'Alfresco');
// $I->fillField('//*[@id="url-website"]', 'http://testSoftware3.fr');
// $I->fillField('//*[@id="url-repository"]', 'http://testSoftware3.git');
// $I->fillField('//*[@id="description"]', 'Test modification');
// $I->attachFile('//*[@id="photo"]', 'correctSoftwareLogo.jpg');
// $I->selectOption('//*[@id="licence-id"]', '14');
// $I->fillField('//*[@id="tags"]', 'tag');
// $I->click('(//button[@type=\'submit\'])[2]'); // submit button
// $I->seeElement('div.message.success');
// $I->logoutMe('canizares');
// $I->canSeeElement('#signinform');
// }
// Note: MFaure 2019-07-15
// All following tests are commented out as we prefer having a working subset of F-tests
// than a larger non working set. Those F-tests will be re-factored, hopefully in a near future
// Nevertheless, we don't want to loose this code, hence we keep it commented.
// If not refactored by 2020-09-01, the commented code can be deleted
/*
public function AddNewSoftware(AcceptanceTester $I)
{
$I->loginMe('fake-email@comptoir-du-libre.org133', 'pwdComptoirTest', 'canizares');
$I->seeElement('div.message.success');
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click('//body/div[3]/main/section/div[1]/form/button'); // button 'Ajouter un logiciel'
$I->fillField('//*[@id="softwarename"]', 'testSoftware1');
$I->fillField('//*[@id="url-website"]', 'http://testSoftware1.fr');
$I->fillField('//*[@id="url-repository"]', 'http://testSoftware1.git');
$I->attachFile(
'//*[@id="photo"]',
'correctSoftwareLogo.jpg'
); // can't fill field with a file out of Fixture file??
$I->selectOption('//*[@id="licence-id"]', '13');
$I->fillField('//*[@id="tags"]', 'tag');
$I->click('//body/div[3]/main/div[3]/div/div/form/button');
$I->seeElement('div.message.success');
$I->logoutMe('canizares');
$I->canSeeElement('#signinform');
}
public function AddSoftwareWithNameAlreadyExisting(AcceptanceTester $I)
{
$I->loginMe('fake-email@comptoir-du-libre.org133', 'pwdComptoirTest', 'canizares');
$I->seeElement('div.message.success');
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click('//body/div[3]/main/section/div[1]/form/button'); // button 'Ajouter un logiciel'
$I->fillField('//*[@id="softwarename"]', 'Alfresco');
$I->fillField('//*[@id="url-website"]', 'http://testSoftware2.fr');
$I->fillField('//*[@id="url-repository"]', 'http://testSoftware2.git');
$I->attachFile(
'//*[@id="photo"]',
'correctSoftwareLogo.jpg'
); // can't fill field with a file out of Fixture file ??
$I->selectOption('//*[@id="licence-id"]', '14');
$I->fillField('//*[@id="tags"]', 'tag');
$I->click('//body/div[3]/main/div[3]/div/div/form/button'); // submit button
$I->seeElement('div.error.error');
$I->logoutMe('canizares');
$I->canSeeElement('#signinform');
}
public function editSoftware(AcceptanceTester $I)
{
$I->loginMe('fake-email@comptoir-du-libre.org133', 'pwdComptoirTest', 'canizares');
$I->seeElement('div.message.success');
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click('Alfresco');
$I->seeInCurrentUrl('softwares/29');
$I->click('//body/div[3]/main/section[1]/div[2]/ul/li[6]/a'); // button 'Modifier'
$I->seeInCurrentUrl('softwares/edit/29');
$I->fillField('//*[@id="softwarename"]', 'Alfresco');
$I->fillField('//*[@id="url-website"]', 'http://testSoftware3.fr');
$I->fillField('//*[@id="url-repository"]', 'http://testSoftware3.git');
$I->fillField('//*[@id="description"]', 'Test modification');
$I->attachFile('//*[@id="photo"]', 'correctSoftwareLogo.jpg');
$I->selectOption('//*[@id="licence-id"]', '14');
$I->fillField('//*[@id="tags"]', 'tag');
$I->click('(//button[@type=\'submit\'])[2]'); // submit button
$I->seeElement('div.message.success');
$I->logoutMe('canizares');
$I->canSeeElement('#signinform');
}
*/
/**
* Function to test the user dev-collectivite declaring himself as user of the ATOM software
......@@ -200,7 +214,8 @@ class UserAdministrationCheckActionsCest
$I->click('a[href="/api/v1/users/change-password/284"]'); // Change password link
$I->canSeeInCurrentUrl('users/change-password/284');
$I->submitForm(
'#editAccountPasswordForm', [
'#editAccountPasswordForm',
[
'old_password' => 'comptoir',
'new_password' => $newPassword,
'confirm_password' => $newPassword,
......@@ -226,16 +241,12 @@ class UserAdministrationCheckActionsCest
$I->click('a[href="/users/edit/284"]'); // Edit user's button
$I->canSeeInCurrentUrl('/users/edit/284');
$I->submitForm(
'#editInformationAccountForm', [
'#editInformationAccountForm',
[
'url' => 'http://localhost:8080/users/284',
'description' => 'administration',
]
);
$I->seeElement('div.message.success');
}
// public function addReviewOnSoftware(AcceptanceTester $I)
// {
// }
//
}
......@@ -139,7 +139,8 @@ class UserAssociationCheckActionsCest
$I->click('a[href="/api/v1/users/change-password/287"]'); // Change password link
$I->canSeeInCurrentUrl('users/change-password/287');
$I->submitForm(
'#editAccountPasswordForm', [
'#editAccountPasswordForm',
[
'old_password' => 'comptoir',
'new_password' => $newPassword,
'confirm_password' => $newPassword,
......@@ -165,7 +166,8 @@ class UserAssociationCheckActionsCest
$I->click('a[href="/users/edit/287"]'); // Edit user's button
$I->canSeeInCurrentUrl('/users/edit/287');
$I->submitForm(
'#editInformationAccountForm', [
'#editInformationAccountForm',
[
'url' => 'http://localhost:8080/users/287',
'description' => 'association',
]
......
......@@ -140,7 +140,8 @@ class UserPersonCheckActionsCest
$I->click('a[href="/api/v1/users/change-password/285"]'); // Change password link
$I->canSeeInCurrentUrl('users/change-password/285');
$I->submitForm(
'#editAccountPasswordForm', [
'#editAccountPasswordForm',
[
'old_password' => 'comptoir',
'new_password' => $newPassword,
'confirm_password' => $newPassword,
......@@ -166,7 +167,8 @@ class UserPersonCheckActionsCest
$I->click('a[href="/users/edit/285"]'); // Edit user's button
$I->canSeeInCurrentUrl('/users/edit/285');
$I->submitForm(
'#editInformationAccountForm', [
'#editInformationAccountForm',
[
'url' => 'http://localhost:8080/users/285',
'description' => 'person',
]
......
......@@ -76,7 +76,8 @@ class UserProviderCheckActionsCest
$I->click('a[href="/api/v1/users/change-password/286"]'); // Change password link
$I->canSeeInCurrentUrl('users/change-password/286');
$I->submitForm(
'#editAccountPasswordForm', [
'#editAccountPasswordForm',
[
'old_password' => 'comptoir',
'new_password' => $newPassword,
'confirm_password' => $newPassword,
......@@ -102,7 +103,8 @@ class UserProviderCheckActionsCest
$I->click('a[href="/users/edit/286"]'); // Edit user's button
$I->canSeeInCurrentUrl('/users/edit/286');
$I->submitForm(
'#editInformationAccountForm', [
'#editInformationAccountForm',
[
'url' => 'http://localhost:8080/users/286',
'description' => 'service provider',
]
......
<?php
// Here you can initialize variables that will be available to your tests, e.g. the app's bootstrap.php
\ No newline at end of file
// Here you can initialize variables that will be available to your tests, e.g. the app's bootstrap.php
<?php
namespace App\Test\Acceptance;
use App\TestSuite\Codeception\AcceptanceTester;
class checkSearchCest
{
// @codingStandardsIgnoreStart
public function _before(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
$I->amOnPage('/');
$I->seeInTitle('Comptoir du libre');
}
// @codingStandardsIgnoreStart
public function _after(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
}
// Test the search functionality from the home page
/* public function checkSearchWithWordUjdrhouigrfedft(AcceptanceTester $I)
{
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'Ujdrhouigrfedft'], 'submit');
$I->seeInCurrentUrl('pages/search?search=Ujdrhouigrfedft');
$I->See('Aucun résultat pour ');
$I->seeElement('//h2[1]');
$I->see('Aucun logiciel pour');
$I->seeElement('//h2[2]');
$I->see('Aucun utilisateur pour');
}
public function checkSearchWithWordMailWithoutAnySortBy(AcceptanceTester $I)
{
$SoftwareWithWordMail1st = '//ol/li[1]/div/a[@href="/fr/softwares/46"]'; // FusionDirectory
$SoftwareWithWordMail4th = '//ol/li[4]/div/a[@href="/fr/softwares/50"]'; // KeePass
$SoftwareWithWordMail5th = '//ol/li[5]/div/a[@href="/fr/softwares/28"]'; // LinShare
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'mail'], 'submit');
$I->seeInCurrentUrl('pages/search?search=mail');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordMail1st);
$I->seeElement($SoftwareWithWordMail4th);
$I->seeElement($SoftwareWithWordMail5th);
$I->dontSeeElement('//section[2]/ol');
}
public function checkSearchWithWordLibreWithoutAnySortBy(AcceptanceTester $I)
{
$SoftwareWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/softwares/47"]'; // Dolibarr
$SoftwareWithWordLibre4th = '//ol/li[4]/div/a[@href="/fr/softwares/15"]'; // idelibRe
$SoftwareWithWordLibre15th = '//ol/li[15]/div/a[@href="/fr/softwares/78"]'; // Ooo.HG
$UserWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/users/57"]'; // 2i2L
$UserWithWordLibre8th = '//ol/li[8]/div/a[@href="/fr/users/68"]'; // Opendsi
$UserWithWordLibre12th = '//ol/li[12]/div/a[@href="/fr/users/66"]'; // teclib
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'libre'], 'submit');
$I->seeInCurrentUrl('pages/search?search=libre');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordLibre1st);
$I->seeElement($SoftwareWithWordLibre4th);
$I->seeElement($SoftwareWithWordLibre15th);
$I->seeElement($UserWithWordLibre1st);
$I->seeElement($UserWithWordLibre8th);
$I->seeElement($UserWithWordLibre12th);
}
public function checkSearchWithWordLibReWithoutAnySortByCaseSensitive(AcceptanceTester $I)
{
$SoftwareWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/softwares/47"]'; // Dolibarr
$SoftwareWithWordLibre4th = '//ol/li[4]/div/a[@href="/fr/softwares/15"]'; // idelibRe
$SoftwareWithWordLibre15th = '//ol/li[15]/div/a[@href="/fr/softwares/78"]'; // Ooo.HG
$UserWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/users/57"]'; // 2i2L
$UserWithWordLibre8th = '//ol/li[8]/div/a[@href="/fr/users/68"]'; // Opendsi
$UserWithWordLibre12th = '//ol/li[12]/div/a[@href="/fr/users/66"]'; // teclib
$I->submitForm('//*[@id="navbar-search"]', ['search' => 'LiBRe'], 'submit');
$I->seeInCurrentUrl('pages/search?search=LiBRe');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordLibre1st);
$I->seeElement($SoftwareWithWordLibre4th);
$I->seeElement($SoftwareWithWordLibre15th);
$I->seeElement($UserWithWordLibre1st);
$I->seeElement($UserWithWordLibre8th);
$I->seeElement($UserWithWordLibre12th);
}
public function checkSearchWithWordLibreWithFilterReview(AcceptanceTester $I)
{
$SoftwareWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/softwares/4"]'; // i parapheur
$SoftwareWithWordLibre4th = '//ol/li[4]/div/a[@href="/fr/softwares/26"]'; // Publik
$UserWithWordLibre1st = '//ol/li[1]/div/a[@href="/fr/users/57"]'; // 2i2L
$UserWithWordLibre8th = '//ol/li[8]/div/a[@href="/fr/users/68"]'; // Opendsi
$UserWithWordLibre12th = '//ol/li[12]/div/a[@href="/fr/users/66"]'; // teclib
$I->amOnPage('pages/search?search=LiBRe');
$I->selectOption('//form/div[2]/select', 'true');
$I->click('Filtrer');
$I->dontSee('Aucun résultat pour');
$I->seeElement($SoftwareWithWordLibre1st);
$I->seeElement($SoftwareWithWordLibre4th);
$I->seeElement($UserWithWordLibre1st);
$I->seeElement($UserWithWordLibre8th);
$I->seeElement($UserWithWordLibre12th);
}
*/
}
<?php
namespace App\Test\Acceptance;
use App\TestSuite\Codeception\AcceptanceTester;
class checkUsersSortByCest
{
// @codingStandardsIgnoreStart
public function _before(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
$I->amOnPage('/users');
$I->seeInTitle('Listes des utilisateurs');
}
// @codingStandardsIgnoreStart
public function _after(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
}
// tests
/* public function checkUsersSortByAscWithSoftwareDeclare(AcceptanceTester $I)
{
$UserSortByAscWithSoftware1st = ('//ol/li[1]/div/a["Administration1"]');
$UserSortByAscWithSoftware5th = ('//ol/li[5]/div/a["Association la Mouette"]');
$UserSortByAscWithSoftware22th = ('//ol/li[22]/div/a[@title="Nom de l\'utilisateur : Conseil Départemental Côtes d\'Armor (22)"]');
$I->selectOption('//form/div[1]/select', 'true');
$I->click('Filtrer');
$I->seeOptionIsSelected('//form/div[1]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscWithSoftware1st);
$I->seeElement($UserSortByAscWithSoftware5th);
$I->seeElement($UserSortByAscWithSoftware22th);
}
public function checkUsersSortByAscWithReviewPosted(AcceptanceTester $I)
{
$UserSortByAscWithReview1st = ('//ol/li[1]/div/a[@href="/fr/users/45"]'); // Centre Régional Réunion
$UserSortByAscWithReview3th = ('//ol/li[3]/div/a[@href="/fr/users/42"]'); // Communauté d'Agglomération Sud...
$UserSortByAscWithReview6th = ('//ol/li[6]/div/a[@href="/fr/users/15"]'); // Ville de Paris
$I->selectOption('//form/div[2]/select', 'true');
$I->click('Filtrer');
$I->seeOptionIsSelected('//form/div[2]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscWithReview1st);
$I->seeElement($UserSortByAscWithReview3th);
$I->seeElement($UserSortByAscWithReview6th);
}
public function checkUsersSortByAscWithServiceProviderDeclareOnSoftware(AcceptanceTester $I)
{
$UserSortByAscWithServProvider1st = ('//ol/li[1]/div/a[@href="/fr/users/75"]'); // AF83
$UserSortByAscWithServProvider4th = ('//ol/li[4]/div/a[@href="/fr/users/6"]'); // Libriciel SCOP
$UserSortByAscWithServProvider10th = ('//ol/li[10]/div/a[@href="/fr/users/132"]'); // Syloé
$I->selectOption('//form/div[3]/select', 'true');
$I->click('Filtrer');
$I->seeOptionIsSelected('//form/div[3]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscWithServProvider1st);
$I->seeElement($UserSortByAscWithServProvider4th);
$I->seeElement($UserSortByAscWithServProvider10th);
}
public function checkUsersSortByAscAsAdministration(AcceptanceTester $I)
{
$UserSortByAscAsAdministration1st = ('//ol/li[1]/div/a[@href="/fr/users/204"]'); // Administration1
$UserSortByAscAsAdministration12th = ('//ol/li[12]/div/a[@href="/fr/users/42"]'); // Communauté d'Aglomeration Sud...
$UserSortByAscAsAdministration33th = ('//ol/li[33]/div/a[@href="/fr/users/47"]'); // Ville de Bezier
$I->selectOption('//form/div[4]/select', 'Administration');
$I->click('Filtrer');
// $I->seeOptionIsSelected('//form/div[4]/select', 'Oui');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscAsAdministration1st);
$I->seeElement($UserSortByAscAsAdministration12th);
$I->seeElement($UserSortByAscAsAdministration33th);
}
public function checkUsersSortByAscAsPerson(AcceptanceTester $I)
{
$UserSortByAscAsPerson1st = ('//ol/li[1]/div/a[@href="/fr/users/131"]'); // benasse
$UserSortByAscAsPerson5th = ('//ol/li[5]/div/a[@href="/fr/users/84"]'); // Francois ELIE
$UserSortByAscAsPerson8th = ('//ol/li[8]/div/a[@href="/fr/users/71"]'); // Matthieu FAURE
$I->selectOption('//form/div[4]/select', 'Person');
$I->click('Filtrer');
// $I->seeOptionIsSelected('//form/div[4]/select', 'Individu');
$I->seeOptionIsSelected('//form/div[5]/select', 'Ordre alphabétique : A-Z');
$I->seeElement($UserSortByAscAsPerson1st);
$I->seeElement($UserSortByAscAsPerson5th);
$I->seeElement($UserSortByAscAsPerson8th);
}
*/
}
This diff is collapsed.
......@@ -7,7 +7,8 @@ use Cake\TestSuite\Fixture\TestFixture;
* UserTypesFixture
*
*/
class UserTypesFixture extends TestFixture {
class UserTypesFixture extends TestFixture
{
/**
* Fields
......
<?php
// Here you can initialize variables that will be available to your tests, e.g. the app's bootstrap.php
\ No newline at end of file
// Here you can initialize variables that will be available to your tests, e.g. the app's bootstrap.php
......@@ -3,20 +3,21 @@
namespace App\Test\TestCase\Controller\Api\V1;
use Cake\Auth\DefaultPasswordHasher;