Skip to content

Commit

Permalink
Issue 30781 Content Search (#31071)
Browse files Browse the repository at this point in the history
### Proposed Changes
* Test Refactor to new test on content search
* New Tests

### Checklist
- [ ] Tests
  • Loading branch information
bryanboza authored Jan 7, 2025
1 parent a4fa1af commit 09a3547
Show file tree
Hide file tree
Showing 7 changed files with 748 additions and 912 deletions.
50 changes: 26 additions & 24 deletions e2e/dotcms-e2e-node/frontend/locators/globalLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,49 @@
* Locators for the iframes in the main page.
*/
export const iFramesLocators = {
main_iframe: 'iframe[name="detailFrame"]',
dot_iframe: 'dot-iframe-dialog iframe[name="detailFrame"]',
wysiwygFrame:
'iframe[title="Rich Text Area\\. Press ALT-F9 for menu\\. Press ALT-F10 for toolbar\\. Press ALT-0 for help"]',
dataTestId: '[data-testid="iframe"]',
};
main_iframe: 'iframe[name="detailFrame"]',
dot_iframe: 'dot-iframe-dialog iframe[name="detailFrame"]',
wysiwygFrame: 'iframe[title="Rich Text Area\\. Press ALT-F9 for menu\\. Press ALT-F10 for toolbar\\. Press ALT-0 for help"]',
dataTestId: '[data-testid="iframe"]',
dot_edit_iframe: 'dot-edit-contentlet iframe[name="detailFrame"]',
}

/**
* Locators for the login functionality.
*/
export const loginLocators = {
userNameInput: 'input[id="inputtext"]',
passwordInput: 'input[id="password"]',
loginBtn: "submitButton",
};
userNameInput: 'input[id="inputtext"]',
passwordInput: 'input[id="password"]',
loginBtn: 'submitButton'
}

/**
* Locators for the Add Content functionality.
*/
export const addContent = {
addBtn: "#dijit_form_DropDownButton_0",
addNewContentSubMenu: "Add New Content",
addNewMenuLabel: "▼",
};
addBtn: '#dijit_form_DropDownButton_0',
addNewContentSubMenu: 'Add New Content',
addNewMenuLabel: '▼'
}

/**
* Locators for the Rich Text functionality.
*/
export const contentGeneric = {
locator: "articleContent (Generic)",
label: "Content (Generic)",
};
locator: "articleContent (Generic)",
label: "Content (Generic)"
}

export const fileAsset = {
locator: "attach_fileFile Asset",
label: "File Asset",
};
locator: "attach_fileFile Asset",
label: "File Asset"
}

export const pageAsset = {
locator: "descriptionPage",
label: "Page",
};
locator: "descriptionPage",
label: "Page"
}

export {
} from './navigation/menuLocators';

export {} from "./navigation/menuLocators";
61 changes: 28 additions & 33 deletions e2e/dotcms-e2e-node/frontend/locators/navigation/menuLocators.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
import { Page, Locator } from "@playwright/test";
import {Page, Locator} from '@playwright/test';

export class GroupEntriesLocators {
readonly SITE: Locator;
readonly CONTENT: Locator;
readonly SCHEMA: Locator;

constructor(page: Page) {
this.SITE = page.getByText("Site", { exact: true });
this.CONTENT = page
.getByRole("complementary")
.getByText("Content", { exact: true });
this.SCHEMA = page.getByText("Schema");
}
readonly SITE: Locator;
readonly CONTENT: Locator;
readonly SCHEMA: Locator;

constructor(page: Page) {
this.SITE = page.getByText('Site', {exact: true});
this.CONTENT = page.getByRole('complementary').getByText('Content', {exact: true});
this.SCHEMA = page.getByText('Schema');

}
}

/**
* Locators for the tools in the menu
*/
export class ToolEntriesLocators {
readonly SEARCH_ALL: Locator;
readonly CONTENT_TYPES: Locator;
readonly CATEGORIES: Locator;

constructor(page: Page) {
this.SEARCH_ALL = page.getByRole("link", { name: "Search All" });
this.CONTENT_TYPES = page.getByRole("link", { name: "Content Types" });
this.CATEGORIES = page.getByRole("link", { name: "Categories" });
}
readonly SEARCH_ALL: Locator;
readonly CONTENT_TYPES: Locator;
readonly CATEGORIES: Locator;


constructor(page: Page) {
this.SEARCH_ALL = page.getByRole('link', {name: 'Search All'});
this.CONTENT_TYPES = page.getByRole('link', {name: 'Content Types'});
this.CATEGORIES = page.getByRole('link', { name: 'Categories' });
}
}

/**
* Locators for the menu entries
*/
export class MenuEntriesLocators {
readonly EXPAND: Locator;
readonly COLLAPSE: Locator;
readonly EXPAND: Locator;
readonly COLLAPSE: Locator;

constructor(page: Page) {
/*this.EXPAND = page.locator('button[ng-reflect-ng-class="[object Object]"]').first();
constructor(page: Page) {
this.EXPAND = page.getByRole('button', { name: '' });
this.COLLAPSE = page.locator('button[ng-reflect-ng-class="[object Object]"]').first();
this.EXPAND = page.locator('button[ng-reflect-ng-class="[object Object]"]');
this.COLLAPSE = page.locator('button[ng-reflect-ng-class="[object Object]"]');*/
this.EXPAND = page.getByRole("button", { name: "" });
this.COLLAPSE = page
.locator('button[ng-reflect-ng-class="[object Object]"]')
.first();
}
}

}
}
61 changes: 33 additions & 28 deletions e2e/dotcms-e2e-node/frontend/tests/contentSearch/contentData.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@

/**
* Content to add a Rich Text content
*/
export const genericContent1 = {
title: "Automation Test",
body: "This is a sample content",
newTitle: "Automation Test edited",
newBody: "This is a sample content edited",
};
title: "Automation Test",
body: "This is a sample content",
newTitle : "Automation Test edited",
newBody : "This is a sample content edited"
}

/**
* Content actions text content locators
*/
export const contentProperties = {
language: "English (US)",
publishWfAction: "Publish",
unpublishWfAction: "Unpublish",
unlockWfAction: "Unlock",
archiveWfAction: "Archive",
deleteWfAction: "Delete",
};
language: "English (US)",
publishWfAction: "Publish",
unpublishWfAction: "Unpublish",
unlockWfAction: "Unlock",
archiveWfAction: "Archive",
deleteWfAction: "Delete"
}

export const fileAssetContent = {
title: "File Asset title",
body: "This is a sample file asset content",
fromURL:
"https://upload.wikimedia.org/wikipedia/commons/0/03/DotCMS-logo.svg",
newFileName: "New file asset.txt",
newFileText: "This is a new file asset content",
host: "default",
};
title: "File Asset title",
body: "This is a sample file asset content",
fromURL:"https://upload.wikimedia.org/wikipedia/commons/0/03/DotCMS-logo.svg",
newFileName:"New file asset.txt",
newFileText:"This is a new file asset content",
newFileTextEdited:"Validate you are able to edit text on binary fields",
host:"default"
}

export const pageAssetContent = {
title: "PageAsset1",
host: "default",
template: "System Template",
friendlyName: "friendlyName-test",
showOnMenu: true,
sortOrder: "1",
cacheTTL: 0,
};
title: "PageAsset1",
host: "default",
template: "System Template",
friendlyName: "friendlyName-test",
showOnMenu: true,
sortOrder: "1",
cacheTTL: 0,
}




Loading

0 comments on commit 09a3547

Please sign in to comment.