diff --git a/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a Zafara Tourist with worn and closeted items #0.png b/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a Zafara Tourist with worn and closeted items #0.png index 948ac19..c229aef 100644 Binary files a/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a Zafara Tourist with worn and closeted items #0.png and b/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a Zafara Tourist with worn and closeted items #0.png differ diff --git a/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a simple Blue Acara #0.png b/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a simple Blue Acara #0.png index f5a434f..494e7a3 100644 Binary files a/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a simple Blue Acara #0.png and b/cypress/integration/WardrobePage/__image_snapshots__/WardrobePage Outfit saving Saves a simple Blue Acara #0.png differ diff --git a/cypress/integration/WardrobePage/page.js b/cypress/integration/WardrobePage/page.js index 1f602c9..86fbeb7 100644 --- a/cypress/integration/WardrobePage/page.js +++ b/cypress/integration/WardrobePage/page.js @@ -15,8 +15,26 @@ export function getPosePickerOption(label, options) { } export function getOutfitPreview() { - return cy.get("[data-test-id=wardrobe-outfit-preview]:not([data-loading])", { - // A bit of an extra-long timeout, to await both server data and image data - timeout: 15000, - }); + // HACK: To return the screenshottable preview *area* (which is what this + // function is currently used for), we select the first img tag. That's + // because the app relies on CSS `object-fit` to get images to position + // correctly, rather than styling the container. This will still + // screenshot the full preview, because Cypress can't separate the + // layers! It just screenshots the bounded area. + // + // TODO: The way the layer positioning works is a bit fragile tbh, and the + // canvases already do math; it could make sense to just have the + // container use the same math, or some clever CSS? + // + // NOTE: The tests need to run in a 600x600 actual window, or else the + // snapshot will come out smaller. This because our snapshot plugin + // performs its snapshot within the window's natural area, rather than + // the simulated area that most tests run in. + return cy + .get("[data-test-id=wardrobe-outfit-preview]:not([data-loading])", { + // A bit of an extra-long timeout, to await both server data and image data + timeout: 15000, + }) + .get("img") + .first(); }