Skip to content

Commit

Permalink
Merge pull request #3 from nahidthenh/nahid
Browse files Browse the repository at this point in the history
Google Photos TestCases for Elementor & Gutenberg
  • Loading branch information
nahidthenh authored Jan 6, 2025
2 parents a5d0d64 + 5f75e08 commit 767d9c3
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/elementor/google-photos.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const { test, expect } = require('@playwright/test');

let slug = 'playwright-elementor/elementor-google-photos';


test.describe("Google Photos", () => {
test.beforeEach(async ({ page }) => {
await page.goto(slug);
});

test('Google Photos Carousel', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Google Photos Carousel' })).toBeVisible();
await expect(page.locator('#ep-elements-id-f3716c7 iframe').contentFrame().getByTitle('Open in new window.').getByRole('img')).toBeVisible();
});

test('Pro - Google Photos Gallery Player', async ({ page }) => {
await page.getByRole('heading', { name: 'Pro - Google Photos Gallery Player', exact: true }).click();
await expect(page.locator('#ep-elements-id-dba371e iframe').contentFrame().locator('.jx-imageset').first()).toBeVisible();
await expect(page.locator('#ep-elements-id-dba371e iframe').contentFrame().locator('div:nth-child(3) > div > div:nth-child(2) > svg')).toBeVisible();
await expect(page.locator('#ep-elements-id-dba371e iframe').contentFrame().locator('div:nth-child(5) > div:nth-child(2) > div > div:nth-child(2) > svg')).toBeVisible();
await page.locator('#ep-elements-id-dba371e iframe').contentFrame().locator('div:nth-child(7) > .jx-svg-image > svg').click();
await page.locator('#ep-elements-id-dba371e iframe').contentFrame().locator('.jx-carousel-arrow > .jx-svg-image > svg').first().click();
await page.locator('#ep-elements-id-dba371e iframe').contentFrame().locator('div:nth-child(2) > svg').first().click();
});

test('Pro - Google Photos Gallery Player - Auto Play & Repeat On', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Pro - Google Photos Gallery Player - Auto Play & Repeat On' })).toBeVisible();
await expect(page.locator('#ep-elements-id-117fe6c iframe').contentFrame().locator('.jx-imageset').first()).toBeVisible();
await expect(page.locator('#ep-elements-id-117fe6c iframe').contentFrame().locator('div:nth-child(8) > .jx-svg-image > svg')).toBeVisible();
await expect(page.locator('#ep-elements-id-117fe6c iframe').contentFrame().locator('img:nth-child(2)').first()).toBeVisible();
await expect(page.locator('#ep-elements-id-117fe6c iframe').contentFrame().locator('div:nth-child(2) > .jx-imageset > div > img:nth-child(2)')).toBeVisible();
await expect(page.locator('#ep-elements-id-117fe6c iframe').contentFrame().locator('div:nth-child(3) > .jx-imageset > div > img:nth-child(2)')).toBeVisible();
await expect(page.locator('#ep-elements-id-117fe6c iframe').contentFrame().locator('div:nth-child(4) > .jx-imageset > div > img:nth-child(2)')).toBeVisible();
await expect(page.locator('#ep-elements-id-117fe6c iframe').contentFrame().locator('img:nth-child(2)').first()).toBeVisible();
});

test('Single Photo - With Color', async ({ page }) => {
await expect(page.getByRole('heading', {
name: 'Single Photo - With Color'
})).toBeVisible();
await expect(page.locator('#ep-elements-id-f0593d4 iframe').contentFrame().locator('.jx-imageset')).toBeVisible();
await expect(page.locator('#ep-elements-id-f0593d4 iframe').contentFrame().getByRole('link', { name: 'New item by Md. Nahid Hasan' })).toBeVisible();
});
});
48 changes: 48 additions & 0 deletions tests/gutenberg/google-photos.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const { test, expect } = require('@playwright/test');

let slug = 'playwright-elementor/gutenberg-google-photos';


test.describe("Google Photos", () => {
test.beforeEach(async ({ page }) => {
await page.goto(slug);
});

test('Google Photos Carousel', async ({ page }) => {
await expect(page.getByText('Google Photos Carousel')).toBeVisible();
await expect(page.locator('iframe').first().contentFrame().locator('.jx-imageset').first()).toBeVisible();
});

test('Pro - Google Photos Gallery Player', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Pro – Google Photos Gallery Player', exact: true })).toBeVisible();
await expect(page.locator('iframe').nth(1).contentFrame().locator('.jx-imageset').first()).toBeVisible();
await expect(page.locator('iframe').nth(1).contentFrame().locator('div:nth-child(8) > .jx-svg-image > svg')).toBeVisible();
await page.locator('iframe').nth(1).contentFrame().locator('div:nth-child(7) > .jx-svg-image > svg').click();
await expect(page.locator('iframe').nth(1).contentFrame().locator('div:nth-child(2) > .jx-imageset > div > img:nth-child(2)')).toBeVisible();
await expect(page.locator('iframe').nth(1).contentFrame().locator('div:nth-child(7)')).toBeVisible();
await expect(page.locator('iframe').nth(1).contentFrame().locator('.jx-carousel-arrow > .jx-svg-image > svg').first()).toBeVisible();
await page.locator('iframe').nth(1).contentFrame().locator('.jx-carousel-arrow > .jx-svg-image > svg').first().click();
await expect(page.locator('iframe').nth(1).contentFrame().locator('.jx-imageset').first()).toBeVisible();
});

test('Pro - Google Photos Gallery Player - Auto Play & Repeat On', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Pro – Google Photos Gallery Player – Auto Play & Repeat On' })).toBeVisible();
await expect(page.locator('iframe').nth(2).contentFrame().locator('div:nth-child(4) > .jx-imageset')).toBeVisible();
await expect(page.locator('iframe').nth(2).contentFrame().locator('div:nth-child(2) > .jx-imageset > div > img:nth-child(2)')).toBeVisible();
await expect(page.locator('iframe').nth(2).contentFrame().locator('div:nth-child(3) > .jx-imageset > div > img:nth-child(2)')).toBeVisible();
await expect(page.locator('iframe').nth(2).contentFrame().locator('div:nth-child(4) > .jx-imageset > div > img:nth-child(2)')).toBeVisible();
await expect(page.locator('iframe').nth(2).contentFrame().locator('img:nth-child(2)').first()).toBeVisible();
await expect(page.locator('iframe').nth(2).contentFrame().locator('div:nth-child(8) > .jx-svg-image > svg')).toBeVisible();
});

test('Single Photo - With Color', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Single Photo – With Color' })).toBeVisible();
await page.locator('iframe').nth(3).contentFrame().getByRole('img').nth(1).click();
await expect(page.locator('iframe').nth(3).contentFrame().getByRole('link', { name: 'New item by Md. Nahid Hasan' })).toBeVisible();
await page.locator('iframe').nth(3).contentFrame().locator('div:nth-child(7)').click();
});



});

0 comments on commit 767d9c3

Please sign in to comment.