-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Prepare Behat scenarios for User system refacto (#339) * Refacto User login * Add reset password * Add Organization promote/revoke User * Add ROLE_SUPER_ADMIN * Add User impersonification for super-admin only * Remove useless ROLE_VOLUNTEER * wip * Fix PHP-CS Co-authored-by: Michel Roca <[email protected]>
- Loading branch information
1 parent
5d8632d
commit 64051aa
Showing
144 changed files
with
1,782 additions
and
1,348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"base_url":"","routes":{"app_user_availability_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","id",true],["text","\/user\/availability\/missions"]],"defaults":[],"requirements":{"id":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","id",true],["text","\/missions"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"id":"\\d+","organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_find_by_filters":{"tokens":[["text","\/missions\/find"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":[]} | ||
{"base_url":"","routes":{"app_user_availability_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","mission",true],["text","\/user\/availability\/missions"]],"defaults":[],"requirements":{"mission":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","mission",true],["text","\/missions"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"mission":"\\d+","organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_find_by_filters":{"tokens":[["text","\/missions\/find"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
framework: | ||
mailer: | ||
dsn: '%env(MAILER_DSN)%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
symfonycasts_reset_password: | ||
request_password_repository: App\Repository\ResetPasswordRequestRepository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,6 @@ services: | |
- NODE_ENV=dev | ||
volumes: | ||
- ./:/srv | ||
|
||
mailcatcher: | ||
image: tophfr/mailcatcher:0.6.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ Feature: | |
I must be able to list, edit and delete assets in my organization. | ||
|
||
Scenario: As an admin of an organization, I can list the assets from my organization | ||
Given I am authenticated as "admin203@resop.com" | ||
And I am on "/organizations/203" | ||
Given I am authenticated as "admin201@resop.com" | ||
And I am on "/organizations/201" | ||
When I follow "Afficher la liste de mes véhicules" | ||
Then I should be on "/organizations/203/assets" | ||
Then I should be on "/organizations/201/assets/" | ||
And the response status code should be 200 | ||
And I should see "75992" | ||
And I should see "75996" | ||
|
@@ -32,12 +32,12 @@ Feature: | |
|
||
Scenario: As an admin of an organization, I cannot list the assets from an organization I don't have access to | ||
Given I am authenticated as "[email protected]" | ||
When I go to "/organizations/202/assets" | ||
When I go to "/organizations/202/assets/" | ||
Then the response status code should be 403 | ||
|
||
Scenario: As an admin of a child organization, I cannot list the assets from the parent organization | ||
Given I am authenticated as "admin203@resop.com" | ||
When I go to "/organizations/201/assets" | ||
Given I am authenticated as "admin204@resop.com" | ||
When I go to "/organizations/202/assets/" | ||
Then the response status code should be 403 | ||
|
||
Scenario Outline: As an admin of an organization, I can add an asset on my organization or children organizations | ||
|
@@ -50,69 +50,44 @@ Feature: | |
And I press "Continuer" | ||
Then the response status code should be 200 | ||
And I should be on "<add_url>" | ||
When I fill in the following: | ||
| commissionable_asset[type] | VL | | ||
| commissionable_asset[name] | new vehicule | | ||
| commissionable_asset[hasMobileRadio] | 1 | | ||
| commissionable_asset[hasFirstAidKit] | 1 | | ||
| commissionable_asset[parkingLocation] | some parking location | | ||
| commissionable_asset[contact] | some contact | | ||
| commissionable_asset[seatingCapacity] | 5 | | ||
| commissionable_asset[licensePlate] | some license plate | | ||
| commissionable_asset[comments] | some comments | | ||
When I fill in "commissionable_asset[name]" with "new vehicule" | ||
And I press "Enregistrer" | ||
Then I should be on "<list_url>" | ||
And the response status code should be 200 | ||
And I should see "Véhicule créé" | ||
And I should see "VL - new vehicule" | ||
When I follow the last "Modifier" | ||
Then I should be on "/organizations/203/assets/1/edit" | ||
And the response status code should be 200 | ||
And the "commissionable_asset_type" field should contain "VL" | ||
And the "commissionable_asset_name" field should contain "new vehicule" | ||
And the "commissionable_asset_hasMobileRadio_0" checkbox is checked | ||
And the "commissionable_asset_hasFirstAidKit_0" checkbox is checked | ||
And the "commissionable_asset_parkingLocation" field should contain "some parking location" | ||
And the "commissionable_asset_contact" field should contain "some contact" | ||
And the "commissionable_asset_seatingCapacity" field should contain "5" | ||
And the "commissionable_asset_licensePlate" field should contain "some license plate" | ||
And the "commissionable_asset_comments" field should contain "some comments" | ||
And I should see "new vehicule" | ||
Examples: | ||
| login | list_url | preAdd_url | add_url | | ||
# todo: there is a bug when using parent organization: https://github.com/crf-devs/resop/issues/360 | ||
# todo: how to create a new asset on a children organization (but not on current one)? | ||
# | [email protected] | /organizations/201/assets?organization=203 | /organizations/201/assets/preAdd | /organizations/201/assets/add | | ||
| admin203@resop.com | /organizations/203/assets | /organizations/203/assets/preAdd | /organizations/203/assets/add | | ||
| login | list_url | preAdd_url | add_url | | ||
| admin201@resop.com | /organizations/201/assets/?organizationId=203 | /organizations/201/assets/preAdd?organizationId=203 | /organizations/201/assets/add?organizationId=203 | | ||
| admin204@resop.com | /organizations/204/assets/ | /organizations/204/assets/preAdd | /organizations/204/assets/add | | ||
|
||
@javascript | ||
Scenario: As an admin of an organization, I can display an asset modal | ||
Scenario: As an admin of an admin of an organization, I can display an asset modal | ||
Given I am authenticated as "[email protected]" | ||
When I go to "/organizations/201/assets" | ||
When I go to "/organizations/201/assets/" | ||
And I press "Afficher" | ||
And I wait for ".modal-show-asset-inner" to be visible | ||
Then I should see "Modifier" | ||
And I follow "Modifier" | ||
Then I should be on "/organizations/201/assets/75012/edit?organizationId=203" | ||
Then I should be on "/organizations/201/assets/75992/edit" | ||
|
||
Scenario Outline: As an admin of an organization, I can update an asset from my organization or children organizations | ||
Given I am authenticated as "<login>" | ||
When I go to "<edit_url>" | ||
Then I should be on "<edit_url>" | ||
And the response status code should be 200 | ||
And the "commissionable_asset_name" field should contain "75012" | ||
When I fill in the following: | ||
| commissionable_asset[name] | new name | | ||
And the "commissionable_asset_name" field should contain "<name>" | ||
When I fill in "commissionable_asset[name]" with "new name" | ||
And I press "Enregistrer" | ||
Then I should be on "<list_url>" | ||
And the response status code should be 200 | ||
And I should see "Véhicule \"VPSP - new name\" mis à jour avec succès" | ||
When I go to "<edit_url>" | ||
And the "commissionable_asset_name" field should contain "new name" | ||
Examples: | ||
| login | edit_url | list_url | | ||
# todo: there is a bug when using parent organization: https://github.com/crf-devs/resop/issues/360 | ||
# | [email protected] | /organizations/201/assets/75012/edit | /organizations/201/assets?organization=203 | | ||
| admin203@resop.com | /organizations/203/assets/75012/edit | /organizations/203/assets | | ||
| login | name | edit_url | list_url | | ||
| admin201@resop.com | 75012 | /organizations/201/assets/75012/edit | /organizations/201/assets/?organizationId=203 | | ||
| admin204@resop.com | 77102 | /organizations/204/assets/77102/edit | /organizations/204/assets/ | | ||
|
||
Scenario: As an admin of a parent organization, I cannot update an asset from an organization I don't have access to | ||
Given I am authenticated as "[email protected]" | ||
|
@@ -149,7 +124,7 @@ Feature: | |
|
||
Scenario: As an admin of a parent organization, I cannot delete an asset from another organization | ||
Given I am authenticated as "[email protected]" | ||
When I go to "/organizations/202/assets" | ||
When I go to "/organizations/202/assets/" | ||
Then the response status code should be 403 | ||
When I go to "/organizations/202/assets/77992/delete" | ||
Then the response status code should be 403 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,12 @@ Feature: | |
I must be able to search for available users and assets. | ||
|
||
Scenario: As an authenticated children organization, I cannot use the forecast search form | ||
Given I am authenticated as "UL 01-02" | ||
When I go to "/organizations/201/forecast/" | ||
Given I am authenticated as "[email protected]" | ||
When I go to "/organizations/202/forecast/" | ||
Then the response status code should be 403 | ||
|
||
Scenario: As an authenticated parent organization, I can access the forecast search form | ||
Given I am authenticated as "DT75" | ||
Given I am authenticated as "[email protected]" | ||
When I go to "/organizations/201" | ||
Then I should see "Projections" | ||
When I follow "Projections" | ||
|
@@ -20,7 +20,7 @@ Feature: | |
|
||
@javascript | ||
Scenario: As an authenticated parent organization, I can use the forecast search form | ||
Given I am authenticated as "DT75" | ||
Given I am authenticated as "[email protected]" | ||
And I am on "/organizations/201/forecast/" | ||
When I click on "#availableRange" | ||
Then I wait for ".daterangepicker" to be visible | ||
|
Oops, something went wrong.