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

TEST: add tests for mapping edit button

Refs: #903
parent d2b26cb0
......@@ -132,12 +132,17 @@ class UserAdministrationCheckActionsCest
$I->click($softwareToAddAsUser);
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSee('dev-collectivite', ['css' => 'ol li']); // user dev-collectivite
$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'
$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->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
}
......@@ -159,8 +164,13 @@ class UserAdministrationCheckActionsCest
$I->seeElement("//ol/li/div/a[@href=\"/$lang/softwares/163\"]"); // Atom software declared
$I->click("//ol/li/div/a[@href=\"/$lang/softwares/163\"]");
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-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->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
}
/**
......@@ -177,12 +187,17 @@ class UserAdministrationCheckActionsCest
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click('7-zip');
$I->seeInCurrentUrl("/$lang/softwares/72");
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->click('//*[@id="btn_Softwares-usersSoftware-72"]'); // button : 'Se déclarer utilisateur'
$I->seeElement('div.message.success');
$I->seeInCurrentUrl("/$lang/mappingForm/72");
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click('7-zip');
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->seeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->click('//section[2]/section[1]/ol/li[4]/div/p/a'); // button : see all users of 7-Zip
$I->seeInCurrentUrl("/$lang/softwares/usersSoftware/72");
$I->see('dev-collectivite', ['css' => 'ol li']); // dev-collectivite on the list of users
......@@ -200,8 +215,13 @@ class UserAdministrationCheckActionsCest
$I->see('7-zip'); // declared as userOf 7-zip
$I->click('7-zip');
$I->seeInCurrentUrl('softwares/72');
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->seeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->click('//*[@id="btn_Softwares-deleteUsersSoftware-72"]'); // button : 'Ne plus être utilisateur'
$I->seeElement('div.message.success');
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->click('//section[2]/section[1]/ol/li[4]/div/p/a'); // button : see all users of 7-Zip
$I->dontsee('dev-collectivite', ['css' => 'ol li']); // dev-collectivite is not in the list of users
}
......
......@@ -58,10 +58,14 @@ class UserAssociationCheckActionsCest
$I->click("//a[@href=\"/$lang/softwares/163\"]"); // software Atom
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSee('dev-asso', ['css' => 'ol li']);
$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'
$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"]');
}
/**
......@@ -81,8 +85,12 @@ class UserAssociationCheckActionsCest
$I->seeElement("//ol/li/div/a[@href=\"/$lang/softwares/163\"]"); // Atom software declared
$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="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->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
}
/**
......@@ -99,8 +107,12 @@ class UserAssociationCheckActionsCest
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click('7-zip');
$I->seeInCurrentUrl('softwares/72');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->click('//*[@id="btn_Softwares-usersSoftware-72"]'); // button : 'Se déclarer utilisateur'
$I->seeElement('div.message.success');
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->click('//section[2]/section[1]/ol/li[4]/div/p/a'); // button : see all users of 7-Zip
$I->seeInCurrentUrl('softwares/usersSoftware/72');
$I->see('dev-asso', ['css' => 'ol li']); // dev-asso on the list of users
......@@ -119,8 +131,12 @@ class UserAssociationCheckActionsCest
$I->see('7-zip'); // declared as userOf 7-zip
$I->click('7-zip');
$I->seeInCurrentUrl('softwares/72');
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->click('//*[@id="btn_Softwares-deleteUsersSoftware-72"]'); // button : 'Ne plus être utilisateur'
$I->seeElement('div.message.success');
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->click('//section[2]/section[1]/ol/li[4]/div/p/a'); // button : see all users of 7-Zip
$I->dontsee('dev-asso', ['css' => 'ol li']); // dev-asso is not in the list of users
}
......
......@@ -49,7 +49,6 @@ class UserPersonCheckActionsCest
* Function to test the user dev-individu declaring himself as user of the ATOM software
*
* @param AcceptanceTester $I codeception variable
*
* @return void
*/
public function declareAsUserOfSoftware(AcceptanceTester $I)
......@@ -59,17 +58,20 @@ class UserPersonCheckActionsCest
$I->click("//a[@href=\"/$lang/softwares/163\"]"); // software Atom
$I->seeInCurrentUrl("/$lang/softwares/163");
$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->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"]');
}
/**
* Function to test if dev-individu is not declared as a user of Atom software anymore
*
* @param AcceptanceTester $I codeception variable
*
* @return void
*/
public function removeUserOfSoftware(AcceptanceTester $I)
......@@ -82,8 +84,12 @@ class UserPersonCheckActionsCest
$I->seeElement("//ol/li/div/a[@href=\"/$lang/softwares/163\"]"); // Atom software declared
$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="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->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-163"]');
}
/**
......@@ -100,8 +106,12 @@ class UserPersonCheckActionsCest
$I->click('//*[@id="softwaresPage"]'); // button 'Logiciels'
$I->click('7-zip');
$I->seeInCurrentUrl('softwares/72');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->click('//*[@id="btn_Softwares-usersSoftware-72"]'); // button : 'Se déclarer utilisateur'
$I->seeElement('div.message.success');
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->seeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->click('//section[2]/section[1]/ol/li[4]/div/p/a'); // button : see all users of 7-Zip
$I->seeInCurrentUrl('softwares/usersSoftware/72');
$I->see('dev-individu', ['css' => 'ol li']); // dev-individu on the list of users
......@@ -120,8 +130,12 @@ class UserPersonCheckActionsCest
$I->see('7-zip'); // declared as userOf 7-zip
$I->click('7-zip');
$I->seeInCurrentUrl('softwares/72');
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-72"]');
$I->click('//*[@id="btn_Softwares-deleteUsersSoftware-72"]'); // button : 'Ne plus être utilisateur'
$I->seeElement('div.message.success');
$I->seeElement('//*[@id="btn_Softwares-usersSoftware-72"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-72"]');
$I->click('//section[2]/section[1]/ol/li[4]/div/p/a'); // button : see all users of 7-Zip
$I->dontsee('dev-individu', ['css' => 'ol li']); // dev-individu is not in the list of users
}
......
......@@ -59,6 +59,10 @@ class UserProviderCheckActionsCest
$I->seeInCurrentUrl("/$lang/softwares/163");
$I->dontSee('dev-presta', ['css' => 'ol li']);
$I->seeElement('//button[@disabled="disabled"]'); // button 'declare user of' is disable
$I->seeElement('//*[@id="btnDisabled_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-usersSoftware-163"]');
$I->dontSeeElement('//*[@id="btn_TaxonomysSoftwares-mappingForm-163"]');
$I->dontSeeElement('//*[@id="btn_Softwares-deleteUsersSoftware-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