8000 [NALA]UI Automation tests scripts for batch 2A verbs by skumar09 · Pull Request #491 · adobecom/unity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[NALA]UI Automation tests scripts for batch 2A verbs #491

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

Merged
merged 2 commits into from
Jul 8, 2025
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/1-Excel-excel-pdf.xlsx
Binary file not shown.
Binary file added nala/assets/1-JPG-jpg-pdf.jpg
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/1-PDF-pdf-excel.pdf
Binary file not shown.
Binary file added nala/assets/1-PDF-pdf-jpg.pdf
Binary file not shown.
Binary file added nala/assets/1-PDF-pdf-ppt.pdf
Binary file not shown.
Binary file added nala/assets/1-PDF-pdf-word.pdf
Binary file not shown.
Binary file added nala/assets/1-PNG-png-pdf.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/1-PPT-ppt-pdf.pptx
Binary file not shown.
Binary file added nala/assets/1-WORD-word-pdf.doc
Binary file not shown.
2 changes: 1 addition & 1 deletion nala/features/add-pdf/add-pdf-number.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
data: {
verbTitle: 'Adobe Acrobat',
verbHeading: 'Add page numbers to a PDF',
verbCopy: 'Drag and drop a PDF, then add a password to protect your file.',
verbCopy: 'Drag and drop a PDF to add page numbers.',
},
tags: '@add-pdf @smoke @regression @unity',
},
Expand Down
7 changes: 7 additions & 0 deletions nala/features/excel-pdf/excel-to-pdf.page.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import AcrobatWidget from '../../widget/acrobat-widget.cjs';

e 9E7A xport default class ExcelToPdf extends AcrobatWidget {
constructor(page, nth = 0) {
super(page, '.excel-to-pdf.unity-enabled', nth);
}
}
16 changes: 16 additions & 0 deletions nala/features/excel-pdf/excel-to-pdf.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
FeatureName: 'Excel to PDF',
features: [
{
tcid: '0',
name: '@excel-pdf',
path: '/drafts/nala/acrobat/online/test/excel-to-pdf',
data: {
verbTitle: 'Adobe Acrobat',
verbHeading: 'Excel to PDF converter',
verbCopy: 'Drag and drop a Microsoft Excel file (XLSX or XLS) to use our Excel to PDF converter.',
},
tags: '@excel-to-pdf @smoke @regression @unity',
},
],
};
62 changes: 62 additions & 0 deletions nala/features/excel-pdf/excel-to-pdf.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 './excel-to-pdf.spec.cjs';
import ExcelToPdf from './excel-to-pdf.page.cjs';

const excelFilePath = path.resolve(__dirname, '../../assets/1-Excel-excel-pdf.xlsx');

let excelToPdf;

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

test.describe('Unity EXCEL to PDF test suite', () => {
test.beforeEach(async ({ page }) => {
excelToPdf = new ExcelToPdf(page);
});

// Test 0 : EXCEL to 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 EXCEL to 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 EXCEL to PDF content/specs', async () => {
await expect(await excelToPdf.widget).toBeVisible();
await expect(await excelToPdf.dropZone).toBeVisible();
await expect(await excelToPdf.verbImage).toBeVisible();
await expect(await excelToPdf.acrobatIcon).toBeVisible();
const actualText = await excelToPdf.verbHeader.textContent();
expect(actualText.trim()).toBe(data.verbHeading);
await expect(await excelToPdf.verbTitle).toContainText(data.verbTitle);
await expect(await excelToPdf.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(excelFilePath);
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('excel-to-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'),
});
});
});
});
7 changes: 7 additions & 0 deletions nala/features/jpg-pdf/jpg-to-pdf.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 PdfToJpg extends AcrobatWidget {
constructor(page, nth = 0) {
super(page, '.jpg-to-pdf.unity-enabled', nth);
}
}
16 changes: 16 additions & 0 deletions nala/features/jpg-pdf/jpg-to-pdf.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
FeatureName: 'JPG to PDF',
features: [
{
tcid: '0',
name: '@jpg-pdf',
path: '/drafts/nala/acrobat/online/test/jpg-to-pdf',
data: {
verbTitle: 'Adobe Acrobat',
verbHeading: 'JPG to PDF Converter',
verbCopy: 'Drag and drop an image file (JPG, PNG, BMP, and more) to use our PDF converter.',
},
tags: '@jpg-to-pdf @smoke @regression @unity',
},
],
};
62 changes: 62 additions & 0 deletions nala/features/jpg-pdf/jpg-to-pdf.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 './jpg-to-pdf.spec.cjs';
import JpgToPdf from './jpg-to-pdf.page.cjs';

const jpgFilePath = path.resolve(__dirname, '../../assets/1-JPG-jpg-pdf.jpg');

let jpgToPdf;

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

test.describe('Unity JPG to PDF test suite', () => {
test.beforeEach(async ({ page }) => {
jpgToPdf = new JpgToPdf(page);
});

// Test 0 : JPG to 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 JPG to 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 JPG to PDF content/specs', async () => {
await expect(await jpgToPdf.widget).toBeVisible();
await expect(await jpgToPdf.dropZone).toBeVisible();
await expect(await jpgToPdf.verbImage).toBeVisible();
await expect(await jpgToPdf.acrobatIcon).toBeVisible();
const actualText = await jpgToPdf.verbHeader.textContent();
expect(actualText.trim()).toBe(data.verbHeading);
await expect(await jpgToPdf.verbTitle).toContainText(data.verbTitle);
await expect(await jpgToPdf.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(jpgFilePath);
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('jpg-to-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'),
});
});
});
});
7 changes: 7 additions & 0 deletions nala/features/pdf-excel/pdf-to-excel.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 PdfToExcel extends AcrobatWidget {
constructor(page, nth = 0) {
super(page, '.pdf-to-excel.unity-enabled', nth);
}
}
16 changes: 16 additions & 0 deletions nala/features/pdf-excel/pdf-to-excel.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
FeatureName: 'Pdf to Excel',
features: [
{
tcid: '0',
name: '@pdf-excel',
path: '/drafts/nala/acrobat/online/test/pdf-to-excel',
data: {
verbTitle: 'Adobe Acrobat',
verbHeading: 'Convert PDF to Excel',
verbCopy: 'Drag and drop a PDF file to use our PDF to Microsoft Excel converter.',
},
tags: '@pdf-to-excel @smoke @regression @unity',
},
],
};
62 changes: 62 additions & 0 deletions nala/features/pdf-excel/pdf-to-excel.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 './pdf-to-excel.spec.cjs';
import PdfToExcel from './pdf-to-excel.page.cjs';

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

let pdfToExcel;

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

test.describe('Unity PDF to Excel test suite', () => {
test.beforeEach(async ({ page }) => {
pdfToExcel = new PdfToExcel(page);
});

// Test 0 : PDF to Excel
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 PDF to Excel page numbers 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 PDF to Excel content/specs', async () => {
await expect(await pdfToExcel.widget).toBeVisible();
await expect(await pdfToExcel.dropZone).toBeVisible();
await expect(await pdfToExcel.verbImage).toBeVisible();
await expect(await pdfToExcel.acrobatIcon).toBeVisible();
const actualText = await pdfToExcel.verbHeader.textContent();
expect(actualText.trim()).toBe(data.verbHeading);
await expect(await pdfToExcel.verbTitle).toContainText(data.verbTitle);
await expect(await pdfToExcel.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('pdf-to-excel');
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'),
});
});
});
});
7 changes: 7 additions & 0 deletions nala/features/pdf-jpg/pdf-to-jpg.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 PdfToJpg extends AcrobatWidget {
constructor(page, nth = 0) {
super(page, '.pdf-to-image.unity-enabled', nth);
}
}
16 changes: 16 additions & 0 deletions nala/features/pdf-jpg/pdf-to-jpg.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
FeatureName: 'PDF to JPG',
features: [
{
tcid: '0',
name: '@pdf-jpg',
path: '/drafts/nala/acrobat/online/test/pdf-to-jpg',
data: {
verbTitle: 'Adobe Acrobat',
verbHeading: 'Convert a PDF to JPG image',
verbCopy: 'Drag and drop a PDF, then convert to JPG, PNG or TIFF file formats.',
},
tags: '@pdf-to-jpg @smoke @regression @unity',
},
],
};
62 changes: 62 additions & 0 deletions nala/features/pdf-jpg/pdf-to-jpg.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 './pdf-to-jpg.spec.cjs';
import PdfToJpg from './pdf-to-jpg.page.cjs';

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

let pdfToJpg;

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

test.describe('Unity PDF to JPG test suite', () => {
test.beforeEach(async ({ page }) => {
pdfToJpg = new PdfToJpg(page);
});

// Test 0 : PDF to JPG
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 PDF to JPG 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 PDF to JPG content/specs', async () => {
await expect(await pdfToJpg.widget).toBeVisible();
await expect(await pdfToJpg.dropZone).toBeVisible();
await expect(await pdfToJpg.verbImage).toBeVisible();
await expect(await pdfToJpg.acrobatIcon).toBeVisible();
const actualText = await pdfToJpg.verbHeader.textContent();
expect(actualText.trim()).toBe(data.verbHeading);
await expect(await pdfToJpg.verbTitle).toContainText(data.verbTitle);
await expect(await pdfToJpg.verbCopy).toContainText(data.verbCopy);
10000 });

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('pdf-to-image');
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'),
});
});
});
});
7 changes: 7 additions & 0 deletions nala/features/pdf-ppt/pdf-to-ppt.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 PdfToPpt extends AcrobatWidget {
constructor(page, nth = 0) {
super(page, '.pdf-to-ppt.unity-enabled', nth);
}
}
16 changes: 16 additions & 0 deletions nala/features/pdf-ppt/pdf-to-ppt.spec.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
FeatureName: 'Pdf to PPT',
features: [
{
tcid: '0',
name: '@pdf-ppt',
path: '/drafts/nala/acrobat/online/test/pdf-to-ppt',
data: {
verbTitle: 'Adobe Acrobat',
verbHeading: 'Convert PDF to PPT',
verbCopy: 'Drag and drop a PDF file to use our PDF to Microsoft PowerPoint (PPT) converter.',
},
tags: '@pdf-to-ppt @smoke @regression @unity',
},
],
};
Loading
Loading
0