Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image list #459

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions features/express/image-list.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
FeatureName: 'image-list block',
features: [
{
tcid: '0',
name: '@image-list-xs Image List XS Variant',
path: '/drafts/nala/blocks/image-list-xs',
tags: '@image-list @smoke @regression',
},

{
tcid: '1',
name: '@image-list-s Image List S Variant',
path: '/drafts/nala/blocks/image-list-s',
tags: '@image-list @smoke @regression',
},

{
tcid: '2',
name: '@image-list-m Image List M Variant',
path: '/drafts/nala/blocks/image-list-m',
tags: '@image-list @smoke @regression',
},

{
tcid: '3',
name: '@image-list-l Image List L Variant',
path: '/drafts/nala/blocks/image-list-l',
tags: '@image-list @smoke @regression',
},

{
tcid: '4',
name: '@image-list-xl Image List XL Variant',
path: '/drafts/nala/blocks/image-list-xl',
tags: '@image-list @smoke @regression',
},
],
};
10 changes: 10 additions & 0 deletions selectors/express/image-list.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default class ckgLinkList {
constructor(page) {
this.page = page;
this.imageList = page.locator('.image-list');
this.imageListSmall = page.locator('.image-list.s');
this.imageListXSmall = page.locator('.image-list.xs');
this.imageListLarge = page.locator('.image-list.l');
this.imageListXLarge = page.locator('.image-list.xl');
}
}
124 changes: 124 additions & 0 deletions tests/express/image-list.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/* eslint-disable no-plusplus */
import { expect, test } from '@playwright/test';
import { features } from '../../features/express/image-list.spec.js';
import ImageList from '../../selectors/express/image-list.page.js';

let imageList;
const prodHomePage = 'https://www.adobe.com/express/';

test.describe('Image List Block Test Suite', () => {
// before each test block
test.beforeEach(async ({ page }) => {
imageList = new ImageList(page);
});

test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
console.info(`${baseURL}${features[0].path}`);

await test.step('Go to Image List block test page', async () => {
await page.goto(`${baseURL}${features[0].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[0].path}`);
await page.waitForTimeout(3000);
});

await test.step('Verify block displayed ', async () => {
await page.waitForLoadState();
await expect(imageList.imageListXSmall).toBeVisible();
});

await test.step('On click, goes to homepage ', async () => {
await page.waitForLoadState();
await imageList.imageListXSmall.click();
await expect(page).toHaveURL(`${prodHomePage}`);
});
});

test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => {
console.info(`${baseURL}${features[1].path}`);

await test.step('Go to Image List block test page', async () => {
await page.goto(`${baseURL}${features[1].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[1].path}`);
await page.waitForTimeout(3000);
});

await test.step('Verify block displayed ', async () => {
await page.waitForLoadState();
await expect(imageList.imageListSmall).toBeVisible();
});

await test.step('On click, goes to homepage ', async () => {
await page.waitForLoadState();
await imageList.imageListSmall.click();
await expect(page).toHaveURL(`${prodHomePage}`);
});
});

test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => {
console.info(`${baseURL}${features[2].path}`);

await test.step('Go to Image List block test page', async () => {
await page.goto(`${baseURL}${features[2].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[2].path}`);
await page.waitForTimeout(3000);
});

await test.step('Verify block displayed ', async () => {
await page.waitForLoadState();
await expect(imageList.imageList).toBeVisible();
});

await test.step('On click, goes to homepage ', async () => {
await page.waitForLoadState();
await imageList.imageList.click();
await expect(page).toHaveURL(`${prodHomePage}`);
});
});

test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => {
console.info(`${baseURL}${features[3].path}`);

await test.step('Go to Image List block test page', async () => {
await page.goto(`${baseURL}${features[3].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[3].path}`);
await page.waitForTimeout(3000);
});

await test.step('Verify block displayed ', async () => {
await page.waitForLoadState();
await expect(imageList.imageListLarge).toBeVisible();
});

await test.step('On click, goes to homepage ', async () => {
await page.waitForLoadState();
await imageList.imageListLarge.click();
await expect(page).toHaveURL(`${prodHomePage}`);
});
});

test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => {
console.info(`${baseURL}${features[4].path}`);

await test.step('Go to Image List block test page', async () => {
await page.goto(`${baseURL}${features[4].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[4].path}`);
await page.waitForTimeout(3000);
});

await test.step('Verify block displayed ', async () => {
await page.waitForLoadState();
await expect(imageList.imageListXLarge).toBeVisible();
});

await test.step('On click, goes to homepage ', async () => {
await page.waitForLoadState();
await imageList.imageListXLarge.click();
await expect(page).toHaveURL(`${prodHomePage}`);
});
});
});
Loading