Skip to content
Open
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/1-PDF-password-protect-pdf.pdf
Binary file not shown.
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.
Binary file added nala/assets/lightroom.jpg
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/lightroom/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/lightroom/unitywidget.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
FeatureName: 'Lr Unity Widget',
features: [
{
tcid: '0',
name: '@lr-unityUI',
path: '/drafts/nala/unity/lightroom',
data: {
CTATxt: 'Upload your photo',
fileFormatTxt: 'File must be JPEG or JPG and up to 40MB',
dropZoneTxt: 'Drag and drop an image to try it today.',
},
tags: '@lr-unity @smoke @regression @unity',
},

{
tcid: '1',
name: '@lr-unityFileUpload',
path: '/drafts/nala/unity/lightroom',
tags: '@lr-unity @smoke @regression @unity',
},

{
tcid: '2',
name: '@lr-unityLrProductpage',
path: '/drafts/nala/unity/lightroom',
url: 'f0.lightroom.adobe.com',
tags: '@lr-unity @smoke @regression @unity',
},
],
};
76 changes: 76 additions & 0 deletions nala/features/lightroom/unitywidget.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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/lightroom.jpg');
console.log(__dirname);

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

test.describe('Unity Widget Lr 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 Lr 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 Lr 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 lightroom 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('jpg image file upload and splash screen display', async () => {
const fileInput = page.locator('//input[@type="file" and @id="file-upload"]').nth(0);
console.log('fileinput', fileInput);
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 Lr 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('jpg 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);
});
});
});
7 changes: 7 additions & 0 deletions nala/features/password-protect-pdf/password-protect.page.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import AcrobatWidget from '../../widget/acrobat-widget.cjs';

export default class PasswordProtect extends AcrobatWidget {
constructor(page, nth = 0) {
super(page, '.protect-pdf.unity-enabled', nth);
}
}
16 changes: 16 additions & 0 deletions nala/features/password-protect-pdf/password-protect.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
FeatureName: 'Passowrd Protect PDF',
features: [
{
tcid: '0',
name: '@password-protect',
path: '/drafts/nala/acrobat/online/test/password-protect-pdf',
data: {
verbTitle: 'Adobe Acrobat',
verbHeading: 'Password protect a PDF',
verbCopy: 'Drag and drop a PDF, then add a password to protect your file.',
},
tags: '@password-protect-pdf @smoke @regression @unity',
},
],
};
62 changes: 62 additions & 0 deletions nala/features/password-protect-pdf/password-protect.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import path from 'path';
import { expect, test } from '@playwright/test';
import { features } from './password-protect.spec.cjs';
import PasswordProtect from './password-protect.page.cjs';

const pdfFilePath = path.resolve(__dirname, '../../assets/1-PDF-password-protect-pdf.pdf');

let passwordProtectPdf;

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

test.describe('Unity Password Protect PDF test suite', () => {
test.beforeEach(async ({ page }) => {
passwordProtectPdf = new PasswordProtect(page);
});

// Test 0 : Password Protect PDF
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[0].path}${unityLibs}`);
const { data } = features[0];

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

await test.step('step-2: Verify Password Protect content/specs', async () => {
await expect(await passwordProtectPdf.widget).toBeVisible();
await expect(await passwordProtectPdf.dropZone).toBeVisible();
await expect(await passwordProtectPdf.verbImage).toBeVisible();
await expect(await passwordProtectPdf.acrobatIcon).toBeVisible();
const actualText = await passwordProtectPdf.verbHeader.textContent();
expect(actualText.trim()).toBe(data.verbHeading);
await expect(await passwordProtectPdf.verbTitle).toContainText(data.verbTitle);
await expect(await passwordProtectPdf.verbCopy).toContainText(data.verbCopy);
});

await test.step('step-3: Upload a sample PDF file', async () => {
// upload and wait for some page change indicator (like a new element or URL change)
const fileInput = page.locator('input[type="file"]#file-upload');
await page.waitForTimeout(10000);
await fileInput.setInputFiles(pdfFilePath);
await page.waitForTimeout(10000);

// Verify the URL parameters
const currentUrl = page.url();
console.log(`[Post-upload URL]: ${currentUrl}`);
const urlObj = new URL(currentUrl);
expect(urlObj.searchParams.get('x_api_client_id')).toBe('unity');
expect(urlObj.searchParams.get('x_api_client_location')).toBe('protect-pdf');
expect(urlObj.searchParams.get('user')).toBe('frictionless_new_user');
expect(urlObj.searchParams.get('attempts')).toBe('1st');
console.log({
x_api_client_id: urlObj.searchParams.get('x_api_client_id'),
x_api_client_location: urlObj.searchParams.get('x_api_client_location'),
user: urlObj.searchParams.get('user'),
attempts: urlObj.searchParams.get('attempts'),
});
});
});
});
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