@@ -7,68 +7,88 @@ describe("sign-in from standard client", () => {
7
7
8
8
it ( "should sign-in without org selection when having only one organization" , function ( ) {
9
9
cy . visit ( "http://localhost:4000" ) ;
10
- cy . get ( "button.proconnect-button ") . click ( ) ;
10
+ cy . contains ( "S’identifier avec ProConnect ") . click ( ) ;
11
11
12
+ cy . title ( ) . should ( "include" , "S'inscrire ou se connecter - " ) ;
12
13
cy . login ( "unused1@yopmail.com" ) ;
13
14
15
+ cy . title ( ) . should ( "equal" , "standard-client - ProConnect" ) ;
14
16
cy . contains ( "standard-client" ) ;
15
- cy . contains ( " unused1@yopmail.com") ;
16
- cy . contains ( " Commune de lamalou-les-bains - Mairie") ;
17
+ cy . contains ( '"email": " unused1@yopmail.com"' ) ;
18
+ cy . contains ( '"label": " Commune de lamalou-les-bains - Mairie"' ) ;
17
19
18
20
// then it should prompt for organization
19
- cy . get ( "button#select-organization" ) . click ( ) ;
21
+ cy . contains ( "button" , "Changer d’organisation" ) . click ( ) ;
22
+
23
+ cy . title ( ) . should ( "include" , "Choisir une organisation - " ) ;
20
24
cy . contains ( "Votre organisation de rattachement" ) ;
21
- cy . get ( ".fr-grid-row .fr-col-12:first-child .fr-tile__link" ) . click ( ) ;
25
+ cy . getByLabel (
26
+ "Commune de lamalou-les-bains - Mairie (choisir cette organisation)" ,
27
+ ) . click ( ) ;
28
+
29
+ cy . title ( ) . should ( "equal" , "standard-client - ProConnect" ) ;
22
30
cy . contains ( "standard-client" ) ;
23
- cy . contains ( " Commune de lamalou-les-bains - Mairie") ;
31
+ cy . contains ( '"label": " Commune de lamalou-les-bains - Mairie"' ) ;
24
32
25
33
// then it should update userinfo
26
- cy . contains ( "Jean Un" ) ;
27
- cy . get ( "button#update-userinfo" ) . click ( ) ;
34
+ cy . contains ( '"family_name": "Jean Un"' ) ;
35
+ cy . contains ( "button" , "Mettre à jour mes informations" ) . click ( ) ;
36
+
37
+ cy . title ( ) . should ( "include" , "Renseigner votre identité - " ) ;
28
38
cy . contains ( "Renseigner son identité" ) ;
29
- cy . get ( '[name="family_name"]' ) . type ( "Moustaki" ) ;
30
- cy . get ( '[type="submit"]' ) . click ( ) ;
39
+ cy . contains ( "Nom" ) . click ( ) ;
40
+ cy . focused ( ) . clear ( ) . type ( "Moustaki" ) ;
41
+ cy . contains ( "Valider" ) . click ( ) ;
42
+
43
+ cy . title ( ) . should ( "equal" , "standard-client - ProConnect" ) ;
31
44
cy . contains ( "standard-client" ) ;
32
- cy . contains ( " Moustaki") ;
45
+ cy . contains ( '"family_name": " Moustaki"' ) ;
33
46
} ) ;
34
47
35
48
it ( "should sign-in with org selection when having two organization" , function ( ) {
36
49
cy . visit ( "http://localhost:4000" ) ;
37
- cy . get ( "button.proconnect-button ") . click ( ) ;
50
+ cy . contains ( "S’identifier avec ProConnect ") . click ( ) ;
38
51
52
+ cy . title ( ) . should ( "include" , "S'inscrire ou se connecter - " ) ;
39
53
cy . login ( "unused2@yopmail.com" ) ;
40
54
41
- cy . get ( ".fr-grid-row .fr-col-12:first-child .fr-tile__link" ) . contains (
42
- "Commune de lamalou-les-bains - Mairie" ,
43
- ) ;
44
- cy . get ( ".fr-grid-row .fr-col-12:last-child .fr-tile__link" ) . contains (
45
- "Commune de clamart - Mairie" ,
55
+ cy . title ( ) . should ( "include" , "Choisir une organisation - " ) ;
56
+ cy . getByLabel (
57
+ "Commune de lamalou-les-bains - Mairie (choisir cette organisation)" ,
46
58
) ;
47
59
48
- cy . get ( ".fr-grid-row .fr-col-12:last-child .fr-tile__link" ) . click ( ) ;
60
+ cy . getByLabel (
61
+ "Commune de clamart - Mairie (choisir cette organisation)" ,
62
+ ) . click ( ) ;
49
63
64
+ cy . title ( ) . should ( "equal" , "standard-client - ProConnect" ) ;
50
65
cy . contains ( "standard-client" ) ;
51
- cy . contains ( " unused2@yopmail.com") ;
52
- cy . contains ( " Commune de clamart - Mairie") ;
66
+ cy . contains ( '"email": " unused2@yopmail.com"' ) ;
67
+ cy . contains ( '"label": " Commune de clamart - Mairie"' ) ;
53
68
54
69
// then it should prompt for organization
55
- cy . get ( "button#select-organization" ) . click ( ) ;
70
+ cy . contains ( "button" , "Changer d’organisation" ) . click ( ) ;
71
+ cy . title ( ) . should ( "include" , "Choisir une organisation - " ) ;
56
72
cy . contains ( "Votre organisation de rattachement" ) ;
57
- cy . get ( ".fr-grid-row .fr-col-12:first-child .fr-tile__link" ) . click ( ) ;
73
+ cy . getByLabel (
74
+ "Commune de lamalou-les-bains - Mairie (choisir cette organisation)" ,
75
+ ) . click ( ) ;
58
76
77
+ cy . title ( ) . should ( "equal" , "standard-client - ProConnect" ) ;
59
78
cy . contains ( "standard-client" ) ;
60
- cy . contains ( "Commune de lamalou-les-bains - Mairie" ) ;
79
+ cy . contains ( '"email": "unused2@yopmail.com"' ) ;
80
+ cy . contains ( '"label": "Commune de lamalou-les-bains - Mairie"' ) ;
61
81
} ) ;
62
82
63
83
it ( "should not prompt for password if a session is already opened" , ( ) => {
64
84
cy . visit ( "/" ) ;
85
+ cy . title ( ) . should ( "include" , "S'inscrire ou se connecter - " ) ;
65
86
cy . login ( "unused1@yopmail.com" ) ;
66
87
67
88
cy . visit ( "http://localhost:4000" ) ;
68
- cy . get ( "button.proconnect-button" ) . click ( ) ;
69
-
89
+ cy . contains ( "S’identifier avec ProConnect" ) . click ( ) ;
70
90
cy . contains ( "standard-client" ) ;
71
- cy . contains ( " unused1@yopmail.com") ;
91
+ cy . contains ( '"email": " unused1@yopmail.com"' ) ;
72
92
} ) ;
73
93
74
94
it ( "should bypass consent prompt" , ( ) => {
@@ -79,6 +99,7 @@ describe("sign-in from standard client", () => {
79
99
} ) ) ;
80
100
cy . get ( "button#custom-connection" ) . click ( { force : true } ) ;
81
101
102
+ cy . title ( ) . should ( "include" , "S'inscrire ou se connecter - " ) ;
82
103
cy . login ( "unused1@yopmail.com" ) ;
83
104
cy . contains ( "standard-client" ) ;
84
105
} ) ;
@@ -96,6 +117,7 @@ describe("sign-in from standard client", () => {
96
117
} ) ) ;
97
118
cy . get ( "button#custom-connection" ) . click ( { force : true } ) ;
98
119
120
+ cy . title ( ) . should ( "include" , "S'inscrire ou se connecter - " ) ;
99
121
cy . login ( "unused1@yopmail.com" ) ;
100
122
cy . contains ( "standard-client" ) ;
101
123
} ) ;
0 commit comments