1
1
/// <reference types="cypress-mailslurp" />
2
2
3
3
describe ( "user sign up test with mailslurp plugin" , function ( ) {
4
+ //<gen>cypress_plugin_before
4
5
// use cypress-mailslurp plugin to create an email address before test
5
6
before ( function ( ) {
6
7
cy . log ( "Wrap inbox before test" )
@@ -13,13 +14,17 @@ describe("user sign up test with mailslurp plugin", function () {
13
14
cy . wrap ( inbox . emailAddress ) . as ( 'emailAddress' )
14
15
} )
15
16
} ) ;
17
+ //</gen>
18
+ //<gen>cypress_plugin_01
16
19
it ( "01 - can load the demo application" , function ( ) {
17
20
// get wrapped email address and assert contains a mailslurp email address
18
21
expect ( this . emailAddress ) . to . contain ( "@mailslurp" ) ;
19
22
// visit the demo application
20
23
cy . visit ( "https://playground.mailslurp.com" )
21
24
cy . title ( ) . should ( 'contain' , 'React App' ) ;
22
25
} ) ;
26
+ //</gen>
27
+ //<gen>cypress_plugin_02
23
28
// use function instead of arrow syntax to access aliased values on this
24
29
it ( "02 - can sign up using email address" , function ( ) {
25
30
// click sign up and fill out the form
@@ -30,6 +35,8 @@ describe("user sign up test with mailslurp plugin", function () {
30
35
// click the submit button
31
36
cy . get ( "[data-test=sign-up-create-account-button]" ) . click ( ) ;
32
37
} ) ;
38
+ //</gen>
39
+ //<gen>cypress_plugin_03
33
40
it ( "03 - can receive confirmation code by email" , function ( ) {
34
41
// app will send user an email containing a code, use mailslurp to wait for the latest email
35
42
cy . mailslurp ( )
@@ -43,6 +50,8 @@ describe("user sign up test with mailslurp plugin", function () {
43
50
cy . get ( "[data-test=confirm-sign-up-confirm-button]" ) . click ( ) ;
44
51
} )
45
52
} ) ;
53
+ //</gen>
54
+ //<gen>cypress_plugin_04
46
55
// fill out sign in form
47
56
it ( "04 - can sign in with confirmed account" , function ( ) {
48
57
// use the email address and a test password
@@ -51,9 +60,12 @@ describe("user sign up test with mailslurp plugin", function () {
51
60
// click the submit button
52
61
cy . get ( "[data-test=sign-in-sign-in-button]" ) . click ( ) ;
53
62
} ) ;
63
+ //</gen>
64
+ //<gen>cypress_plugin_05
54
65
// can see authorized welcome screen
55
66
it ( "05 - can see welcome screen" , function ( ) {
56
67
// click sign up and fill out the form
57
68
cy . get ( "h1" ) . should ( "contain" , "Welcome" ) ;
58
69
} ) ;
70
+ //</gen>
59
71
} ) ;
0 commit comments