Skip to content

Commit

Permalink
Merge pull request #9 from nahidthenh/nahid
Browse files Browse the repository at this point in the history
LinkedIn, Twitter , Spotify Classic TestCases added
  • Loading branch information
nahidthenh authored Jan 16, 2025
2 parents 0fac5b3 + e9d9257 commit d9e1808
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 3 deletions.
23 changes: 23 additions & 0 deletions tests/classic/linkedin.spec.js
Original file line number Diff line number Diff line change
@@ -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();
});

});
74 changes: 71 additions & 3 deletions tests/classic/spotify.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,79 @@ test.describe('Classic Spotify', () => {
await page.goto(slug);
});

test('Spotify Single', async ({ page }) => {
const heading = page.getByRole('heading', { name: '' });
test('Classic Spotify Playlist', async ({ page }) => {
const heading = page.getByRole('heading', { name: 'Classic Spotify' });
await heading.scrollIntoViewIfNeeded();
await expect(heading).toBeVisible();


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 pageLocator.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();

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 pageLocator.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();

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 pageLocator.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();

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();
});

});
22 changes: 22 additions & 0 deletions tests/classic/x.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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: '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();
});

});
22 changes: 22 additions & 0 deletions tests/elementor/linkedin.spec.js
Original file line number Diff line number Diff line change
@@ -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();
});

});
21 changes: 21 additions & 0 deletions tests/elementor/x.spec.js
Original file line number Diff line number Diff line change
@@ -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();
});

});
22 changes: 22 additions & 0 deletions tests/gutenberg/linkedin.spec.js
Original file line number Diff line number Diff line change
@@ -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();
});

});
21 changes: 21 additions & 0 deletions tests/gutenberg/x.spec.js
Original file line number Diff line number Diff line change
@@ -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();
});
});

0 comments on commit d9e1808

Please sign in to comment.