Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit bec8a16

Browse files
author
Pablo Huerta
committed
pull fer tests
2 parents 7bbd589 + ae586c1 commit bec8a16

File tree

18 files changed

+1045
-563
lines changed

18 files changed

+1045
-563
lines changed

.eslintrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 6,
4+
"sourceType": "module",
5+
"ecmaFeatures": {
6+
"jsx": true
7+
}
8+
},
9+
"rules": {
10+
"semi": "error"
11+
}
12+
}
Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
11
describe('About page team', function () {
2-
var env = 'http://localhost:3333'
2+
var env = 'http://localhost:3333';
33
beforeEach(() => {
4-
cy.visit(env + '/about')
5-
})
4+
cy.visit(env + '/about');
5+
});
66
describe('Meet Our Team', function () {
77
it('Should be able to click links of app-members', function () {
8-
cy.get('#about').scrollIntoView()
8+
cy.get('#about').scrollIntoView();
99

10-
cy.get(':nth-child(1) > stencil-route-link.hydrated > a > .member--overlay > .member--text').click()
11-
cy.wait(1000)
12-
})
10+
cy.get(':nth-child(1) > stencil-route-link.hydrated > a > .member--overlay > .member--text').click();
11+
cy.wait(1000);
12+
});
1313
it('Should be 19 members', function () {
14-
cy.get('#about').scrollIntoView()
14+
cy.get('#about').scrollIntoView();
1515
cy.get('.member--text').as('members')
16-
.its('length').should('be.gt', 18)
17-
})
16+
.its('length').should('be.gt', 18);
17+
});
1818
it('All members must have titles', function () {
19-
cy.get('#about').scrollIntoView()
20-
cy.get('.member--text').as('members')
19+
cy.get('#about').scrollIntoView();
20+
cy.get('.member--text').as('members');
2121

22-
cy.get('@members').contains('Software Engineer')
23-
cy.get('@members').contains('Game Designer')
24-
cy.get('@members').contains('Visual Designer')
25-
cy.get('@members').contains('Director of Operations')
26-
cy.get('@members').contains('QA Manager')
27-
cy.get('@members').contains('Marketing Coordinator')
28-
cy.get('@members').contains('Project Management')
29-
cy.get('@members').contains('Design Coordinator')
30-
cy.get('@members').contains('Marketing Specialist')
31-
cy.get('@members').contains('Founder and Head of Technology')
32-
})
22+
cy.get('@members').contains('Software Engineer');
23+
cy.get('@members').contains('Game Designer');
24+
cy.get('@members').contains('Visual Designer');
25+
cy.get('@members').contains('Director of Operations');
26+
cy.get('@members').contains('QA Manager');
27+
cy.get('@members').contains('Marketing Coordinator');
28+
cy.get('@members').contains('Project Management');
29+
cy.get('@members').contains('Design Coordinator');
30+
cy.get('@members').contains('Marketing Specialist');
31+
cy.get('@members').contains('Founder and Head of Technology');
32+
});
3333

34-
})
34+
});
3535
describe('About-Header', function () {
3636
describe('Header Image', function () {
3737
it('The header must have an image', function () {
3838
cy.get('.hero > .col-12 > app-img')
39-
.should('exist')
40-
})
39+
.should('exist');
40+
});
4141
it('The header must show the correct image', function () {
4242
cy.get('.hero > .col-12 > app-img')
43-
.should('have.prop', 'src').and('contain', 'about')
44-
})
45-
})
43+
.should('have.prop', 'src').and('contain', 'about');
44+
});
45+
});
4646
describe('Header Button', function () {
4747
it('The button should take you to members', function () {
48-
cy.get('[data-cy=head-button]').click({ force: true })
49-
})
50-
})
51-
})
48+
cy.get('[data-cy=head-button]').click({ force: true });
49+
});
50+
});
51+
});
5252
describe('Our Values', function () {
5353
describe('Honesty Image', function () {
5454
it('Honesty image must exist', function () {
5555
cy.get('.honesty')
56-
.should('exist')
57-
})
56+
.should('exist');
57+
});
5858
it('The honesty image must be correct', function () {
5959
cy.get('.honesty')
60-
.should('have.css', 'background').and('contain', 'assets/svg/about-graphic-honesty.svg')
61-
})
62-
})
60+
.should('have.css', 'background').and('contain', 'assets/svg/about-graphic-honesty.svg');
61+
});
62+
});
6363
describe('Integrity Image', function () {
6464
it('Integrity image must exist', function () {
6565
cy.get('.integrity')
66-
.should('exist')
67-
})
66+
.should('exist');
67+
});
6868
it('The integrity image must be correct', function () {
6969
cy.get('.integrity')
70-
.should('have.css', 'background').and('contain', 'assets/svg/about-graphic-integrity.svg')
71-
})
72-
})
70+
.should('have.css', 'background').and('contain', 'assets/svg/about-graphic-integrity.svg');
71+
});
72+
});
7373
describe('Transparency Image', function () {
7474
it('transparency image must exist', function () {
7575
cy.get('.transparency')
76-
.should('exist')
77-
})
76+
.should('exist');
77+
});
7878
it('The transparency image must be correct', function () {
7979
cy.get('.transparency')
80-
.should('have.css', 'background').and('contain', 'assets/svg/about-graphic-transparency.svg')
81-
})
82-
})
83-
})
84-
})
80+
.should('have.css', 'background').and('contain', 'assets/svg/about-graphic-transparency.svg');
81+
});
82+
});
83+
});
84+
});

cypress/integration/app-contact.spec.js

Lines changed: 150 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,128 @@
1-
describe('Contact Page', function () {
2-
var env = 'http://localhost:3333';
3-
beforeEach(() => {
4-
cy.visit(env + '/contact')
5-
cy.get('button[type=submit]').as('submitBtn')
6-
})
1+
describe('Contact Page', function() {
2+
describe('The contact form displays with all fields', () => {
3+
it('Check that the form displays', function() {
4+
cy.visit('localhost:3333/contact');
5+
cy.get('#second-content')
6+
.contains('Get in Touch')
7+
.should('exist')
8+
.and('be.visible');
9+
cy.get('#second-content')
10+
.contains("Tell us a little bit about what you're working on. We'll be in touch to tell you about the next steps toward accomplishing your goals!")
11+
.should('exist')
12+
.and('be.visible');
13+
14+
cy.get('#contact-form')
15+
.contains('Full Name*')
16+
.should('exist')
17+
.and('be.visible');
18+
cy.get('#contact-form')
19+
.contains('E-mail*')
20+
.should('exist')
21+
.and('be.visible');
22+
cy.get('#contact-form')
23+
.contains('Phone')
24+
.should('exist')
25+
.and('be.visible');
26+
cy.get('#contact-form')
27+
.contains('What are you working on?')
28+
.should('exist')
29+
.and('be.visible');
30+
});
31+
});
32+
33+
describe('User is able to successfully submit a contact form & view the successful submission animation', () => {
34+
it('Check that the form fades and appears the animation', function() {
35+
cy.visit('localhost:3333/contact');
36+
cy.get('input[name=name]').type('Tester');
37+
cy.get('input[name=email]').type('Test@openforge.io');
38+
cy.get('input[name=phone]').type('3333333333');
39+
cy.get('input[name=message]').type('Testing');
40+
cy.get('button[type=submit]').click();
41+
cy.wait(9000);
42+
cy.get('[data-cy=sub]').screenshot('exist'); //if the image is rendered the submit is done
43+
});
44+
});
45+
46+
describe('User is not able to submit a contact form with a empty full name field', () => {
47+
it('Check that the submit is disabled', function() {
48+
cy.visit('localhost:3333/contact');
49+
cy.get('input[name=email]').type('Test@openforge.io');
50+
cy.get('input[name=phone]').type('3333333333');
51+
cy.get('input[name=message]').type('Testing');
52+
cy.get('button[type=submit]')
53+
.should('exist')
54+
.and('be.disabled');
55+
});
56+
});
57+
58+
describe('User is not able to submit a contact form with a empty email field', () => {
59+
it('Check that the submit is disabled', function() {
60+
cy.visit('localhost:3333/contact');
61+
cy.get('input[name=name]').type('Tester');
62+
cy.get('input[name=phone]').type('3333333333');
63+
cy.get('input[name=message]').type('Testing');
64+
cy.get('button[type=submit]')
65+
.should('exist')
66+
.and('be.disabled');
67+
});
68+
});
69+
70+
describe('User is not able to submit a contact form with a empty email field', () => {
71+
it('Check that the submit is disabled', function() {
72+
cy.visit('localhost:3333/contact');
73+
cy.get('input[name=name]').type('Tester');
74+
cy.get('input[name=email]').type('wrong_email');
75+
cy.get('input[name=phone]').type('3333333333');
76+
cy.get('input[name=message]').type('Testing');
77+
cy.get('button[type=submit]')
78+
.should('exist')
79+
.and('be.disabled');
80+
});
81+
});
82+
83+
describe('The mailbox icon displays on the right hand side of the contact form', () => {
84+
it('Check that the img exists', function() {
85+
cy.visit('localhost:3333/contact');
86+
cy.get('[data-cy=mailbox-img]')
87+
.should('exist')
88+
.and('be.visible');
89+
});
90+
});
91+
92+
describe('User is not able to submit the contact form after clearing all of the fields', () => {
93+
it('Check that the submit is disabled after clearing form', function() {
94+
cy.visit('localhost:3333/contact');
95+
cy.get('input[name=name]').type('Tester');
96+
cy.get('input[name=name]').clear();
97+
cy.get('input[name=email]').type('wrong_email');
98+
cy.get('input[name=email]').clear();
99+
cy.get('input[name=phone]').type('3333333333');
100+
cy.get('input[name=phone]').clear();
101+
cy.get('input[name=message]').type('Testing');
102+
cy.get('input[name=message]').clear();
103+
cy.get('button[type=submit]')
104+
.should('exist')
105+
.and('be.disabled');
106+
});
107+
});
108+
109+
describe('User is unable to submit a empty contact form', () => {
110+
it('Check that the button is disabled', function() {
111+
cy.visit('localhost:3333/contact');
112+
cy.get('button[type=submit]')
113+
.should('exist')
114+
.and('be.disabled');
115+
});
116+
});
7117

118+
describe('The footer is visible on the "Contact" page', () => {
119+
it('Check the footer exists', () => {
120+
cy.visit('localhost:3333/contact');
121+
cy.get('footer')
122+
.should('exist')
123+
.and('be.visible');
124+
});
125+
});
8126
/*describe('Nav Bar Navigation (Desktop)', function () {
9127
// TODO -> Test suite for the blog link in nav bar.
10128
it('Home on nav bar should redirect to home page', function () {
@@ -142,33 +260,32 @@ describe('Contact Page', function () {
142260
})
143261
})*/
144262

145-
describe('Contact Form', function () {
146-
let nameField;
147-
let emailField;
148-
let phoneField;
149-
let messageField;
150-
151-
describe('Successful form submission', function () {
152-
beforeEach(() => {
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')
157-
cy.get('@submitBtn').click()
158-
})
263+
// describe('Contact Form', function () {
264+
// let nameField;
265+
// let emailField;
266+
// let phoneField;
267+
// let messageField;
159268

160-
it('Should show a success message on submit when all form values have been filled out', function () {
161-
cy.wait(9000)
162-
cy.get('[data-cy=sub]').screenshot('exist') //if the image is rendered the submit is done
163-
})
269+
// describe('Successful form submission', function () {
270+
// beforeEach(() => {
271+
// nameField = cy.get('input[name=name]').type('Testing');
272+
// emailField = cy.get('input[name=email]').type('testEmail@gmail.com');
273+
// phoneField = cy.get('input[name=phone]').type('1459341234');
274+
// messageField = cy.get('input[name=message]').type('This is a test message');
275+
// cy.get('@submitBtn').click();
276+
// });
164277

165-
})
166-
describe('Unsucessful form submission', function () {
167-
it('DOM should not show success message when all fields of the form are not filled out', function () {
168-
nameField = cy.get('input[name=name]').type('Test Name')
169-
cy.get('@submitBtn').should('be.disabled')
170-
})
171-
})
172-
})
278+
// it('Should show a success message on submit when all form values have been filled out', function () {
279+
// cy.wait(9000);
280+
// cy.get('[data-cy=sub]').screenshot('exist'); //if the image is rendered the submit is done
281+
// });
173282

174-
})
283+
// });
284+
// describe('Unsucessful form submission', function () {
285+
// it('DOM should not show success message when all fields of the form are not filled out', function () {
286+
// nameField = cy.get('input[name=name]').type('Test Name');
287+
// cy.get('@submitBtn').should('be.disabled');
288+
// });
289+
// });
290+
// });
291+
});

0 commit comments

Comments
 (0)