File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
cypress/e2e/signup_with_prefilled_siret Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+
3
+ describe ( "sign-up with prefilled siret" , ( ) => {
4
+ it ( "should seed the database once" , function ( ) {
5
+ cy . seed ( ) ;
6
+ } ) ;
7
+
8
+ it ( "should sign-up with magic link and have a siret that is prefilled with 11009001600053" , function ( ) {
9
+ // Visit the signup page
10
+ cy . visit ( "/users/start-sign-in" ) ;
11
+
12
+ cy . get ( '[name="login"]' ) . type ( "user@intradef.gouv.fr" ) ;
13
+ cy . get ( '[type="submit"]' ) . click ( ) ;
14
+
15
+ cy . get ( '[name="password"]' ) . type (
16
+ "This super secret password is hidden well!" ,
17
+ ) ;
18
+ cy . get ( '[action="/users/sign-up"] [type="submit"]' ) . click ( ) ;
19
+
20
+ // Check that the website is waiting for the user to verify their email
21
+ cy . get ( "#verify-email > div > p" ) . contains ( "user@intradef.gouv.fr" ) ;
22
+
23
+ cy . verifyEmail ( ) ;
24
+
25
+ // Fill the user's personal information
26
+ cy . get ( '[name="given_name"]' ) . type ( "Loïs" ) ;
27
+ cy . get ( '[name="family_name"]' ) . type ( "Lane" ) ;
28
+ cy . get ( '[type="submit"]' ) . click ( ) ;
29
+
30
+ // The siret should be prefilled
31
+ cy . get ( '[name="siret"]' ) . should ( "have.value" , "11009001600053" ) ;
32
+ } ) ;
33
+ } ) ;
You can’t perform that action at this time.
0 commit comments