Skip to content

Commit a853550

Browse files
CW-178 Infinite slideshow testing (#99)
* CW-178 Init testing file for InfiniteSlideshow * CW-178 Add testing for the InfiniteSlideshow component Since Cypress is not tuned for visual testing, we are going to ensure that the banners are present and that the css animation properties are set.
1 parent 442a919 commit a853550

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
describe('InfiniteSlideshow Landing Page', () => {
2+
beforeEach(() => {
3+
cy.visit('/');
4+
});
5+
6+
it('finds whether the banners are displayed', () => {
7+
// Check if banners exist on each slot
8+
cy.get('[data-cy=infinite-slideshow]').each(($is) => {
9+
// Check if it is animated
10+
cy.wrap($is).should('have.css', 'animation-name');
11+
// Check if the animation is infinite
12+
cy.wrap($is).should('have.css', 'animation-iteration-count').and('eq', 'infinite');
13+
// Check if the animation is running
14+
cy.wrap($is).should('have.css', 'animation-play-state').and('eq', 'running');
15+
// Each slot should have at least 1 item in it
16+
cy.wrap($is).children().each(($slot) => {
17+
cy.wrap($slot).children().should('have.length.gt', 0);
18+
});
19+
});
20+
});
21+
});

frontend/src/components/InfiniteSlideshow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<template>
1515
<div class="is-container">
16-
<div class="is-element" :style="settings">
16+
<div class="is-element" :style="settings" data-cy="infinite-slideshow">
1717
<div class="is-section">
1818
<slot></slot>
1919
</div>

0 commit comments

Comments
 (0)