Skip to content
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
Binary file added nala/assets/guddy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions nala/features/photoshop/unitywidget1/unitywidget.page.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default class psUnityWidget {
constructor(page) {
this.page = page;
this.unityWidgetContainer = page.locator('.upload.upload-block.con-block.unity-enabled');
this.unityVideo = this.unityWidgetContainer.locator('.video-container.video-holder').nth(0);
this.dropZone = this.unityWidgetContainer.locator('.drop-zone-container').nth(0);
this.dropZoneText = this.dropZone.locator('//div[@class="drop-zone-container"]/div[@class="drop-zone"]/p[1]').nth(2);
this.dropZoneFileText = this.dropZone.locator('//div[@class="drop-zone-container"]/div[@class="drop-zone"]/p[2]').nth(2);
this.fileUploadCta = this.unityWidgetContainer.locator('.con-button.blue.action-button.button-xl').nth(2);
this.legelTerms = this.unityWidgetContainer.locator('//a[@daa-ll="Terms of Use-11--"]');
this.privacyPolicy = this.unityWidgetContainer.locator('//a[@daa-ll="Privacy Policy-12--"]');
this.splashScreen = this.unityWidgetContainer.locator('//div[@class="fragment splash -loader show" and @style="display: none"]');
}
}
31 changes: 31 additions & 0 deletions nala/features/photoshop/unitywidget1/unitywidget.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
FeatureName: 'PS Unity Widget',
features: [
{
tcid: '0',
name: '@ps-unityUI',
path: '/drafts/nala/unity/remove-background?georouting=off',
data: {
CTATxt: 'Upload your photo',
fileFormatTxt: 'File must be JPEG, JPG or PNG and up to 40MB',
dropZoneTxt: 'Drag and drop an image to try it today.',
},
tags: '@ps-unity @smoke @regression @unity',
},

{
tcid: '1',
name: '@ps-unityFileUpload',
path: '/drafts/nala/unity/remove-background?georouting=off',
tags: '@ps-unity @smoke @regression @unity',
},

{
tcid: '2',
name: '@ps-unityPSProductpage',
path: '/drafts/nala/unity/remove-background?georouting=off',
url: 'stage.try.photoshop.adobe.com',
tags: '@ps-unity @smoke @regression @unity',
},
],
};
75 changes: 75 additions & 0 deletions nala/features/photoshop/unitywidget1/unitywidget.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import path from 'path';
import { expect, test } from '@playwright/test';
import { features } from './unitywidget.spec.cjs';
import UnityWidget from './unitywidget.page.cjs';

const imageFilePath = path.resolve(__dirname, '../../../assets/guddy.png');
console.log(__dirname);

let unityWidget;
const unityLibs = process.env.UNITY_LIBS || '';

test.describe('Unity Widget PS test suite', () => {
test.beforeEach(async ({ page }) => {
unityWidget = new UnityWidget(page);
await page.setViewportSize({ width: 1250, height: 850 });
await page.context().clearCookies();
});

// Test 0 : Unity Widget PS UI checks
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
const ccBaseURL = baseURL.replace('--dc--', '--cc--');
console.info(`[Test Page]: ${ccBaseURL}${features[0].path}${unityLibs}`);

await test.step('step-1: Go to Unity Widget PS test page', async () => {
await page.goto(`${ccBaseURL}${features[0].path}${unityLibs}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${ccBaseURL}${features[0].path}${unityLibs}`);
});

await test.step('step-2: Verify Unity Widget PS verb user interface', async () => {
await page.waitForTimeout(3000);
await expect(await unityWidget.unityWidgetContainer).toBeTruthy();
await expect(await unityWidget.unityVideo).toBeTruthy();
await expect(await unityWidget.dropZone).toBeTruthy();
await expect(await unityWidget.dropZoneText).toBeTruthy();
});
});
// Test 1 : Unity Widget File Upload & splash screen display
test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => {
const ccBaseURL = baseURL.replace('--dc--', '--cc--');
console.info(`[Test Page]: ${ccBaseURL}${features[1].path}${unityLibs}`);

await test.step('check photoshop file upload', async () => {
await page.goto(`${ccBaseURL}${features[1].path}${unityLibs}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${ccBaseURL}${features[1].path}${unityLibs}`);
});
await test.step('png image file upload and splash screen display', async () => {
const fileInput = page.locator('//input[@type="file" and @id="file-upload"]').nth(0);
await page.waitForTimeout(10000);
await fileInput.setInputFiles(imageFilePath);
await page.waitForTimeout(3000);
await expect(unityWidget.splashScreen).toBeTruthy();
});
});
// Test 2 : Unity Widget user navigation to Photoshop Product Page
test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => {
const ccBaseURL = baseURL.replace('--dc--', '--cc--');
console.info(`[Test Page]: ${ccBaseURL}${features[2].path}${unityLibs}`);

await test.step('check user landing on PS product page post file upload', async () => {
await page.goto(`${ccBaseURL}${features[2].path}${unityLibs}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${ccBaseURL}${features[2].path}${unityLibs}`);
});
await test.step('png image file upload and user navigation to product page', async () => {
const fileInput = page.locator('//input[@type="file" and @id="file-upload"]').nth(0);
await page.waitForTimeout(10000);
await fileInput.setInputFiles(imageFilePath);
await page.waitForTimeout(10000);
const productPageUrl = await page.url();
expect(productPageUrl).toContain(features[2].url);
});
});
});
Loading
Loading