Skip to content

Commit

Permalink
fix block test (#3725)
Browse files Browse the repository at this point in the history
* fix block test

* wait for product to visible

* update

* remove assert

* check local cache

* update image path

* update backend url

* test

* update to new product
  • Loading branch information
dpatil-magento committed Mar 9, 2022
1 parent e22905f commit 01b6e28
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 194 deletions.
2 changes: 1 addition & 1 deletion venia-integration-tests/cypress.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
"retries": {
"runMode": 2
}
}
}

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -158,198 +158,197 @@ describe('PWA-1156: verify pagebuilder row content', () => {
});
});

// Failing on CI with 403 access forbidden error, it will be handled in https://jira.corp.magento.com/browse/PWA-2578
// it('verify row video background3', () => {
// cy.intercept('GET', getCMSPage, {
// fixture: 'pageBuilder/row/row-video-background-3.json'
// }).as('getCMSMockData');
// cy.visitHomePage();
// cy.wait(['@getCMSMockData']).its('response.body');
//
// // Row with youtube embedded
// cy.get('div[class^="richContent-root"]')
// .eq(0)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'youtube');
//
// cy.get('div[class^="richContent-root"]')
// .eq(0)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Row with youtube not embedded
// cy.get('div[class^="richContent-root"]')
// .eq(1)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'youtube');
//
// cy.get('div[class^="richContent-root"]')
// .eq(1)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Row with youtube insecure
// cy.get('div[class^="richContent-root"]')
// .eq(2)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'youtube');
//
// cy.get('div[class^="richContent-root"]')
// .eq(2)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Row with vimeo embedded
// cy.get('div[class^="richContent-root"]')
// .eq(3)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'player.vimeo.com');
//
// cy.get('div[class^="richContent-root"]')
// .eq(3)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Row with vimeo not embedded
// cy.get('div[class^="richContent-root"]')
// .eq(4)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'player.vimeo.com');
//
// cy.get('div[class^="richContent-root"]')
// .eq(4)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Row with vimeo insecure
// cy.get('div[class^="richContent-root"]')
// .eq(5)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'player.vimeo.com');
//
// cy.get('div[class^="richContent-root"]')
// .eq(5)
// .scrollIntoView({ duration: 2000 })
// .find('iframe')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Row with mp4
// cy.get('div[class^="richContent-root"]')
// .eq(6)
// .scrollIntoView({ duration: 2000 })
// .find('[id^="jarallax-container"] video')
// .should('exist')
// .find('source')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'https://');
// cy.get('div[class^="richContent-root"]')
// .eq(6)
// .find('[id^="jarallax-container"] video source')
// .and('have.attr', 'type')
// .and('contain', 'video/mp4');
//
// cy.get('div[class^="richContent-root"]')
// .eq(6)
// .find('[id^="jarallax-container"] video source')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Row with mp4 insecure
// cy.get('div[class^="richContent-root"]')
// .eq(7)
// .scrollIntoView({ duration: 2000 })
// .find('[id^="jarallax-container"] video')
// .should('exist')
// .find('source')
// .should('exist')
// .and('have.attr', 'src')
// .and('contain', 'http://');
// cy.get('div[class^="richContent-root"]')
// .eq(7)
// .find('[id^="jarallax-container"] video source')
// .and('have.attr', 'type')
// .and('contain', 'video/mp4');
//
// cy.get('div[class^="richContent-root"]')
// .eq(7)
// .find('[id^="jarallax-container"] video source')
// .invoke('attr', 'src')
// .then(src => {
// cy.request(src)
// .its('status')
// .should('eq', 200);
// });
//
// // Hide iframes to prevent capturing moving images
// cy.get('iframe, video')
// .invoke('attr', 'style', 'visibility: hidden !important')
// .should('not.be.visible');
//
// cy.loadFullPage().then(() => {
// cy.captureFullPageScreenshot({
// name: 'Page Builder Row Video Background3',
// timeout: 60000
// });
// });
// });
it('verify row video background3', () => {
cy.intercept('GET', getCMSPage, {
fixture: 'pageBuilder/row/row-video-background-3.json'
}).as('getCMSMockData');
cy.visitHomePage();
cy.wait(['@getCMSMockData']).its('response.body');

// Row with youtube embedded
cy.get('div[class^="richContent-root"]')
.eq(0)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'youtube');

cy.get('div[class^="richContent-root"]')
.eq(0)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Row with youtube not embedded
cy.get('div[class^="richContent-root"]')
.eq(1)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'youtube');

cy.get('div[class^="richContent-root"]')
.eq(1)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Row with youtube insecure
cy.get('div[class^="richContent-root"]')
.eq(2)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'youtube');

cy.get('div[class^="richContent-root"]')
.eq(2)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Row with vimeo embedded
cy.get('div[class^="richContent-root"]')
.eq(3)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'player.vimeo.com');

cy.get('div[class^="richContent-root"]')
.eq(3)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Row with vimeo not embedded
cy.get('div[class^="richContent-root"]')
.eq(4)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'player.vimeo.com');

cy.get('div[class^="richContent-root"]')
.eq(4)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Row with vimeo insecure
cy.get('div[class^="richContent-root"]')
.eq(5)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'player.vimeo.com');

cy.get('div[class^="richContent-root"]')
.eq(5)
.scrollIntoView({ duration: 2000 })
.find('iframe')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Row with mp4
cy.get('div[class^="richContent-root"]')
.eq(6)
.scrollIntoView({ duration: 2000 })
.find('[id^="jarallax-container"] video')
.should('exist')
.find('source')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'https://');
cy.get('div[class^="richContent-root"]')
.eq(6)
.find('[id^="jarallax-container"] video source')
.and('have.attr', 'type')
.and('contain', 'video/mp4');

cy.get('div[class^="richContent-root"]')
.eq(6)
.find('[id^="jarallax-container"] video source')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Row with mp4 insecure
cy.get('div[class^="richContent-root"]')
.eq(7)
.scrollIntoView({ duration: 2000 })
.find('[id^="jarallax-container"] video')
.should('exist')
.find('source')
.should('exist')
.and('have.attr', 'src')
.and('contain', 'http://');
cy.get('div[class^="richContent-root"]')
.eq(7)
.find('[id^="jarallax-container"] video source')
.and('have.attr', 'type')
.and('contain', 'video/mp4');

cy.get('div[class^="richContent-root"]')
.eq(7)
.find('[id^="jarallax-container"] video source')
.invoke('attr', 'src')
.then(src => {
cy.request(src)
.its('status')
.should('eq', 200);
});

// Hide iframes to prevent capturing moving images
cy.get('iframe, video')
.invoke('attr', 'style', 'visibility: hidden !important')
.should('not.be.visible');

cy.loadFullPage().then(() => {
cy.captureFullPageScreenshot({
name: 'Page Builder Row Video Background3',
timeout: 60000
});
});
});
});

describe('PWA-1471: Verify pagebuilder row media query', () => {
Expand Down

0 comments on commit 01b6e28

Please sign in to comment.