-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nahidthenh/nahid
Google Photos TestCases for Elementor & Gutenberg
- Loading branch information
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
|
||
|
||
|
||
}); | ||
|