test: Deleting logo Management to execute from Open Source (#5682)

Deleting logo Management to execute from enterprise

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Removed Features**
	- Removed logo management test suite and associated page objects
- Eliminated methods for updating custom logo text and uploading logos
in management page

- **Impact**
- Logo management testing functionality has been completely removed from
the test suite
	- No current capability to test logo-related operations

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Shyam Panjiyar
2025-01-13 17:43:36 +05:30
committed by GitHub
parent 70db08e257
commit 340fec113c
3 changed files with 1 additions and 186 deletions
@@ -1,83 +0,0 @@
import { expect } from '@playwright/test';
export const path = require('path');
export
class LogoManagementPage {
constructor(page) {
this.page = page;
this.homeIcon = page.locator("[name ='home']");
this.managementMenuItem = page.locator('[data-test="menu-link-settings-item"]');
this.submitButton = page.locator('[data-test="dashboard-add-submit"]'); // Add appropriate data-test attribute
this.editLogoTextButton = page.locator('[data-test="settings_ent_logo_custom_text_edit_btn"]');
this.customLogoTextBox = page.locator('[data-test="settings_ent_logo_custom_text"]');
this.customLogoText = page.locator("[aria-label ='Custom Logo Text']");
this.saveButton = page.locator('[data-test="settings_ent_logo_custom_text_save_btn"]');
this.deleteLogoButton = page.locator('[data-test="setting_ent_custom_logo_img_delete_btn"]');
this.confirmDeleteButton = page.locator('[data-test="logs-search-bar-confirm-dialog-ok-btn"]');
this.fileUploadInput = page.locator('input[data-test="setting_ent_custom_logo_img_file_upload"]');
}
async navigateToManagement() {
await this.page.waitForSelector("[name ='home']");
await this.homeIcon.hover();
await this.page.waitForSelector('[data-test="menu-link-settings-item"]');
await this.managementMenuItem.click({ force: true });
}
async goToManagement() {
await this.managementMenuItem.click({ force: true });
await expect(this.page.getByRole('main')).toContainText('Management');
}
async managementPageDefaultMultiOrg() {
await this.page.locator('[data-test="navbar-organizations-select"]').getByText('arrow_drop_down').click();
await this.page.getByRole('option', { name: 'defaulttestmulti' }).locator('div').nth(2).click();
}
async managementPageURLValidation() {
await expect(this.page).toHaveURL(/defaulttestmulti/);
}
async managementURLValidation() {
await expect(this.page).toHaveURL(/settings/);
}
async clickSaveSubmit() {
await this.submitButton.waitFor({ state: 'visible' });
await this.submitButton.click({ force: true });
}
async updateCustomLogoText(text) {
const isVisible = await this.editLogoTextButton.isVisible();
if (isVisible) {
await this.page.locator('[data-test="settings_ent_logo_custom_text_edit_btn"]').click();
}
await expect(this.page.getByText('Unauthorized Access')).not.toBeVisible();
await this.customLogoTextBox.click();
await expect(this.page.getByText('Unauthorized Access')).not.toBeVisible();
await this.customLogoTextBox.fill(text);
await this.page.waitForSelector('[data-test="settings_ent_logo_custom_text_save_btn"]');
await this.saveButton.click({ force: true });
}
async uploadLogo(filePath) {
const isVisible = await this.deleteLogoButton.isVisible();
if (isVisible) {
await this.page.waitForSelector('[data-test="setting_ent_custom_logo_img_delete_btn"]');
await this.deleteLogoButton.click({ force: true });
await this.page.waitForSelector('[data-test="logs-search-bar-confirm-dialog-ok-btn"]');
await this.confirmDeleteButton.click({ force: true });
}
await this.page.goto(process.env["ZO_BASE_URL"] + "/web/settings/general?org_identifier=default");
await this.page.waitForSelector('[data-test="setting_ent_custom_logo_img_file_upload"]');
await this.page.setInputFiles('input[ data-test="setting_ent_custom_logo_img_file_upload"]', filePath);
await expect(this.page.getByText("Logo updated successfully")).toBeVisible({
timeout: 30000,
});
}
}
+1 -42
View File
@@ -49,46 +49,5 @@ export
async managementURLValidation() {
await expect(this.page).toHaveURL(/settings/);
}
async updateCustomLogoText(text) {
await this.submitButton.waitFor({ state: 'visible' });
await this.submitButton.click({ force: true });
await this.page.waitForResponse(
(response) =>
response.url().includes("/api/default/settings") && response.status() === 200
);
await this.page.getByText('Custom Logo Text').click();
await this.page.locator('[data-test="settings_ent_logo_custom_text_edit_btn"]').click();
await this.page.locator('[data-test="settings_ent_logo_custom_text"]').click();
await this.page.locator('[data-test="settings_ent_logo_custom_text"]').fill('logo Autom');
await this.customLogoText.click({ force: true });
await this.customLogoText.fill(text);
await this.page.waitForSelector('[data-test="settings_ent_logo_custom_text_save_btn"]');
await this.saveButton.click({ force: true });
await this.page.waitForResponse(
(response) =>
response.url().includes("/api/default/settings/logo/text") && response.status() === 200
);
}
async uploadLogo(filePath) {
const isVisible = await this.deleteLogoButton.isVisible();
if (isVisible) {
await this.page.waitForSelector('[data-test="setting_ent_custom_logo_img_delete_btn"]');
await this.deleteLogoButton.click({ force: true });
await this.page.waitForSelector('[data-test="logs-search-bar-confirm-dialog-ok-btn"]');
await this.confirmDeleteButton.click({ force: true });
}
//  await this.fileUploadInput.setInputFiles(filePath);
await this.page.setInputFiles('input[ data-test="setting_ent_custom_logo_img_file_upload"]', filePath);
await expect(this.page.getByText("Logo updated successfully")).toBeVisible({
timeout: 30000,
});
}
}
}
@@ -1,61 +0,0 @@
import { test, expect } from "./baseFixtures";
import { LogoManagementPage } from "../pages/logoManagementPage.js";
import { LoginPage } from '../pages/loginPage.js';
const path = require('path');
// Function to generate a random 5-character alphabetic name
function generateRandomLogoName() {
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
let randomName = '';
for (let i = 0; i < 5; i++) {
randomName += alphabet.charAt(Math.floor(Math.random() * alphabet.length));
}
return randomName;
}
test('Logo Upload on Management ', async ({ page }) => {
// Create page object instances
const filePath = path.resolve(__dirname, './attachment/imagesAuto.png');
const loginPage = new LoginPage(page);
const logoManagementPage = new LogoManagementPage(page);
// Example usage in Playwright POM
const logoName = generateRandomLogoName();
console.log(`Generated logo name: ${logoName}`);
// Step 1: Navigate to the application and login
await page.goto(process.env["ZO_BASE_URL"]);
// console.log ('URL Opened')
await loginPage.gotoLoginPage();
// await loginPage.loginAsInternalUser();
await loginPage.login();
// Step 2: Navigate to Logs Page
await logoManagementPage.navigateToManagement();
await logoManagementPage.clickSaveSubmit();
await logoManagementPage.updateCustomLogoText(logoName );
console.log(`Uploading file from path: ${filePath}`);
//
await logoManagementPage.uploadLogo(filePath);
await page.waitForTimeout(5000); // Adjust or remove as needed
});