Skip to content

Commit

Permalink
fixing remaining tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitakinger committed Feb 12, 2025
1 parent 521dc3e commit 73bfc57
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ describe("Check Page Actions Menu", {}, function () {
PageList.ShowList();
agHelper.AssertAttribute(
locators._entityTestId("NewPage Copy"),
"disabled",
"disabled",
"data-disabled",
"true",
);
PageList.DeletePage("NewPage Copy");
PageList.assertAbsence("NewPage Copy");
Expand Down Expand Up @@ -92,8 +92,8 @@ describe("Check Page Actions Menu", {}, function () {
PageList.ShowList();
agHelper.AssertAttribute(
locators._entityTestId("Page2 Copy"),
"disabled",
"disabled",
"data-disabled",
"true",
);
PageList.DeletePage("Page2 Copy");
PageList.assertAbsence("Page2 Copy");
Expand All @@ -113,8 +113,8 @@ describe("Check Page Actions Menu", {}, function () {
PageList.ShowList();
agHelper.AssertAttribute(
locators._entityTestId("HomePage Copy"),
"disabled",
"disabled",
"data-disabled",
"true",
);
PageList.DeletePage("HomePage Copy");
PageList.assertAbsence("HomePage Copy");
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/locators/CMSApplocators.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
confirmButton: "span:contains('Confirm')",
closeButton: "span:contains('Close')",
datasourcesbutton: "//div[text()='Datasources']",
postApi: "//span[text()='send_mail']",
postApi: "[data-testid='t--ide-tab-send_mail'",
deleteButton: "//span[text()='Delete Proposal']",
deleteTaskText: "//span[text()='Delete this task']",
};
2 changes: 1 addition & 1 deletion app/client/cypress/locators/apiWidgetslocator.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"searchApi": ".t--sidebar input[type=text]",
"createapi": ".t--createBlankApiCard",
"createAuthApiDatasource": ".t--createAuthApiDatasource",
"popover": "//button[contains(@class, 'entity-context-menu')]",
"popover": "button[data-testid='t--more-action-trigger']",
"moveTo": ".single-select >div:contains('Move to')",
"copyTo": ".single-select >div:contains('Copy to page')",
"home": ".single-select >div:contains('Page1')",
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/support/ApiCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Cypress.Commands.add("validateMessage", (value) => {
});

Cypress.Commands.add("DeleteWidgetFromSideBar", () => {
cy.xpath(apiwidget.popover).last().click({ force: true });
cy.get(apiwidget.popover).last().click({ force: true });
cy.get(apiwidget.delete).click({ force: true });
cy.wait("@updateLayout").should(
"have.nested.property",
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/support/Pages/AggregateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ export class AggregateHelper {

if (value === "") return element;

return element.wait(100).clear({ force: true }).type(value, {
return element.wait(100).type(value, {
parseSpecialCharSequences: parseSpecialCharSeq,
delay: delay,
force: true,
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/support/Pages/EntityExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class EntityExplorer {
action: "Rename",
entityType,
});
else cy.xpath(PageLeftPane.listItemSelector(entityName)).dblclick();
else cy.get(this.locator._entityTestId(entityName)).dblclick();
cy.get(this.locator._entityNameEditing)
.clear()
.type(renameVal)
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/support/Pages/IDE/ListView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ObjectsRegistry } from "../../Objects/Registry";
class ListView {
public locators = {
list: "[data-testid='t--ide-list']",
listItem: "[data-testid='t--ide-list-item']",
listItem: ".t--ide-list-item",
addItem: "[data-testid='t--add-item']",
};

Expand Down
2 changes: 1 addition & 1 deletion app/client/packages/design-system/ads/src/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function ListItem(props: ListItemProps) {

return (
<StyledListItem
className={clsx(ListItemClassName, props.className)}
className={clsx(ListItemClassName, props.className, "t--ide-list-item")}
data-disabled={props.isDisabled || false}
data-isblockdescription={isBlockDescription}
data-rightcontrolvisibility={rightControlVisibility}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const EditableEntityName = (props: EditableEntityNameProps) => {
paddingBottom: "4px",
top: "-5px",
},
placeholder: "Name",
}),
[handleKeyUp, handleTitleChange, inputTestId],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const EntityGroup = <T,>({
group.renderList(item)
) : (
<ListItem
dataTestId={`t--entity-item-${(item as ListItemProps)?.title}`}
key={(item as ListItemProps)?.title || `item-${index}`}
{...(item as ListItemProps)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const EntityItem = (props: EntityItemProps) => {
{...rest}
className={clx("t--entity-item", props.className)}
customTitleComponent={customTitle}
data-testid={`t--entity-item-${props.title}`}
dataTestId={`t--entity-item-${props.title}`}
id={"entity-" + props.id}
rightControl={rightControl}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ export function EntityListTree(props: EntityListTreeProps) {
<CollapseSpacer />
)}
<PaddingOverrider>
<EntityItem
{...item}
dataTestId={`t--entity-item-${item.title}`}
/>
<EntityItem {...item} />
</PaddingOverrider>
</EntityItemWrapper>
{item.children && item.isExpanded ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export const JSEntityItem = ({ item }: { item: EntityItemProps }) => {
return (
<EntityItem
className={`t--jsaction ${canEdit ? "editable" : ""}`}
dataTestId={`t--entity-item-${jsAction.name}`}
id={jsAction.id}
isSelected={activeActionBaseId === item.key}
key={jsAction.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export const QueryEntityItem = ({ item }: { item: EntityItemProps }) => {
return (
<EntityItem
className="action t--action-entity"
dataTestId={`t--entity-item-${action.name}`}
id={action.id}
isSelected={activeActionBaseId === item.key}
key={action.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
createMessage,
} from "ee/constants/messages";
import { useDeleteWidget } from "./hooks/useDeleteWidget";
import { EntityClassNames } from "pages/Editor/Explorer/Entity";

export const WidgetContextMenu = (props: {
widgetId: string;
Expand Down Expand Up @@ -93,7 +94,13 @@ export const WidgetContextMenu = (props: {
startIcon="more-2-fill"
/>
</MenuTrigger>
<MenuContent align="start" key={widgetId} side="right" width="300px">
<MenuContent
align="start"
className={`t--entity-context-menu ${EntityClassNames.CONTEXT_MENU_CONTENT}`}
key={widgetId}
side="right"
width="300px"
>
{menuContent}
</MenuContent>
</Menu>
Expand Down

0 comments on commit 73bfc57

Please sign in to comment.