From 98b3f14952d967058a6770de9671d889f13ff9bc Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:42:38 +0600 Subject: [PATCH 1/9] Spotify Playlist --- tests/classic/spotify.spec.js | 16 ++++++++++++---- tests/classic/x.spec.js | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 tests/classic/x.spec.js diff --git a/tests/classic/spotify.spec.js b/tests/classic/spotify.spec.js index 595547b..df88abf 100644 --- a/tests/classic/spotify.spec.js +++ b/tests/classic/spotify.spec.js @@ -8,11 +8,19 @@ test.describe('Classic Spotify', () => { await page.goto(slug); }); - test('Spotify Single', async ({ page }) => { - const heading = page.getByRole('heading', { name: '' }); + test('Spotify Playlist', async ({ page }) => { + const heading = page.getByRole('heading', { name: 'Classic Spotify' }); await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); - - + await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByRole('link', { name: 'Kids Quran playlist' })).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByLabel('More')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); + await page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('play-pause-button').click(); + await page.waitForTimeout(300) + await page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('play-pause-button').click(); }); }); \ No newline at end of file diff --git a/tests/classic/x.spec.js b/tests/classic/x.spec.js new file mode 100644 index 0000000..e001a53 --- /dev/null +++ b/tests/classic/x.spec.js @@ -0,0 +1,16 @@ +const { test, expect } = require('@playwright/test'); + +let slug = 'playwright-classic-editor/classic-twitter/'; + + +test.describe('Classic Twitter', () => { + test.beforeEach(async ({ page }) => { + await page.goto(slug); + }); + + test('Default Twitter', async ({ page }) => { + const heading = page.getByRole('heading', { name: '' }); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + }); +}); \ No newline at end of file From 721b2dda5e134f05c8b2f2a671784e4639c709ae Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:50:50 +0600 Subject: [PATCH 2/9] Classic Spotify Single --- tests/classic/spotify.spec.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/classic/spotify.spec.js b/tests/classic/spotify.spec.js index df88abf..aeb029d 100644 --- a/tests/classic/spotify.spec.js +++ b/tests/classic/spotify.spec.js @@ -8,7 +8,7 @@ test.describe('Classic Spotify', () => { await page.goto(slug); }); - test('Spotify Playlist', async ({ page }) => { + test('Classic Spotify Playlist', async ({ page }) => { const heading = page.getByRole('heading', { name: 'Classic Spotify' }); await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); @@ -23,4 +23,20 @@ test.describe('Classic Spotify', () => { await page.waitForTimeout(300) await page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('play-pause-button').click(); }); + + test('Classic Spotify Single', async ({ page }) => { + const heading = page.getByText('Spotify Single'); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().locator('.BackgroundColorContainer_backgroundColorContainer__YZSQ7')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByRole('link', { name: 'Surah Ar-Rahman (Be Heaven)' })).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByLabel('More')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('play-pause-button').click(); + await page.waitForTimeout(300) + await page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('play-pause-button').click(); + }); }); \ No newline at end of file From 27d26e352e654ef134d4c7fecb0978acd6681f2a Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:54:50 +0600 Subject: [PATCH 3/9] Classic Spotify Artist --- tests/classic/spotify.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/classic/spotify.spec.js b/tests/classic/spotify.spec.js index aeb029d..50018b7 100644 --- a/tests/classic/spotify.spec.js +++ b/tests/classic/spotify.spec.js @@ -39,4 +39,20 @@ test.describe('Classic Spotify', () => { await page.waitForTimeout(300) await page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('play-pause-button').click(); }); + + test('Classic Spotify Artist', async ({ page }) => { + const heading = page.getByText('Spotify Artist'); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByLabel('More')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('tracklist-row-1')).toBeVisible(); + await page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('play-pause-button').click(); + await page.waitForTimeout(300) + await page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('play-pause-button').click(); + }); }); \ No newline at end of file From b536645a765d76b99c2712945cac0b2e6b8c1605 Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:59:39 +0600 Subject: [PATCH 4/9] Classic Spotify Album --- tests/classic/spotify.spec.js | 40 +++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/tests/classic/spotify.spec.js b/tests/classic/spotify.spec.js index 50018b7..7f03a7f 100644 --- a/tests/classic/spotify.spec.js +++ b/tests/classic/spotify.spec.js @@ -12,16 +12,19 @@ test.describe('Classic Spotify', () => { const heading = page.getByRole('heading', { name: 'Classic Spotify' }); await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByRole('link', { name: 'Kids Quran playlist' })).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByLabel('More')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); - await page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('play-pause-button').click(); + + const pageLocator = page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]') + + await expect(pageLocator).toBeVisible(); + await expect(pageLocator.contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(pageLocator.contentFrame().getByRole('link', { name: 'Kids Quran playlist' })).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await expect(pageLocator.contentFrame().getByLabel('More')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); + await pageLocator.contentFrame().getByTestId('play-pause-button').click(); await page.waitForTimeout(300) - await page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]').contentFrame().getByTestId('play-pause-button').click(); + await pageLocator.contentFrame().getByTestId('play-pause-button').click(); }); test('Classic Spotify Single', async ({ page }) => { @@ -55,4 +58,23 @@ test.describe('Classic Spotify', () => { await page.waitForTimeout(300) await page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('play-pause-button').click(); }); + + + test('Classic Spotify Album', async ({ page }) => { + const heading = page.getByText('Spotify Artist'); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByRole('link', { name: 'Al Sabaê Al Mounjiate (Quran)' })).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByRole('link', { name: 'Abd Al Rahman Al Soudaiss' })).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByLabel('More')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); + await page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('play-pause-button').click(); + await page.waitForTimeout(300) + await page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('tracklist-row-0').getByTestId('playback-indicator').click(); + }); + }); \ No newline at end of file From 0d8f2e229f10f911429ce433282122a15a61d1bb Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:02:03 +0600 Subject: [PATCH 5/9] Store Locator on a variable --- tests/classic/spotify.spec.js | 60 +++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/tests/classic/spotify.spec.js b/tests/classic/spotify.spec.js index 7f03a7f..22d0206 100644 --- a/tests/classic/spotify.spec.js +++ b/tests/classic/spotify.spec.js @@ -13,7 +13,7 @@ test.describe('Classic Spotify', () => { await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); - const pageLocator = page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]') + const pageLocator = page.locator('iframe[title="Spotify Embed\\: Kids Quran playlist"]'); await expect(pageLocator).toBeVisible(); await expect(pageLocator.contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); @@ -32,15 +32,17 @@ test.describe('Classic Spotify', () => { await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().locator('.BackgroundColorContainer_backgroundColorContainer__YZSQ7')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByRole('link', { name: 'Surah Ar-Rahman (Be Heaven)' })).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByLabel('More')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); - await page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('play-pause-button').click(); + const pageLocator = page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]'); + + await expect(pageLocator.contentFrame().locator('.BackgroundColorContainer_backgroundColorContainer__YZSQ7')).toBeVisible(); + await expect(pageLocator.contentFrame().getByRole('link', { name: 'Surah Ar-Rahman (Be Heaven)' })).toBeVisible(); + await expect(pageLocator.contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(pageLocator.contentFrame().getByLabel('More')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await pageLocator.contentFrame().getByTestId('play-pause-button').click(); await page.waitForTimeout(300) - await page.locator('iframe[title="Spotify Embed\\: Surah Ar-Rahman \\(Be Heaven\\)"]').contentFrame().getByTestId('play-pause-button').click(); + await pageLocator.contentFrame().getByTestId('play-pause-button').click(); }); test('Classic Spotify Artist', async ({ page }) => { @@ -48,15 +50,17 @@ test.describe('Classic Spotify', () => { await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByLabel('More')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('tracklist-row-1')).toBeVisible(); - await page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('play-pause-button').click(); + const pageLocator = page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]'); + + await expect(pageLocator.contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(pageLocator.contentFrame().getByLabel('More')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('tracklist-row-1')).toBeVisible(); + await pageLocator.contentFrame().getByTestId('play-pause-button').click(); await page.waitForTimeout(300) - await page.locator('iframe[title="Spotify Embed\\: Omar Hisham"]').contentFrame().getByTestId('play-pause-button').click(); + await pageLocator.contentFrame().getByTestId('play-pause-button').click(); }); @@ -65,16 +69,18 @@ test.describe('Classic Spotify', () => { await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByRole('link', { name: 'Al Sabaê Al Mounjiate (Quran)' })).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByRole('link', { name: 'Abd Al Rahman Al Soudaiss' })).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('spotify-logo')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByLabel('More')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('play-pause-button')).toBeVisible(); - await expect(page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); - await page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('play-pause-button').click(); - await page.waitForTimeout(300) - await page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]').contentFrame().getByTestId('tracklist-row-0').getByTestId('playback-indicator').click(); + const pageLocator = page.locator('iframe[title="Spotify Embed\\: Al Sabaê Al Mounjiate \\(Quran\\)"]'); + + await expect(pageLocator.contentFrame().locator('.CoverArtBase_coverArt__ne0XI')).toBeVisible(); + await expect(pageLocator.contentFrame().getByRole('link', { name: 'Al Sabaê Al Mounjiate (Quran)' })).toBeVisible(); + await expect(pageLocator.contentFrame().getByRole('link', { name: 'Abd Al Rahman Al Soudaiss' })).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('spotify-logo')).toBeVisible(); + await expect(pageLocator.contentFrame().getByLabel('More')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('play-pause-button')).toBeVisible(); + await expect(pageLocator.contentFrame().getByTestId('tracklist-row-0')).toBeVisible(); + await pageLocator.contentFrame().getByTestId('play-pause-button').click(); + await page.waitForTimeout(300) + await pageLocator.contentFrame().getByTestId('tracklist-row-0').getByTestId('playback-indicator').click(); }); }); \ No newline at end of file From dc61eecbcaf4f615d1a2e306b80ed16a1e955b20 Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:11:01 +0600 Subject: [PATCH 6/9] Twitter For classic Editor --- tests/classic/x.spec.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/classic/x.spec.js b/tests/classic/x.spec.js index e001a53..c67da46 100644 --- a/tests/classic/x.spec.js +++ b/tests/classic/x.spec.js @@ -9,8 +9,14 @@ test.describe('Classic Twitter', () => { }); test('Default Twitter', async ({ page }) => { - const heading = page.getByRole('heading', { name: '' }); + const heading = page.getByRole('heading', { name: 'Classic Twitter' }); await heading.scrollIntoViewIfNeeded(); await expect(heading).toBeVisible(); + + await page.waitForTimeout(1000); + + const iframeLocator = page.locator('#post-9250 div'); + await expect(iframeLocator.first()).toBeVisible(); }); + }); \ No newline at end of file From 8c10f6a58a1e3caa2232929ded8fa20e81d55035 Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:17:14 +0600 Subject: [PATCH 7/9] Default Twitter Visibility Test for elementor --- tests/elementor/x.spec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/elementor/x.spec.js diff --git a/tests/elementor/x.spec.js b/tests/elementor/x.spec.js new file mode 100644 index 0000000..5bc41bb --- /dev/null +++ b/tests/elementor/x.spec.js @@ -0,0 +1,21 @@ +const { test, expect } = require('@playwright/test'); + +let slug = 'playwright-elementor/elementor-twitter//'; + + +test.describe('Elementor Twitter', () => { + test.beforeEach(async ({ page }) => { + await page.goto(slug); + }); + + test('Default Twitter Visibility Test', async ({ page }) => { + const heading = page.getByRole('heading', { name: 'Elementor Twitter' }); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + await page.waitForTimeout(1000); + + await expect(page.locator('iframe[title="X Post"]')).toBeVisible(); + }); + +}); \ No newline at end of file From 078bbabd1ce626245636be8eeacc8a2abf2ab03f Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:21:44 +0600 Subject: [PATCH 8/9] Gutenberg Twitter visibility test --- tests/gutenberg/x.spec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/gutenberg/x.spec.js diff --git a/tests/gutenberg/x.spec.js b/tests/gutenberg/x.spec.js new file mode 100644 index 0000000..371cd7e --- /dev/null +++ b/tests/gutenberg/x.spec.js @@ -0,0 +1,21 @@ +const { test, expect } = require('@playwright/test'); + +let slug = 'playwright-gutenberg/gutenberg-twitter/'; + +test.describe('Gutenberg Twitter', () => { + test.beforeEach(async ({ page }) => { + await page.goto(slug); + }); + + test('Default Twitter Visibility Test', async ({ page }) => { + const heading = page.getByRole('heading', { name: 'Gutenberg Twitter' }); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + await page.waitForTimeout(1000); + + // Select the first iframe with title "X Post" and validate its visibility + const iframe = page.locator('iframe[title="X Post"]').first(); + await expect(iframe).toBeVisible(); + }); +}); From e9d92575fd2c68219f1a678029b40e1161ddaeec Mon Sep 17 00:00:00 2001 From: "Md. Nahid Hasan" <42797913+nahidthenh@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:52:56 +0600 Subject: [PATCH 9/9] linkedin Iframe visibility test case for all editors --- tests/classic/linkedin.spec.js | 23 +++++++++++++++++++++++ tests/elementor/linkedin.spec.js | 22 ++++++++++++++++++++++ tests/gutenberg/linkedin.spec.js | 22 ++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 tests/classic/linkedin.spec.js create mode 100644 tests/elementor/linkedin.spec.js create mode 100644 tests/gutenberg/linkedin.spec.js diff --git a/tests/classic/linkedin.spec.js b/tests/classic/linkedin.spec.js new file mode 100644 index 0000000..d38c9e9 --- /dev/null +++ b/tests/classic/linkedin.spec.js @@ -0,0 +1,23 @@ +const { test, expect } = require('@playwright/test'); + +let slug = 'playwright-classic/classic-linkedin/'; + + +test.describe('Classic LinkedIn', () => { + test.beforeEach(async ({ page }) => { + await page.goto(slug); + }); + + test('Default LinkedIn', async ({ page }) => { + const heading = page.getByRole('heading', { name: 'Classic LinkedIn' }); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + await page.waitForTimeout(1000); + + const iframeLocator = page.locator('iframe'); + + await expect(iframeLocator.first()).toBeVisible(); + }); + +}); \ No newline at end of file diff --git a/tests/elementor/linkedin.spec.js b/tests/elementor/linkedin.spec.js new file mode 100644 index 0000000..aa2b186 --- /dev/null +++ b/tests/elementor/linkedin.spec.js @@ -0,0 +1,22 @@ +const { test, expect } = require('@playwright/test'); + +let slug = 'playwright-elementor/elementor-linkedin/'; + + +test.describe('Elementor LinkedIn', () => { + test.beforeEach(async ({ page }) => { + await page.goto(slug); + }); + + test('Default LinkedIn', async ({ page }) => { + const heading = page.getByRole('heading', { name: 'Default linkedIn Embed Test' }); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + const iframeLocator = page.locator('iframe'); + + await expect(iframeLocator.first()).toBeVisible(); + await expect(page.locator('iframe').contentFrame().getByLabel('View profile for Md. Nahid')).toBeVisible(); + }); + +}); \ No newline at end of file diff --git a/tests/gutenberg/linkedin.spec.js b/tests/gutenberg/linkedin.spec.js new file mode 100644 index 0000000..9b94950 --- /dev/null +++ b/tests/gutenberg/linkedin.spec.js @@ -0,0 +1,22 @@ +const { test, expect } = require('@playwright/test'); + +let slug = 'playwright-gutenberg/gutenberg-linkedin/'; + + +test.describe('Gutenberg LinkedIn', () => { + test.beforeEach(async ({ page }) => { + await page.goto(slug); + }); + + test('Default LinkedIn', async ({ page }) => { + const heading = page.getByRole('heading', { name: 'Gutenberg LinkedIn' }); + await heading.scrollIntoViewIfNeeded(); + await expect(heading).toBeVisible(); + + const iframeLocator = page.locator('iframe'); + + await expect(iframeLocator.first()).toBeVisible(); + await expect(page.locator('iframe').contentFrame().getByLabel('View profile for Md. Nahid')).toBeVisible(); + }); + +}); \ No newline at end of file