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

Commit ddabb64

Browse files
committed
feat(cypress): update partners tests
1 parent 0d98562 commit ddabb64

File tree

2 files changed

+254
-67
lines changed

2 files changed

+254
-67
lines changed
Lines changed: 252 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,269 @@
1-
describe('App Partners', function () {
2-
var env = 'http://localhost:3333';
3-
beforeEach(() => {
4-
cy.visit(env + '/partners');
1+
describe('Partners', function() {
2+
describe('The "Meet Our Partners" header and body text displays', () => {
3+
it('Check the header displays', () => {
4+
cy.visit('localhost:3333/partners');
5+
cy.get('header')
6+
.contains('Meet Our Partners')
7+
.should('exist')
8+
.and('be.visible');
9+
cy.get('header')
10+
.contains('Isaac Newton once said "If I have seen further, it is by standing on the shoulders of giants." and that is exactly how we feel about our partners!')
11+
.should('exist')
12+
.and('be.visible');
13+
cy.get('header')
14+
.contains(
15+
'We believe in industry-wide collaboration and have connected with the top firms in their fields in order to create true value to our clients. Our partnerships provide us with cutting-edge solutions and services. The combination of our expertise and their support means we provide you with the best experience money can buy.'
16+
)
17+
.should('exist')
18+
.and('be.visible');
519
});
20+
});
621

7-
describe('Partners Header', () => {
8-
it('Partners header image should exist', () => {
9-
cy.get('[data-cy=head-image]').should('exist');
10-
});
22+
describe('The "Meet Our Partners" icon displays', () => {
23+
it('Check the image displays', () => {
24+
cy.visit('localhost:3333/partners');
25+
cy.get('[data-cy=head-image]').should('exist');
26+
});
27+
});
28+
29+
describe('The Trusted partners carousel title displays', () => {
30+
it('Check the header of the carousel', () => {
31+
cy.visit('localhost:3333/partners');
32+
cy.get('#trusted-partners')
33+
.contains('Trusted Partners')
34+
.should('exist')
35+
.and('be.visible');
36+
});
37+
});
1138

12-
it('Partners header image should be correct', () => {
13-
cy.get('[data-cy=head-image]')
14-
.should('have.prop', 'src')
15-
.and('contain', 'partners-graphic-header');
16-
});
39+
describe('The carousel displays the correct image and content on all 6 slides', () => {
40+
it('Check the slides text of the carousel', () => {
41+
cy.visit('localhost:3333/partners');
42+
cy.get('#trusted-partners').scrollIntoView();
43+
cy.get('[data-slide-to=0]').click();
44+
cy.wait(2000);
45+
cy.get('#partnersCarousel')
46+
.contains('Ionic Framework is an open source app development platform which allows our team of developers to build and deploy high-quality cross-platform apps in record time.')
47+
.should('exist')
48+
.and('be.visible');
49+
cy.get('[data-slide-to=1]').click();
50+
cy.wait(2000);
51+
cy.get('#partnersCarousel')
52+
.contains(
53+
'1776 is the largest start-up incubator in the Northeast Corridor. It is a public benefit corporation that empowers start-ups by providing them with access to a global network of connections, and the intellectual and financial capital needed for them to prosper.'
54+
)
55+
.should('exist')
56+
.and('be.visible');
57+
cy.get('[data-slide-to=2]').click();
58+
cy.wait(2000);
59+
cy.get('#partnersCarousel')
60+
.contains(
61+
'Strapi is an open source Headless CMS, used to manage content and make it available through a fully-customizable API. It is a framework designed for building practical applications and services in a matter of hours, instead of the usual weeks; saving your team precious time.'
62+
)
63+
.should('exist')
64+
.and('be.visible');
65+
cy.get('[data-slide-to=3]').click();
66+
cy.wait(2000);
67+
cy.get('#partnersCarousel')
68+
.contains(
69+
'215Marketing is a Google Partner and full-service digital marketing agency; providing everything from traditional design to CRM implementation. Their primary focus is creating websites, effective Search Engine Marketing and measuring Return On Investment.'
70+
)
71+
.should('exist')
72+
.and('be.visible');
73+
cy.get('[data-slide-to=4]').click();
74+
cy.wait(2000);
75+
cy.get('#partnersCarousel')
76+
.contains(
77+
'Financial GPS is a virtual accounting solution for small enterprises, that presents them with monthly reports and videos. The wonderful team at Financial GPS provides different services, including bookkeeping, payroll processing and tax preparation.'
78+
)
79+
.should('exist')
80+
.and('be.visible');
81+
cy.get('[data-slide-to=5]').click();
82+
cy.wait(2000);
83+
cy.get('#partnersCarousel')
84+
.contains(
85+
'Drexel University and the Science Center offer an incubator and accelerator for early-stage, funded start-ups. ic@3401 is a community of experts and investors that plays an important role in the building of the collaborative culture in Philadelphia’s Innovation Neighborhood.'
86+
)
87+
.should('exist')
88+
.and('be.visible');
1789
});
1890

19-
describe('Partners Slider', () => {
20-
it('Should scroll to the trusted partners section', function () {
21-
cy.get('#trusted-partners').scrollIntoView();
22-
});
23-
it('Should have carousel components and active class prop to change', function () {
24-
cy.get('.carousel-indicators > li').should('exist')
25-
.and('have.class', 'active');
26-
});
27-
it('Active class should show on one carousel list element at a time', function () {
28-
cy.get('.carousel-indicators').within(() => {
91+
it('Check the slides images of the carousel', function() {
92+
cy.get('[data-cy=capp-img]').each(($el, index) => {
93+
switch (index) {
94+
case 0:
95+
cy.wrap($el)
96+
.should('have.prop', 'src')
97+
.and('contain', 'ionic');
98+
break;
99+
100+
case 1:
101+
cy.wrap($el)
102+
.should('have.prop', 'src')
103+
.and('contain', '1776');
104+
break;
105+
106+
case 2:
107+
cy.wrap($el)
108+
.should('have.prop', 'src')
109+
.and('contain', 'strapi');
110+
break;
29111

30-
cy.get('li').first().should('have.class', 'active');
31-
// Wait for carousel list el to change on the page
32-
cy.wait(2000);
33-
cy.get('li:first').next().should('have.class', 'active');
34-
cy.get('li').first().should('not.have.class', 'active');
35-
});
36-
});
37-
it('Process images should show in correct order', function () {
38-
cy.get('[data-cy=capp-img]').each(($el, index) => {
39-
switch (index) {
40-
case 0:
41-
cy.wrap($el).should('have.prop', 'src').and('contain', 'ionic');
42-
break;
112+
case 3:
113+
cy.wrap($el)
114+
.should('have.prop', 'src')
115+
.and('contain', '215');
116+
break;
43117

44-
case 1:
45-
cy.wrap($el).should('have.prop', 'src').and('contain', '1776');
46-
break;
118+
case 4:
119+
cy.wrap($el)
120+
.should('have.prop', 'src')
121+
.and('contain', 'financial-gps');
122+
break;
47123

48-
case 2:
49-
cy.wrap($el).should('have.prop', 'src').and('contain', 'strapi');
50-
break;
124+
case 5:
125+
cy.wrap($el)
126+
.should('have.prop', 'src')
127+
.and('contain', 'drexel-logo');
128+
break;
129+
}
130+
});
131+
});
132+
});
51133

52-
case 3:
53-
cy.wrap($el).should('have.prop', 'src').and('contain', '215');
54-
break;
134+
describe('The user is able to navigate the carousel via the Left and right arrows', () => {
135+
it('Check the user can navigate via Left and right arrows', () => {
136+
cy.visit('localhost:3333/partners');
137+
cy.get('#trusted-partners').scrollIntoView();
138+
cy.get('[data-cy="right-arrow"]').click();
139+
cy.wait(2000);
140+
cy.get('#partnersCarousel')
141+
.contains(
142+
'1776 is the largest start-up incubator in the Northeast Corridor. It is a public benefit corporation that empowers start-ups by providing them with access to a global network of connections, and the intellectual and financial capital needed for them to prosper.'
143+
)
144+
.should('exist')
145+
.and('be.visible');
146+
cy.get('[data-cy="left-arrow"]').click();
147+
cy.wait(2000);
148+
cy.get('#partnersCarousel')
149+
.contains('Ionic Framework is an open source app development platform which allows our team of developers to build and deploy high-quality cross-platform apps in record time.')
150+
.should('exist')
151+
.and('be.visible');
152+
});
153+
});
55154

56-
case 4:
57-
cy.wrap($el).should('have.prop', 'src').and('contain', 'financial-gps');
58-
break;
155+
describe('The user is able to navigate the carousel via the radio buttons at the bottom of the Carousel', () => {
156+
it('Check the user can navigate via radio buttons', () => {
157+
cy.visit('localhost:3333/partners');
158+
cy.get('#trusted-partners').scrollIntoView();
159+
cy.get('[data-slide-to=1]').click();
160+
cy.wait(2000);
161+
cy.get('#partnersCarousel')
162+
.contains(
163+
'1776 is the largest start-up incubator in the Northeast Corridor. It is a public benefit corporation that empowers start-ups by providing them with access to a global network of connections, and the intellectual and financial capital needed for them to prosper.'
164+
)
165+
.should('exist')
166+
.and('be.visible');
167+
cy.get('[data-slide-to=0]').click();
168+
cy.wait(2000);
169+
cy.get('#partnersCarousel')
170+
.contains('Ionic Framework is an open source app development platform which allows our team of developers to build and deploy high-quality cross-platform apps in record time.')
171+
.should('exist')
172+
.and('be.visible');
173+
});
174+
});
59175

60-
case 5:
61-
cy.wrap($el).should('have.prop', 'src').and('contain', 'drexel-logo');
62-
break;
63-
}
64-
});
65-
});
176+
describe('The Trusted Carousel automatically rotates through all 6 slides and then started over', () => {
177+
it('Check the slider rotates automatically', () => {
178+
cy.visit('localhost:3333/partners');
179+
cy.get('#trusted-partners').scrollIntoView();
180+
cy.get('[data-slide-to=0]').click();
181+
cy.get('#partnersCarousel')
182+
.contains('Ionic Framework is an open source app development platform which allows our team of developers to build and deploy high-quality cross-platform apps in record time.')
183+
.should('exist')
184+
.and('be.visible');
185+
cy.wait(6000);
186+
cy.get('#partnersCarousel')
187+
.contains(
188+
'1776 is the largest start-up incubator in the Northeast Corridor. It is a public benefit corporation that empowers start-ups by providing them with access to a global network of connections, and the intellectual and financial capital needed for them to prosper.'
189+
)
190+
.should('exist')
191+
.and('be.visible');
192+
cy.wait(6000);
193+
cy.get('#partnersCarousel')
194+
.contains(
195+
'Strapi is an open source Headless CMS, used to manage content and make it available through a fully-customizable API. It is a framework designed for building practical applications and services in a matter of hours, instead of the usual weeks; saving your team precious time.'
196+
)
197+
.should('exist')
198+
.and('be.visible');
199+
cy.wait(6000);
200+
cy.get('#partnersCarousel')
201+
.contains(
202+
'215Marketing is a Google Partner and full-service digital marketing agency; providing everything from traditional design to CRM implementation. Their primary focus is creating websites, effective Search Engine Marketing and measuring Return On Investment.'
203+
)
204+
.should('exist')
205+
.and('be.visible');
206+
cy.wait(6000);
207+
cy.get('#partnersCarousel')
208+
.contains(
209+
'Financial GPS is a virtual accounting solution for small enterprises, that presents them with monthly reports and videos. The wonderful team at Financial GPS provides different services, including bookkeeping, payroll processing and tax preparation.'
210+
)
211+
.should('exist')
212+
.and('be.visible');
213+
cy.wait(6000);
214+
cy.get('#partnersCarousel')
215+
.contains(
216+
'Drexel University and the Science Center offer an incubator and accelerator for early-stage, funded start-ups. ic@3401 is a community of experts and investors that plays an important role in the building of the collaborative culture in Philadelphia’s Innovation Neighborhood.'
217+
)
218+
.should('exist')
219+
.and('be.visible');
220+
cy.wait(6000);
221+
cy.get('#partnersCarousel')
222+
.contains('Ionic Framework is an open source app development platform which allows our team of developers to build and deploy high-quality cross-platform apps in record time.')
223+
.should('exist')
224+
.and('be.visible');
66225
});
226+
});
67227

68-
describe('Interested in partnering with us section', () => {
69-
it('Image should exist', () => {
70-
cy.get('.cta-image').should('exist');
71-
});
72-
it('The cta image must be correct', function () {
73-
cy.get('.cta-image')
74-
.should('have.css', 'background').and('contain', 'partners-graphic-cta');
75-
});
76-
it('Get in touch button should be clickable', () => {
77-
cy.get('[data-cy=cta-button]').click({ force: true });
78-
});
228+
describe('The CTA displays under the carousel', () => {
229+
it('Check that the user is navigated to contact page', function() {
230+
cy.visit('localhost:3333/partners');
231+
cy.get('#cta').scrollIntoView();
232+
cy.get('#cta')
233+
.contains('Interested in partnering with us?')
234+
.should('exist')
235+
.and('be.visible');
236+
cy.get('#cta')
237+
.contains('Contact us today to get started')
238+
.should('exist')
239+
.and('be.visible');
240+
cy.get('#cta')
241+
.contains('GET IN TOUCH')
242+
.should('exist')
243+
.and('be.visible');
79244
});
245+
});
80246

247+
describe('The "Get in Touch" button in the CTA navigates the user to the contact page', () => {
248+
it('Check that the user is navigated to contact page', function() {
249+
cy.visit('localhost:3333/partners');
250+
cy.get('[data-cy=cta-button]')
251+
.should('exist')
252+
.click();
253+
cy.wait(2000);
254+
cy.get('#second-content')
255+
.contains('Get in Touch')
256+
.should('exist')
257+
.and('be.visible');
258+
});
259+
});
81260

261+
describe('The footer is visible on the "Partners" page', () => {
262+
it('Check the footer exists', () => {
263+
cy.visit('localhost:3333/partners');
264+
cy.get('footer')
265+
.should('exist')
266+
.and('be.visible');
267+
});
268+
});
82269
});

src/pages/app-partners/app-partners.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class AppPartners {
1515

1616
if (Build.isBrowser) {
1717
/* tslint:disable-next-line */
18-
$(document).ready(function () {
18+
$(document).ready(function() {
1919
// Force bootstrap to initialize carousel
2020
const partnersCarousel = $('#partnersCarousel');
2121
setTimeout(() => bootstrap.Carousel._jQueryInterface.call(partnersCarousel, partnersCarousel.data()), 0);
@@ -130,7 +130,7 @@ export class AppPartners {
130130
</div>
131131
</div>
132132
<div class="row carousel-arrows">
133-
<a class="col-6 left carousel-control" href="#partnersCarousel" data-slide="prev">
133+
<a data-cy="left-arrow" class="col-6 left carousel-control" href="#partnersCarousel" data-slide="prev">
134134
<i class="fa fa-chevron-left" />
135135
</a>
136136
<a data-cy="right-arrow" class="col-6 right carousel-control" href="#partnersCarousel" data-slide="next">

0 commit comments

Comments
 (0)