diff --git a/tests/e2e/background_image.spec.js b/tests/e2e/background_image.spec.js index 6a0768b..bc3e568 100644 --- a/tests/e2e/background_image.spec.js +++ b/tests/e2e/background_image.spec.js @@ -19,12 +19,12 @@ for (const { url, description } of pagesWithSimpleImages) { await element.scrollIntoViewIfNeeded(); // Set expectations - const expectedBg = `background-image: url("${await element.getAttribute("data-bg")}");`; - const expectedHiDpiBg = `background-image: url("${await element.getAttribute( - "data-bg-hidpi" - )}");`; + const dataBg = await element.getAttribute("data-bg"); + const dataBgHidpi = await element.getAttribute("data-bg-hidpi"); + const expectedBg = `background-image: url("${dataBg}");`; + const expectedHiDpiBg = `background-image: url("${dataBgHidpi}");`; - if (!expectedHiDpiBg) { + if (!dataBgHidpi) { await expect(element).toHaveAttribute("style", expectedBg); continue; } diff --git a/tests/e2e/background_image_multi.spec.js b/tests/e2e/background_image_multi.spec.js index 6d129bb..4c56c5e 100644 --- a/tests/e2e/background_image_multi.spec.js +++ b/tests/e2e/background_image_multi.spec.js @@ -19,12 +19,12 @@ for (const { url, description } of pagesWithSimpleImages) { await element.scrollIntoViewIfNeeded(); // Set expectations - const expectedBg = `background-image: ${await element.getAttribute("data-bg-multi")};`; - const expectedHiDpiBg = `background-image: ${await element.getAttribute( - "data-bg-multi-hidpi" - )};`; + const dataBgMulti = await element.getAttribute("data-bg-multi"); + const dataBgMultiHidpi = await element.getAttribute("data-bg-multi-hidpi"); + const expectedBg = `background-image: ${dataBgMulti};`; + const expectedHiDpiBg = `background-image: ${dataBgMultiHidpi};`; - if (!expectedHiDpiBg) { + if (!dataBgMultiHidpi) { await expect(element).toHaveAttribute("style", expectedBg); continue; }