Commit fe46cf11 authored by Fabrice Gangler's avatar Fabrice Gangler 🎨
Browse files

TEST(software page): checks buttons (mapping section)

Refs: #940
parent 65fe9b9a
Pipeline #10224 passed with stage
in 4 minutes and 12 seconds
......@@ -123,9 +123,65 @@ class UserAdministrationCheckActionsCest
}
*/
/**
* Function to test the user dev-collectivite declaring himself as user of the ATOM software,
* using the buttons in the mapping section
*
* @group user_declareUserOfSoftware
* @group user_administration
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
public function declareUserOfSoftwareUsingButtonsInMappingSection(AcceptanceTester $I)
{
$lang = $this->lang;
$softwareToAddAsUser = "//a[@href=\"/$lang/softwares/163\"]"; // software Atom
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click($softwareToAddAsUser);
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSee('dev-collectivite', ['css' => 'ol li']); // user dev-collectivite
$I->SeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->SeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btnMapping_Softwares-usersSoftware-163"]'); // button : 'Se déclarer utilisateur'
$I->seeElement('div.message.success');
$I->seeInCurrentUrl("/$lang/mappingForm/163");
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click($softwareToAddAsUser);
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->seeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->seeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->seeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->seeElement('button.btn.btn-default.removeOne');
$I->see('dev-collectivite', ['css' => 'ol li']); // dev-collectivite on the list of users
$I->click('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]'); // button : 'Ne plus être utilisateur'
$I->dontSeeElement("//ol/li/div/a[@href=\"/$lang/softwares/163\"]");
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->SeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
}
/**
* Function to test the user dev-collectivite declaring himself as user of the ATOM software
*
* @group user_declareUserOfSoftware
* @group user_administration
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
......@@ -138,6 +194,10 @@ class UserAdministrationCheckActionsCest
$I->click($softwareToAddAsUser);
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSee('dev-collectivite', ['css' => 'ol li']); // user dev-collectivite
$I->SeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->SeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btn_Softwares-usersSoftware-163"]'); // button : 'Se déclarer utilisateur'
......@@ -147,6 +207,9 @@ class UserAdministrationCheckActionsCest
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click($softwareToAddAsUser);
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->seeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->seeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->seeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->seeElement('button.btn.btn-default.removeOne');
......@@ -156,8 +219,10 @@ class UserAdministrationCheckActionsCest
/**
* Function to test if dev-collectivite is not declared anymore as a user of Atom software anymore
*
* @param AcceptanceTester $I codeception variable
* @group user_declareUserOfSoftware
* @group user_administration
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
public function removeUserOfSoftware(AcceptanceTester $I)
......@@ -171,10 +236,16 @@ class UserAdministrationCheckActionsCest
$I->click("//ol/li/div/a[@href=\"/$lang/softwares/163\"]");
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->seeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->seeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btn_Softwares-deleteUsersSoftware-163"]'); // button : 'Ne plus être utilisateur'
$I->dontSeeElement("//ol/li/div/a[@href=\"/$lang/softwares/163\"]");
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->SeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
}
......@@ -182,6 +253,9 @@ class UserAdministrationCheckActionsCest
/**
* Check a correct declaration of userOf by the user dev-collectivite
*
* @group user_declareUserOfSoftware
* @group user_administration
*
* @param AcceptanceTester $I codeception constant
* @return void
*/
......@@ -212,6 +286,9 @@ class UserAdministrationCheckActionsCest
/**
* Remove a declared user dev-collectivite from the userList of a software 7-zip with more than 3 users.
*
* @group user_declareUserOfSoftware
* @group user_administration
*
* @param AcceptanceTester $I codeception constant
* @return void
*/
......
<?php
/**
* This file is to test actions that a anonymous user can do:
* - can't declare as user of a soft,
*
* @package App\Test\Acceptance
* @license https://spdx.org/licenses/AGPL-3.0-or-later.html Affero General Public License
*/
namespace App\Test\Acceptance;
use App\TestSuite\Codeception\AcceptanceTester;
/**
* Inherited Methods from App\src\TestSuite.Codeception\AcceptanceTester
*
* @package App\Test\Acceptance
* @license https://spdx.org/licenses/AGPL-3.0-or-later.html Affero General Public License
*/
class UserAnonymousCheckActionsCest
{
private $lang = 'en';
// @codingStandardsIgnoreStart
public function _before(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
$lang = $this->lang;
$I->amOnPage("/$lang/");
}
// @codingStandardsIgnoreStart
public function _after(AcceptanceTester $I)// @codingStandardsIgnoreEnd
{
}
/**
* Function to test that a anonymous user cannot declaring himself as user of the ATOM software
*
* @group user_declareUserOfSoftware
* @group anonymous
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
public function cantDeclareAsUserOfSoftware(AcceptanceTester $I)
{
$lang = $this->lang;
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click("//a[@href=\"/$lang/softwares/163\"]"); // software Atom
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSeeElement('//*[@id="btnDisabled_Softwares-usersSoftware-163"]');
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btn_Softwares-usersSoftware-163"]'); // button : 'Se déclarer utilisateur'
$I->seeInCurrentUrl("/$lang/users/login");
}
}
......@@ -53,8 +53,10 @@ class UserAssociationCheckActionsCest
/**
* Function to test the user dev-asso declaring himself as user of the ATOM software
*
* @param AcceptanceTester $I codeception variable
* @group user_declareUserOfSoftware
* @group user_association
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
public function declareAsUserOfSoftware(AcceptanceTester $I)
......@@ -64,21 +66,30 @@ class UserAssociationCheckActionsCest
$I->click("//a[@href=\"/$lang/softwares/163\"]"); // software Atom
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSee('dev-asso', ['css' => 'ol li']);
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btn_Softwares-usersSoftware-163"]'); // button : 'Se déclarer utilisateur'
$I->seeElement('div.message.success');
$I->seeElement('button.btn.btn-default.removeOne');
$I->see('dev-asso', ['css' => 'ol li']);
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
}
/**
* Function to test if dev-asso is not declared as a user of Atom software anymore
*
* @param AcceptanceTester $I codeception variable
* @group user_declareUserOfSoftware
* @group user_association
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
public function removeUserOfSoftware(AcceptanceTester $I)
......@@ -93,17 +104,25 @@ class UserAssociationCheckActionsCest
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btn_Softwares-deleteUsersSoftware-163"]'); // button : 'Ne plus être utilisateur'
$I->dontSeeElement("//ol/li/div/a[@href=\"/$lang/softwares/163\"]");
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
}
/**
* Check a correct declaration of userOf by the user dev-asso
*
* @param AcceptanceTester $I codeception constant
* @group user_declareUserOfSoftware
* @group user_association
*
* @param AcceptanceTester $I codeception constant
* @return void
*/
public function declareUserOfSoftwareWithMoreThan3Users(AcceptanceTester $I)
......@@ -127,8 +146,10 @@ class UserAssociationCheckActionsCest
/**
* Remove a declared user dev-asso from the userList of a software 7-zip with more than 3 users.
*
* @param AcceptanceTester $I codeception constant
* @group user_declareUserOfSoftware
* @group user_association
*
* @param AcceptanceTester $I codeception constant
* @return void
*/
public function removeUserOfSoftwareWithMoreThan3Users(AcceptanceTester $I)
......
......@@ -54,6 +54,9 @@ class UserPersonCheckActionsCest
/**
* Function to test the user dev-individu declaring himself as user of the ATOM software
*
* @group user_declareUserOfSoftware
* @group user_person
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
......@@ -66,17 +69,26 @@ class UserPersonCheckActionsCest
$I->dontSee('dev-individu', ['css' => 'ol li']); // dev-individu declared on the user list
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btn_Softwares-usersSoftware-163"]'); // button : 'Se déclarer utilisateur'
$I->seeElement('div.message.success');
$I->seeElement('button.btn.btn-default.removeOne');
$I->see('dev-individu', ['css' => 'ol li']); // dev-collectivite on the list of users
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
}
/**
* Function to test if dev-individu is not declared as a user of Atom software anymore
*
* @group user_declareUserOfSoftware
* @group user_person
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
......@@ -92,15 +104,24 @@ class UserPersonCheckActionsCest
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
$I->click('//*[@id="btn_Softwares-deleteUsersSoftware-163"]'); // button : 'Ne plus être utilisateur'
$I->dontSeeElement("//ol/li/div/a[@href=\"/$lang/softwares/163\"]");
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
}
/**
* Check a correct declaration of userOf by the user dev-individu
*
* @group user_declareUserOfSoftware
* @group user_person
*
* @param AcceptanceTester $I codeception constant
*
* @return void
......@@ -126,6 +147,9 @@ class UserPersonCheckActionsCest
/**
* Remove a declared user dev-individu from the userList of a software 7-zip with more than 3 users.
*
* @group user_declareUserOfSoftware
* @group user_person
*
* @param AcceptanceTester $I codeception constant
*
* @return void
......
......@@ -53,8 +53,10 @@ class UserProviderCheckActionsCest
/**
* Function to test the user dev-presta cannot declaring himself as user of the ATOM software
*
* @param AcceptanceTester $I codeception variable
* @group user_declareUserOfSoftware
* @group user_provider
*
* @param AcceptanceTester $I codeception variable
* @return void
*/
public function cantDeclareAsUserOfSoftware(AcceptanceTester $I)
......@@ -69,6 +71,9 @@ class UserProviderCheckActionsCest
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_Softwares-deleteUsersSoftware-163"]');
$I->dontSeeElement('//*[@id="btnMapping_TaxonomysSoftwares-mappingForm-163"]');
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment