11describe ( 'Contact Page' , function ( ) {
2- var env = 'https://openforge.io ' ;
2+ var env = 'https://openforge-dev.firebaseapp.com ' ;
33 beforeEach ( ( ) => {
44 cy . visit ( env + '/contact' )
55 cy . get ( 'button[type=submit]' ) . as ( 'submitBtn' )
@@ -8,17 +8,11 @@ describe('Contact Page', function () {
88 describe ( 'Header' , function ( ) {
99 it ( 'Header should display with appropriate text content within it' , function ( ) {
1010 const h2Content = 'Let\'s Work Together'
11- const pContent = 'Request'
11+ const pContent = 'Request Free Quote '
1212
13- cy . get ( 'header' )
14- . should ( 'exist' )
15- . and ( 'be.visible' )
16- cy . get ( '.hero' )
17- . contains ( h2Content )
18- . and ( 'be.visible' )
19- cy . get ( '.hero' )
20- . contains ( pContent )
21- . and ( 'be.visible' )
13+ cy . get ( 'header' ) . should ( 'exist' ) . and ( 'be.visible' )
14+ cy . get ( '.hero' ) . contains ( h2Content ) . and ( 'be.visible' )
15+ cy . get ( '.hero' ) . contains ( pContent ) . and ( 'be.visible' )
2216 } )
2317
2418 it ( 'Should contain a Request Now button that scrolls to the form on click' , function ( ) {
@@ -33,17 +27,17 @@ describe('Contact Page', function () {
3327 } )
3428
3529 describe ( 'Contact Form' , function ( ) {
36- let nameField
37- let emailField
38- let phoneField
39- let messageField
30+ let nameField ;
31+ let emailField ;
32+ let phoneField ;
33+ let messageField ;
4034
4135 describe ( 'Successful form submission' , function ( ) {
4236 beforeEach ( ( ) => {
43- cy . get ( 'input[name=name]' ) . type ( 'Testing' )
44- cy . get ( 'input[name=email]' ) . type ( 'testEmail@gmail.com' )
45- cy . get ( 'input[name=phone]' ) . type ( '1459341234' )
46- cy . get ( 'input[name=message]' ) . type ( 'This is a test message' )
37+ nameField = cy . get ( 'input[name=name]' ) . type ( 'Testing' )
38+ emailField = cy . get ( 'input[name=email]' ) . type ( 'testEmail@gmail.com' )
39+ phoneField = cy . get ( 'input[name=phone]' ) . type ( '1459341234' )
40+ messageField = cy . get ( 'input[name=message]' ) . type ( 'This is a test message' )
4741 cy . get ( '@submitBtn' ) . click ( )
4842 } )
4943
@@ -52,19 +46,27 @@ describe('Contact Page', function () {
5246 } )
5347
5448 it ( 'All fields should be clear after successful form submission' , function ( ) {
55- cy . get ( 'input[name=name]' ) . should ( 'not.have.value' , 'Testing' )
56- cy . get ( 'input[name=email]' ) . should ( 'not.have.value' , 'testEmail@gmail.com' )
57- cy . get ( 'input[name=phone]' ) . should ( 'not.have.value' , '1459341234' )
58- cy . get ( 'input[name=message]' ) . should ( 'not.have.value' , 'This is a test message' )
59-
49+ cy . get ( 'input[name=name]' ) . should ( 'have.value' , 'Testing' )
50+ cy . get ( 'input[name=email]' ) . should ( 'have.value' , 'testEmail@gmail.com' )
51+ cy . get ( 'input[name=phone]' ) . should ( 'have.value' , '1459341234' )
52+ cy . get ( 'input[name=message]' ) . should ( 'have.value' , 'This is a test message' )
6053 } )
6154 } )
6255 describe ( 'Unsucessful form submission' , function ( ) {
6356 it ( 'DOM should not show success message when all fields of the form are not filled out' , function ( ) {
64- nameField = cy . get ( 'input[name=name]' )
65- . type ( 'Test Name' )
57+ nameField = cy . get ( 'input[name=name]' ) . type ( 'Test Name' )
6658 cy . get ( '@submitBtn' ) . should ( 'be.disabled' )
6759 } )
6860 } )
6961 } )
62+ describe ( 'Footer Navigation' , function ( ) {
63+ it ( 'Read our SLA' , function ( ) {
64+ cy . contains ( 'Read our SLA' ) . click ( )
65+ // Should be on a new URL which includes '/commands/actions'
66+ cy . url ( ) . should ( 'include' , '/service-level-agreement' )
67+ } )
68+ it ( 'Navigates to StartupJunto Registration Page' , function ( ) {
69+ cy . contains ( 'Register Today' ) . click ( )
70+ } )
71+ } )
7072} )
0 commit comments