|
1 | 1 | describe('Contact Page', function () {
|
| 2 | + var env = 'http://localhost:3333'; |
2 | 3 | beforeEach(() => {
|
3 |
| - cy.visit('localhost:3333/contact') |
| 4 | + cy.visit(env + '/contact') |
4 | 5 | cy.get('button[type=submit]').as('submitBtn')
|
5 | 6 | })
|
6 | 7 |
|
7 |
| - describe('Header', function() { |
8 |
| - it('Header should display with appropriate text content within it', function() { |
9 |
| - const h2Content = 'Let\'s Work Together' |
10 |
| - const pContent = 'Request' |
| 8 | + describe('Nav Bar Navigation (Desktop)', function () { |
| 9 | + // TODO -> Test suite for the blog link in nav bar. |
| 10 | + it('Home on nav bar should redirect to home page', function () { |
| 11 | + cy.get('.navbar').contains('Home').click() |
| 12 | + cy.url().should('include', '/') |
| 13 | + }) |
| 14 | + describe('Services', function () { |
| 15 | + beforeEach(() => { |
| 16 | + // Gets Services text |
| 17 | + cy.get('.container > #navbarSupportedContent').contains('Services'); |
| 18 | + // Clicks services dropdown arrow |
| 19 | + cy.get('.container > #navbarSupportedContent > .navbar-nav > .nav-item > #navbarDropdown').click(); |
| 20 | + }) |
| 21 | + it('Services should drop down to display Development and navigate to developer page', function () { |
| 22 | + cy.get('.navbar-nav > .nav-item:nth-child(2) > .dropdown-menu > .hydrated:nth-child(1) > .nav-link').contains('Development').click() |
| 23 | + cy.url().should('include', '/app-developer') |
| 24 | + }) |
| 25 | + it('Services should drop down to display Design and navigate to design page', function () { |
| 26 | + cy.get('.navbar-nav > .nav-item:nth-child(2) > .dropdown-menu > .hydrated:nth-child(2) > .nav-link').contains('Design').click(); |
| 27 | + cy.url().should('include', '/app-designer'); |
| 28 | + }) |
| 29 | + it('Services should drop down to display Consulting and navigate to consulting page', function () { |
| 30 | + cy.get('.navbar-nav > .nav-item:nth-child(2) > .dropdown-menu > .hydrated:nth-child(3) > .nav-link').contains('Consulting').click() |
| 31 | + cy.url().should('include', '/startup-consulting') |
| 32 | + }); |
| 33 | + }); |
11 | 34 |
|
12 |
| - cy.get('header') |
13 |
| - .should('exist') |
14 |
| - .and('be.visible') |
15 |
| - cy.get('.hero') |
16 |
| - .contains(h2Content) |
17 |
| - .and('be.visible') |
18 |
| - cy.get('.hero') |
19 |
| - .contains(pContent) |
20 |
| - .and('be.visible') |
| 35 | + describe('About', function () { |
| 36 | + it('About should drop down to display Meet the team and navigate to about page', function () { |
| 37 | + cy.get('.navbar').contains('About').click() |
| 38 | + cy.get('.navbar').contains('Meet the team').click() |
| 39 | + cy.url().should('include', '/about') |
| 40 | + cy.contains('We Are Passionate About Technology and Design') |
| 41 | + }) |
| 42 | + it('About should drop down to display Juntoscope Case Study and navigate to juntoscope page', function () { |
| 43 | + cy.get('.navbar').contains('About').click() |
| 44 | + cy.get('.navbar').contains('Juntoscope Case Study').click() |
| 45 | + cy.url().should('include', '/juntoscope') |
| 46 | + cy.contains('Case Study') |
| 47 | + }) |
| 48 | + it('About should drop down to display Toolbox and navigate to Toolbox page', function () { |
| 49 | + cy.get('.navbar').contains('About').click() |
| 50 | + cy.get('.navbar').contains('Toolbox').click() |
| 51 | + cy.url().should('include', '/toolbox') |
| 52 | + cy.contains('Here are some of the tools we use') |
| 53 | + }) |
| 54 | + it('About should drop down to display PWA White Paper and navigate to PWA White Paper page', function () { |
| 55 | + cy.get('.navbar').contains('About').click() |
| 56 | + cy.get('.navbar').contains('PWA White Paper').click() |
| 57 | + cy.url().should('include', '/resources/pwa-white-paper') |
| 58 | + cy.contains('What is a PWA and is it right for you?') |
| 59 | + }) |
| 60 | + }); |
| 61 | + }) |
| 62 | + |
| 63 | + describe('Nav Bar Navigation (Mobile)', function () { |
| 64 | + beforeEach(() => { |
| 65 | + cy.viewport(960, 600) // Sets view to large to enable nav menu |
| 66 | + cy.get('.navbar-toggler').click() // expands nav menu before each test |
| 67 | + }) |
| 68 | + it('Nav menu should collapse', function () { |
| 69 | + cy.wait(2000) |
| 70 | + cy.get('.navbar-toggler').click() |
| 71 | + }) |
| 72 | + it('Home on nav Bar should redirect to home page', function () { |
| 73 | + cy.get('.navbar').contains('Home').click() |
| 74 | + cy.url().should('include', '/') |
| 75 | + }) |
| 76 | + |
| 77 | + describe('Services', function () { |
| 78 | + beforeEach(() => { |
| 79 | + cy.get('.container > #navbarSupportedContent').contains('Services'); |
| 80 | + cy.get('.container > #navbarSupportedContent > .navbar-nav > .nav-item > #navbarDropdown').click(); |
| 81 | + }) |
| 82 | + it('Services should drop down to display Development and navigate to developer page', function () { |
| 83 | + cy.get('.navbar-nav > .nav-item:nth-child(2) > .dropdown-menu > .hydrated:nth-child(1) > .nav-link').contains('Development').click() |
| 84 | + cy.url().should('include', '/app-developer') |
| 85 | + }) |
| 86 | + it('Services should drop down to display Design and navigate to design page', function () { |
| 87 | + cy.get('.navbar-nav > .nav-item:nth-child(2) > .dropdown-menu > .hydrated:nth-child(2) > .nav-link').contains('Design').click() |
| 88 | + cy.url().should('include', '/app-designer') |
| 89 | + }) |
| 90 | + it('Services should drop down to display Consulting and navigate to consulting page', function () { |
| 91 | + cy.get('.navbar-nav > .nav-item:nth-child(2) > .dropdown-menu > .hydrated:nth-child(3) > .nav-link').contains('Consulting').click(); |
| 92 | + cy.url().should('include', '/startup-consulting'); |
| 93 | + }) |
| 94 | + }); |
| 95 | + |
| 96 | + describe('About', function () { |
| 97 | + it('About should drop down to display Meet the team and navigate to about page', function () { |
| 98 | + cy.get('.navbar').contains('About').click() |
| 99 | + cy.get('.navbar').contains('Meet the team').click() |
| 100 | + cy.url().should('include', '/about') |
| 101 | + cy.contains('We Are Passionate About Technology and Design') |
| 102 | + }) |
| 103 | + it('About should drop down to display Juntoscope Case Study and navigate to juntoscope page', function () { |
| 104 | + cy.get('.navbar').contains('About').click() |
| 105 | + cy.get('.navbar').contains('Juntoscope Case Study').click() |
| 106 | + cy.url().should('include', '/juntoscope') |
| 107 | + cy.contains('Case Study') |
| 108 | + }) |
| 109 | + it('About should drop down to display Toolbox and navigate to Toolbox page', function () { |
| 110 | + cy.get('.navbar').contains('About').click() |
| 111 | + cy.get('.navbar').contains('Toolbox').click() |
| 112 | + cy.url().should('include', '/toolbox') |
| 113 | + cy.contains('Here are some of the tools we use') |
| 114 | + }) |
| 115 | + it('About should drop down to display PWA White Paper and navigate to PWA White Paper page', function () { |
| 116 | + cy.get('.navbar').contains('About').click() |
| 117 | + cy.get('.navbar').contains('PWA White Paper').click() |
| 118 | + cy.url().should('include', '/resources/pwa-white-paper') |
| 119 | + cy.contains('What is a PWA and is it right for you?') |
| 120 | + }) |
| 121 | + }); |
| 122 | + }); |
| 123 | + |
| 124 | + describe('Header', function () { |
| 125 | + it('Header should display with appropriate text content within it', function () { |
| 126 | + const h2Content = 'Let\'s Work Together' |
| 127 | + const pContent = 'Request Free Quote' |
| 128 | + |
| 129 | + cy.get('header').should('exist').and('be.visible') |
| 130 | + cy.get('.hero').contains(h2Content).and('be.visible') |
| 131 | + cy.get('.hero').contains(pContent).and('be.visible') |
21 | 132 | })
|
22 | 133 |
|
23 |
| - it('Should contain a Request Now button that scrolls to the form on click', function() { |
| 134 | + it('Should contain a Request Now button that scrolls to the form on click', function () { |
24 | 135 | cy.get('header')
|
25 | 136 | .find('.btn')
|
26 | 137 | .should('exist')
|
27 | 138 | .and('be.visible')
|
28 |
| - .and('contain', 'Request Now') |
| 139 | + .and('contain', 'Request Free Quote') |
29 | 140 | .click()
|
30 | 141 | cy.get('#second-content').click()
|
31 | 142 | })
|
32 | 143 | })
|
33 | 144 |
|
34 |
| - describe('Contact Form', function() { |
| 145 | + describe('Contact Form', function () { |
35 | 146 | let nameField;
|
36 | 147 | let emailField;
|
37 |
| - let companyField; |
38 | 148 | let phoneField;
|
39 | 149 | let messageField;
|
40 |
| - let radioField1; |
41 |
| - let radioField2; |
42 | 150 |
|
43 | 151 | describe('Successful form submission', function () {
|
44 | 152 | beforeEach(() => {
|
45 |
| - nameField = cy.get('input[name=name]') |
46 |
| - .type('Test Name') |
47 |
| - emailField = cy.get('input[name=email]') |
48 |
| - .type('testEmail@gmail.com') |
49 |
| - companyField = cy.get('input[name=company]') |
50 |
| - .type('Test Company Name') |
51 |
| - phoneField = cy.get('input[name=phone]') |
52 |
| - .type('1459341234') |
53 |
| - messageField = cy.get('input[name=message]') |
54 |
| - .type('This is a test message') |
55 |
| - radioField1 = cy.get('[type="radio"]') |
56 |
| - .check('Web Development') |
57 |
| - radioField2 = cy.get('[type="radio"]') |
58 |
| - .check('200K') |
| 153 | + nameField = cy.get('input[name=name]').type('Testing') |
| 154 | + emailField = cy.get('input[name=email]').type('testEmail@gmail.com') |
| 155 | + phoneField = cy.get('input[name=phone]').type('1459341234') |
| 156 | + messageField = cy.get('input[name=message]').type('This is a test message') |
59 | 157 | cy.get('@submitBtn').click()
|
60 | 158 | })
|
61 | 159 |
|
62 |
| - it('Should show a success message on submit when all form values have been filled out', function() { |
63 |
| - cy.get('div.alert') |
64 |
| - .should('exist') |
65 |
| - .contains('Thank you') |
| 160 | + it('Should show a success message on submit when all form values have been filled out', function () { |
| 161 | + cy.wait(2000) |
| 162 | + cy.contains('Thank you') |
66 | 163 | })
|
67 | 164 |
|
68 |
| - it('All fields should be clear after successful form submission', function() { |
69 |
| - nameField.should('have.value', '') |
70 |
| - emailField.should('have.value', '') |
71 |
| - companyField.should('have.value', '') |
72 |
| - phoneField.should('have.value', '') |
73 |
| - messageField.should('have.value', '') |
| 165 | + it('All fields should be clear after successful form submission', function () { |
| 166 | + cy.get('input[name=name]').should('have.value', 'Testing') |
| 167 | + cy.get('input[name=email]').should('have.value', 'testEmail@gmail.com') |
| 168 | + cy.get('input[name=phone]').should('have.value', '1459341234') |
| 169 | + cy.get('input[name=message]').should('have.value', 'This is a test message') |
74 | 170 | })
|
75 | 171 | })
|
76 |
| - describe('Unsucessful form submission', function() { |
| 172 | + describe('Unsucessful form submission', function () { |
77 | 173 | it('DOM should not show success message when all fields of the form are not filled out', function () {
|
78 |
| - nameField = cy.get('input[name=name]') |
79 |
| - .type('Test Name') |
80 |
| - cy.get('@submitBtn').click() |
81 |
| - cy.get('div.alert').should('not.exist') |
| 174 | + nameField = cy.get('input[name=name]').type('Test Name') |
| 175 | + cy.get('@submitBtn').should('be.disabled') |
82 | 176 | })
|
83 | 177 | })
|
84 | 178 | })
|
| 179 | + |
| 180 | + describe('Footer Navigation', function () { |
| 181 | + it('Navigate to SLA page', function () { |
| 182 | + cy.contains('Read our SLA').click() |
| 183 | + cy.url().should('include', '/service-level-agreement') |
| 184 | + }) |
| 185 | + it('Navigate to Developer page', function () { |
| 186 | + // cy.contains('I\'m a developer').click() |
| 187 | + // cy.url().should('include', '/opportunities/develop') |
| 188 | + }) |
| 189 | + it('Navigate to Design page', function () { |
| 190 | + // cy.contains('I\'m a designer').click() |
| 191 | + // cy.url().should('include', '/opportunities/design') |
| 192 | + }) |
| 193 | + it('Navigates to StartupJunto Registration Page', function () { |
| 194 | + // cy.contains('Register Today!').click() |
| 195 | + }) |
| 196 | + it('Navigates to OpenForge Twitter', function () { |
| 197 | + cy.contains('@OpenForge_US').click() |
| 198 | + }) |
| 199 | + it('Navigates to OpenForge Facebook', function () { |
| 200 | + cy.contains('OpenForge_US').click() |
| 201 | + }) |
| 202 | + it('Navigates to OpenForge Linkedin', function () { |
| 203 | + cy.contains('OpenForge_US').click() |
| 204 | + }) |
| 205 | + it('Navigates to OpenForge Instagram', function () { |
| 206 | + cy.contains('@OpenForgeTeam').click() |
| 207 | + }) |
| 208 | + //it('Open native mail to contact Hello@openforge.io', function () { |
| 209 | + //cy.contains('hello@openforge.io').click() |
| 210 | + //}) |
| 211 | + }) |
85 | 212 | })
|
0 commit comments