Skip to content

Commit

Permalink
SBVT-2171: adding pixelratio to fullpage screenshots (#196)
Browse files Browse the repository at this point in the history
tnelms1 authored Nov 29, 2023
1 parent 9c2c0ca commit 0ed249f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commands.js
Original file line number Diff line number Diff line change
@@ -399,6 +399,10 @@ let readImageAndBase64ToBlob = () => {
});
};
let checkForChangedDimensions = () => {
if (!picProps.pixelRatio) { //calculate pixel ratio
cy.task('logger', {type: "info", message: `calculated pixel ratio is: ${picProps.dimensions.width / dom.viewport.width}`});
picProps.pixelRatio = picProps.dimensions.width / dom.viewport.width
}
if (picProps.pixelRatio && Cypress.browser.isHeadless && dom.viewport.width * picProps.pixelRatio !== picProps.dimensions.width) {
cy.task('logger', {type: "fatal", message: `${dom.viewport.width*picProps.pixelRatio} !== ${picProps.dimensions.width} ----> dom.viewport.width*picProps.pixelRatio !== picProps.dimensions.width`});
// cy.task('logger', {type: "fatal", message: `${dom.viewport.width}*${picProps.pixelRatio} !== ${picProps.dimensions.width} ----> dom.viewport.width*picProps.pixelRatio !== picProps.dimensions.width`});

0 comments on commit 0ed249f

Please sign in to comment.