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

Commit c6df302

Browse files
author
Pablo Huerta
committed
Recreated slider test, changed carousel start if was not moving on cypress
1 parent 0feb868 commit c6df302

File tree

2 files changed

+31
-64
lines changed

2 files changed

+31
-64
lines changed

cypress/integration/app-partners.spec.js

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('Partners', function() {
1+
describe('Partners', function () {
22
describe('The "Meet Our Partners" header and body text displays', () => {
33
it('Check the header displays', () => {
44
cy.visit('localhost:3333/partners');
@@ -36,6 +36,26 @@ describe('Partners', function() {
3636
});
3737
});
3838

39+
describe('The Trusted Carousel automatically rotates through all 6 slides and then started over', () => {
40+
it('Check the slider rotates automatically', () => {
41+
cy.visit('localhost:3333/partners');
42+
cy.get('#partnersCarousel')
43+
.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.')
44+
.should('exist')
45+
.and('be.visible');
46+
cy.wait(4000);
47+
cy.wait(4000);
48+
cy.wait(4000);
49+
cy.wait(4000);
50+
cy.wait(4000);
51+
cy.wait(4000);
52+
cy.get('#partnersCarousel')
53+
.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.')
54+
.should('exist')
55+
.and('be.visible');
56+
});
57+
});
58+
3959
describe('The carousel displays the correct image and content on all 6 slides', () => {
4060
it('Check the slides text of the carousel', () => {
4161
cy.visit('localhost:3333/partners');
@@ -88,7 +108,7 @@ describe('Partners', function() {
88108
.and('be.visible');
89109
});
90110

91-
it('Check the slides images of the carousel', function() {
111+
it('Check the slides images of the carousel', function () {
92112
cy.get('[data-cy=capp-img]').each(($el, index) => {
93113
switch (index) {
94114
case 0:
@@ -173,60 +193,8 @@ describe('Partners', function() {
173193
});
174194
});
175195

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');
225-
});
226-
});
227-
228196
describe('The CTA displays under the carousel', () => {
229-
it('Check that the user is navigated to contact page', function() {
197+
it('Check that the user is navigated to contact page', function () {
230198
cy.visit('localhost:3333/partners');
231199
cy.get('#cta').scrollIntoView();
232200
cy.get('#cta')
@@ -245,7 +213,7 @@ describe('Partners', function() {
245213
});
246214

247215
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() {
216+
it('Check that the user is navigated to contact page', function () {
249217
cy.visit('localhost:3333/partners');
250218
cy.get('[data-cy=cta-button]')
251219
.should('exist')

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ export class AppPartners {
1313
componentDidLoad() {
1414
this.changeMetadata();
1515

16-
if (Build.isBrowser) {
17-
/* tslint:disable-next-line */
18-
$(document).ready(function() {
19-
// Force bootstrap to initialize carousel
20-
const partnersCarousel = $('#partnersCarousel');
21-
setTimeout(() => bootstrap.Carousel._jQueryInterface.call(partnersCarousel, partnersCarousel.data()), 0);
22-
});
23-
}
16+
17+
/* tslint:disable-next-line */
18+
$(document).ready(function () {
19+
// Force bootstrap to initialize carousel
20+
const partnersCarousel = $('#partnersCarousel');
21+
setTimeout(() => bootstrap.Carousel._jQueryInterface.call(partnersCarousel, partnersCarousel.data()), 0);
22+
});
2423
}
2524

2625
changeMetadata() {

0 commit comments

Comments
 (0)