Skip to content

Commit fe374e4

Browse files
authored
behat: activate js tests (#391)
1 parent 6ba123d commit fe374e4

File tree

7 files changed

+94
-93
lines changed

7 files changed

+94
-93
lines changed

behat.yml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ default:
1111
- App\Tests\Behat\UserPlanningContext
1212
- Behat\MinkExtension\Context\MinkContext
1313
- PantherExtension\Context\PantherContext
14+
- PantherExtension\Context\WaitContext:
1415
extensions:
1516
PantherExtension\Extension\PantherExtension: ~
1617
Behat\MinkExtension:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"friends-of-behat/mink-extension": "^2.4",
4444
"friends-of-behat/symfony-extension": "^2.1",
4545
"friendsofphp/php-cs-fixer": "^2.16",
46-
"guikingone/panther-extension": "^0.3.1",
46+
"guikingone/panther-extension": "^0.4.0",
4747
"hautelook/alice-bundle": "^2.7",
4848
"mheap/phpunit-github-actions-printer": "^1.2",
4949
"phpstan/phpstan-doctrine": "^0.12.8",

composer.lock

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

features/organization/assets.feature

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Feature:
4040
When I go to "/organizations/202/assets"
4141
Then the response status code should be 403
4242

43-
# todo: add some properties in asset_type fixtures
4443
Scenario Outline: As an authenticated parent organization, I can add an asset on my organization or children organizations
4544
Given I am authenticated as "<login>"
4645
When I go to "/organizations/203/assets"
@@ -84,7 +83,7 @@ Feature:
8483
And the "commissionable_asset_name" field should contain "new name"
8584
Examples:
8685
| login |
87-
# todo: there is a bug when using parent organization
86+
# todo: there is a bug when using parent organization: https://github.com/crf-devs/resop/issues/360
8887
# | DT75 |
8988
| UL 01-02 |
9089

@@ -110,19 +109,19 @@ Feature:
110109
And I press "Je me connecte"
111110
Then I should be on "/organizations/"
112111

113-
# @javascript
114-
# Scenario: As a parent organization, I can delete an asset from my organization or children organizations
115-
# Given I am authenticated as "DT75"
116-
# And I go to "/organizations/203/assets"
117-
# Then I should be on "/organizations/203/assets/"
118-
# And I should see "75012"
119-
# When I follow "Supprimer"
120-
# And I wait for the element "#modal-delete-asset" to load
121-
# Then I should see "Vous êtes sur le point de supprimer le véhicule VPSP - 75012"
122-
# When I press "Supprimer"
123-
# Then I should be on "/organizations/203/assets/"
124-
# And I should see "Le véhicule a été supprimé avec succès."
125-
# And I should not see "75012"
112+
@javascript
113+
Scenario: As a parent organization, I can delete an asset from my organization or children organizations
114+
Given I am authenticated as "DT75"
115+
And I go to "/organizations/203/assets"
116+
Then I should be on "/organizations/203/assets/"
117+
And I should see "75012"
118+
When I follow "Supprimer"
119+
And I wait for "#delete-item-modal" to be visible
120+
Then I should see "Vous êtes sur le point de supprimer le véhicule suivant et toutes ses disponibilités : VPSP - 75012"
121+
When I press "Supprimer"
122+
Then I should be on "/organizations/203/assets/"
123+
And I should see "Le véhicule a été supprimé avec succès."
124+
And I should not see "75012"
126125

127126
#https://github.com/crf-devs/resop/issues/348
128127
# Scenario: As a parent organization, I cannot directly delete an asset from my organization

features/organization/forecast.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Feature:
2727
Given I am authenticated as "DT75"
2828
And I am on "/organizations/forecast"
2929
When I click on "#availableRange"
30-
Then the ".daterangepicker" should be visible
30+
Then I wait for ".daterangepicker" to be visible
3131
When I click on ".daterangepicker .left table tbody td[data-title=r1c0]"
3232
And I click on ".daterangepicker .left table tbody td[data-title=r1c6]"
3333
And I press "Valider"
34-
Then the ".daterangepicker" should not be visible
34+
Then I wait for ".daterangepicker" to be invisible
3535
When I press "Calculer"
3636
Then I should be on "/organizations/forecast"
3737
And I should not see "Choisissez une plage horaire pour calculer les équipages possibles."

features/organization/mission_type.feature

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ Feature:
1919
And I should not see "Mission type DT77 1"
2020
And I should not see "Mission type DT77 2"
2121

22-
# @javascript
23-
# Scenario: As an organization, I can create a mission type
24-
# Given I am authenticated as "DT75"
25-
# And I am on "/organizations/mission_type/"
26-
# When I follow "Ajouter un nouveau type de mission"
27-
# Then I should be on "/organizations/mission_type/new"
28-
# When I press "Ajouter un type de bénévole"
29-
# And I press "Ajouter un type de véhicule"
30-
# And I fill in the following:
31-
# | mission_type[name] | mission type name |
32-
# | mission_type[minimumAvailableHours] | 2 |
33-
# | mission_type[userSkillsRequirement][0][skill] | ci_bspp |
34-
# | mission_type[userSkillsRequirement][0][number] | 3 |
35-
# | mission_type[assetTypesRequirement][0][type] | VPSP |
36-
# | mission_type[assetTypesRequirement][0][number] | 4 |
37-
# And I press "Enregistrer"
38-
# Then I should be on "/organizations/mission_type/"
39-
# And I should see "mission type name"
40-
# When I follow the last "Modifier"
41-
# Then the "mission_type_name" field should contain "mission type name"
42-
# And the "mission_type_minimumAvailableHours" field should contain "2"
43-
# And the "mission_type_userSkillsRequirement_0_skill" field should contain "ci_bspp"
44-
# And the "mission_type_userSkillsRequirement_0_number" field should contain "3"
45-
# And the "mission_type_assetTypesRequirement_0_type" field should contain "302"
46-
# And the "mission_type_assetTypesRequirement_0_number" field should contain "4"
22+
@javascript
23+
Scenario: As an organization, I can create a mission type
24+
Given I am authenticated as "DT75"
25+
And I am on "/organizations/mission_type/"
26+
When I follow "Ajouter un nouveau type de mission"
27+
Then I should be on "/organizations/mission_type/new"
28+
When I press "Ajouter un type de bénévole"
29+
And I press "Ajouter un type de véhicule"
30+
And I fill in the following:
31+
| mission_type[name] | mission type name |
32+
| mission_type[minimumAvailableHours] | 2 |
33+
| mission_type[userSkillsRequirement][0][skill] | ci_bspp |
34+
| mission_type[userSkillsRequirement][0][number] | 3 |
35+
| mission_type[assetTypesRequirement][0][type] | VPSP |
36+
| mission_type[assetTypesRequirement][0][number] | 4 |
37+
And I press "Enregistrer"
38+
Then I should be on "/organizations/mission_type/"
39+
And I should see "mission type name"
40+
When I follow the last "Modifier"
41+
Then the "mission_type_name" field should contain "mission type name"
42+
And the "mission_type_minimumAvailableHours" field should contain "2"
43+
And the "mission_type_userSkillsRequirement_0_skill" field should contain "ci_bspp"
44+
And the "mission_type_userSkillsRequirement_0_number" field should contain "3"
45+
And the "mission_type_assetTypesRequirement_0_type" field should contain "302"
46+
And the "mission_type_assetTypesRequirement_0_number" field should contain "4"
4747

4848
@javascript
4949
Scenario: As an organization, I cannot create a mission type with duplicate requirements
@@ -71,39 +71,38 @@ Feature:
7171
And I should see "Au moins une compétence de bénévole est dupliquée"
7272
And I should see "Au moins un type de véhicule est dupliqué"
7373

74-
# # todo: this form has a buggy behavior: https://github.com/crf-devs/resop/issues/361
75-
# @javascript
76-
# Scenario: As an organization, I can edit a mission type
77-
# Given I am authenticated as "DT75"
78-
# And I am on "/organizations/mission_type/"
79-
# When I follow "Modifier"
80-
# Then I should be on "/organizations/mission_type/751/edit"
81-
# When I fill in the following:
82-
# | mission_type[name] | mission type name |
83-
# | mission_type[userSkillsRequirement][0][skill] | ci_bspp |
84-
# And I press "delete_mission_type_userSkillsRequirement_1"
85-
# And I press "Enregistrer"
86-
# Then I should be on "/organizations/mission_type/"
87-
# And I should see "mission type name"
88-
# When I follow "Modifier"
89-
# And I should see "CI Réseau BSPP"
74+
@javascript
75+
Scenario: As an organization, I can edit a mission type
76+
Given I am authenticated as "DT75"
77+
And I am on "/organizations/mission_type/"
78+
When I follow "Modifier"
79+
Then I should be on "/organizations/mission_type/751/edit"
80+
When I fill in the following:
81+
| mission_type[name] | mission type name |
82+
| mission_type[userSkillsRequirement][0][skill] | ci_bspp |
83+
And I press "delete_mission_type_userSkillsRequirement_1"
84+
And I press "Enregistrer"
85+
Then I should be on "/organizations/mission_type/"
86+
And I should see "mission type name"
87+
When I follow "Modifier"
88+
And I should see "CI Réseau BSPP"
9089

9190
Scenario: As an organization, I cannot edit a mission type of another organization
9291
Given I am authenticated as "DT75"
9392
And I am on "/organizations/mission_type/771/edit"
9493
Then the response status code should be 403
9594

96-
# @javascript
97-
# Scenario: As an organization, I can delete a mission type
98-
# Given I am authenticated as "DT75"
99-
# And I am on "/organizations/mission_type/"
100-
# When I press "Supprimer"
101-
# Then I should see "Vous êtes sur le point de supprimer le type de mission : Mission type DT75 1"
102-
# When I press "Supprimer"
103-
# Then the response status code should be 200
104-
# And I should be on "/organizations/mission_type/"
105-
# And I should not see "Le type de mission a été supprimé avec succès "
106-
# And I should not see "Mission type DT75 1"
95+
@javascript
96+
Scenario: As an organization, I can delete a mission type
97+
Given I am authenticated as "DT75"
98+
And I am on "/organizations/mission_type/"
99+
When I follow "Supprimer"
100+
And I wait for "#delete-item-modal" to be visible
101+
Then I should see "Vous êtes sur le point de supprimer l'élément : Mission type DT75 1."
102+
When I press "Supprimer"
103+
Then I should be on "/organizations/mission_type/"
104+
And I should see "Le type de mission a été supprimé avec succès "
105+
And I should not see "Mission type DT75 1"
107106

108107
Scenario: As an organization, I cannot delete a mission type of another organization
109108
Given I am authenticated as "DT75"

features/organization/users.feature

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,22 @@ Feature:
7373
Given I am authenticated as "DT75"
7474
When I go to "/organizations/204/users/103/edit"
7575
Then the response status code should be 403
76-
#
77-
# @javascript
78-
# Scenario Outline: As an admin of an organization, I can delete a user from my organization or children organizations
79-
# Given I am authenticated as "<login>"
80-
# When I go to "/organizations/3/users"
81-
# And I press "Supprimer"
82-
# Then I should see "Vous êtes sur le point de supprimer le bénévole : Jill DOE ( 990003A ) et toutes ses disponibilités."
83-
# When I press "Supprimer"
84-
# Then I should be on "/organizations/3/users"
85-
# And the response status code should be 200
86-
# And I should see "Le bénévole a été supprimé avec succès."
87-
# And I should not see "jill.doe@resop.com"
88-
# Examples:
89-
# | login |
90-
# | john.doe@resop.com |
91-
# | jane.doe@resop.com |
76+
77+
@javascript
78+
Scenario Outline: As an organization, I can delete a user from my organization or children organizations
79+
Given I am authenticated as "<login>"
80+
When I go to "/organizations/203/users"
81+
And I follow "Supprimer"
82+
And I wait for "#delete-item-modal" to be visible
83+
Then I should see "Vous êtes sur le point de supprimer le bénévole suivant et toutes ses disponibilités : Jane DOE ( 990002A )."
84+
When I press "Supprimer"
85+
Then I should be on "/organizations/203/users/"
86+
And I should see "Le bénévole a été supprimé avec succès."
87+
And I should not see "jill.doe@resop.com"
88+
Examples:
89+
| login |
90+
| DT75 |
91+
| UL 01-02 |
9292
#
9393
# Scenario: As an admin of an organization, I cannot directly delete a user from my organization
9494
# Given I am authenticated as "john.doe@resop.com"

0 commit comments

Comments
 (0)