|
| 1 | +import { breakpoints } from '../fixtures/breakpoints'; |
1 | 2 | import { articles, liveblogs } from '../fixtures/pages';
|
2 | 3 |
|
3 | 4 | describe('merchandising slot on pages', () => {
|
4 | 5 | [...articles, ...liveblogs].forEach(({ path, adTest }) => {
|
5 |
| - it(`Test ${path} has correct slot and iframe`, () => { |
6 |
| - cy.visit(`${path}?adtest=${adTest}`); |
| 6 | + Object.entries(breakpoints).forEach(([breakpoint, width]) => { |
| 7 | + it(`Test ${path} has correct slot and iframe at breakpoint ${breakpoint}`, () => { |
| 8 | + cy.viewport(width, 800) |
7 | 9 |
|
8 |
| - // Click "Yes, I'm happy" on the sourcepoint banner to obtain consent |
9 |
| - cy.getIframeBody('sp_message_iframe_').find('.btn-primary').click(); |
| 10 | + cy.visit(`${path}?adtest=${adTest}`); |
10 | 11 |
|
11 |
| - // Check that the merchandising-high ad slot is on the page |
12 |
| - cy.get('#dfp-ad--merchandising-high').should('exist'); |
| 12 | + // Click "Yes, I'm happy" on the sourcepoint banner to obtain consent |
| 13 | + cy.getIframeBody('sp_message_iframe_').find('.btn-primary').click(); |
13 | 14 |
|
14 |
| - // creative isn't loaded unless slot is in view |
15 |
| - cy.get('#dfp-ad--merchandising-high').scrollIntoView(); |
| 15 | + // Check that the merchandising ad slot is on the page |
| 16 | + cy.get('#dfp-ad--merchandising').should('exist'); |
16 | 17 |
|
17 |
| - // Check that an iframe is placed inside the merchandising-high ad slot |
18 |
| - cy.get('#dfp-ad--merchandising-high') |
19 |
| - .find('iframe') |
20 |
| - .should('exist'); |
| 18 | + // creative isn't loaded unless slot is in view |
| 19 | + cy.get('#dfp-ad--merchandising').scrollIntoView({duration: 4000}); |
21 | 20 |
|
22 |
| - // Check that the merchandising ad slot is on the page |
23 |
| - cy.get('#dfp-ad--merchandising').should('exist'); |
24 |
| - |
25 |
| - // creative isn't loaded unless slot is in view |
26 |
| - cy.get('#dfp-ad--merchandising').scrollIntoView(); |
27 |
| - |
28 |
| - // Check that an iframe is placed inside the merchandising ad slot |
29 |
| - cy.get('#dfp-ad--merchandising').find('iframe').should('exist'); |
| 21 | + // Check that an iframe is placed inside the merchandising ad slot |
| 22 | + cy.get('#dfp-ad--merchandising').find('iframe', {timeout: 10000}).should('exist'); |
| 23 | + }); |
30 | 24 | });
|
31 | 25 | });
|
32 | 26 | });
|
0 commit comments