diff --git a/tests/e2e/specs/pages/root/error-404.spec.ts b/tests/e2e/specs/pages/root/error-404.spec.ts index 5bad23ff..8cae6ef6 100644 --- a/tests/e2e/specs/pages/root/error-404.spec.ts +++ b/tests/e2e/specs/pages/root/error-404.spec.ts @@ -54,10 +54,10 @@ test.describe('visual regression', () => { // TODO: enable (https://github.com/harlan-zw/nuxt-og-image/issues/81) // test('generates the open graph image', async ({ page }) => { - // await page.goto('/__og-image__/image/does-not-exist/og.png') + // await page.goto(`/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/does-not-exist/og.png`) // await expect(page).toHaveScreenshot({ fullPage: true }) - // await page.goto('/__og-image__/image/de/does-not-exist/og.png') + // await page.goto(`/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/de/does-not-exist/og.png`) // await expect(page).toHaveScreenshot({ fullPage: true }) // }) }) diff --git a/tests/e2e/specs/pages/root/index.spec.ts b/tests/e2e/specs/pages/root/index.spec.ts index 0c1cc0f8..0fd04e4e 100644 --- a/tests/e2e/specs/pages/root/index.spec.ts +++ b/tests/e2e/specs/pages/root/index.spec.ts @@ -105,10 +105,14 @@ test.describe('visual regression', () => { }) test('generates the open graph image', async ({ page }) => { - await page.goto('/__og-image__/image/og.png') + await page.goto( + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/og.png`, + ) await expect(page).toHaveScreenshot({ fullPage: true }) - await page.goto('/__og-image__/image/de/og.png') + await page.goto( + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/de/og.png`, + ) await expect(page).toHaveScreenshot({ fullPage: true }) }) }) diff --git a/tests/e2e/specs/pages/root/legal-notice.spec.ts b/tests/e2e/specs/pages/root/legal-notice.spec.ts index 07618b58..180e9cc3 100644 --- a/tests/e2e/specs/pages/root/legal-notice.spec.ts +++ b/tests/e2e/specs/pages/root/legal-notice.spec.ts @@ -41,10 +41,14 @@ test.describe('visual regression', () => { }) test('generates the open graph image', async ({ page }) => { - await page.goto('/__og-image__/image/legal-notice/og.png') + await page.goto( + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/legal-notice/og.png`, + ) await expect(page).toHaveScreenshot({ fullPage: true }) - await page.goto('/__og-image__/image/de/legal-notice/og.png') + await page.goto( + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/de/legal-notice/og.png`, + ) await expect(page).toHaveScreenshot({ fullPage: true }) }) }) diff --git a/tests/e2e/specs/pages/root/privacy-policy.spec.ts b/tests/e2e/specs/pages/root/privacy-policy.spec.ts index 65ecefe6..44e598f3 100644 --- a/tests/e2e/specs/pages/root/privacy-policy.spec.ts +++ b/tests/e2e/specs/pages/root/privacy-policy.spec.ts @@ -31,10 +31,14 @@ test.describe('visual regression', () => { }) test('generates the open graph image', async ({ page }) => { - await page.goto('/__og-image__/image/privacy-policy/og.png') + await page.goto( + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/privacy-policy/og.png`, + ) await expect(page).toHaveScreenshot({ fullPage: true }) - await page.goto('/__og-image__/image/de/privacy-policy/og.png') + await page.goto( + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}/de/privacy-policy/og.png`, + ) await expect(page).toHaveScreenshot({ fullPage: true }) }) }) diff --git a/tests/e2e/utils/tests.ts b/tests/e2e/utils/tests.ts index 50934d3a..c9b117f8 100644 --- a/tests/e2e/utils/tests.ts +++ b/tests/e2e/utils/tests.ts @@ -75,7 +75,12 @@ export const testMetadata = async ({ }, { key: 'content', - value: joinURL(SITE_URL, '/__og-image__/image', path, '/og.png'), + value: joinURL( + SITE_URL, + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}`, + path, + '/og.png', + ), }, ], }, @@ -111,7 +116,12 @@ export const testMetadata = async ({ }, { key: 'content', - value: joinURL(SITE_URL, '/__og-image__/image', path, '/og.png'), + value: joinURL( + SITE_URL, + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}`, + path, + '/og.png', + ), }, ], }, @@ -124,7 +134,12 @@ export const testMetadata = async ({ }, { key: 'content', - value: joinURL(SITE_URL, '/__og-image__/image', path, '/og.png'), + value: joinURL( + SITE_URL, + `/__og-image__/${process.env.VIO_SERVER === 'static' ? 'static' : 'image'}`, + path, + '/og.png', + ), }, ], },