-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore: Removing the feature flag for using Entity Item component from ADS templates #39093
base: release
Are you sure you want to change the base?
Changes from 23 commits
1682ff2
75b36b7
304b6d7
e068b56
edbba40
5c13d0e
345fd93
a5b55a1
a4551fa
e320299
672e056
bdc0de9
0182006
e864601
500002f
675a44e
dc62804
29ad43c
f1452fb
7e84052
521dc3e
73bfc57
76f393a
8acb96f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ describe( | |
cy.get(appPage.closeButton).closest("div").click({ force: true }); | ||
PageLeftPane.switchSegment(PagePaneSegment.UI); | ||
PageLeftPane.switchSegment(PagePaneSegment.Queries); | ||
cy.xpath(appPage.postApi).click({ force: true }); | ||
cy.get(appPage.postApi).click({ force: true }); | ||
cy.ResponseCheck("Test"); | ||
// cy.ResponseCheck("Task completed"); | ||
cy.ResponseCheck("[email protected]"); | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -52,13 +52,9 @@ export class EntityExplorer { | |||||||||||||||||||||||||
private assertHelper = ObjectsRegistry.AssertHelper; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
public _contextMenu = (entityNameinLeftSidebar: string) => | ||||||||||||||||||||||||||
"//div[text()='" + | ||||||||||||||||||||||||||
"//span[text()='" + | ||||||||||||||||||||||||||
entityNameinLeftSidebar + | ||||||||||||||||||||||||||
"']/ancestor::div[1]/following-sibling::div//button[contains(@class, 'entity-context-menu')]"; | ||||||||||||||||||||||||||
_entityNameInExplorer = (entityNameinLeftSidebar: string) => | ||||||||||||||||||||||||||
"//div[contains(@class, 't--entity-explorer')]//div[contains(@class, 't--entity-name')][text()='" + | ||||||||||||||||||||||||||
entityNameinLeftSidebar + | ||||||||||||||||||||||||||
"']"; | ||||||||||||||||||||||||||
"']/parent::div/following-sibling::div//button"; | ||||||||||||||||||||||||||
Comment on lines
54
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update selector to use data- attribute.* The selector uses XPath with hardcoded HTML tags. This is fragile and may break if the UI structure changes. Replace the XPath selector with a data-* attribute: - "//span[text()='" +
- entityNameinLeftSidebar +
- "']/parent::div/following-sibling::div//button";
+ `[data-cy="entity-context-menu-${entityNameinLeftSidebar}"]`; 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
private _visibleTextSpan = (spanText: string) => | ||||||||||||||||||||||||||
"//span[text()='" + spanText + "']"; | ||||||||||||||||||||||||||
|
@@ -72,6 +68,7 @@ export class EntityExplorer { | |||||||||||||||||||||||||
_widgetTagSuggestedWidgets = ".widget-tag-collapsible-suggested"; | ||||||||||||||||||||||||||
_widgetTagBuildingBlocks = ".widget-tag-collapsible-building-blocks"; | ||||||||||||||||||||||||||
_widgetSeeMoreButton = "[data-testid='t--explorer-ui-entity-tag-see-more']"; | ||||||||||||||||||||||||||
_entityAddButton = ".t--entity-add-btn"; | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use data-testid for entity add button selector. The selector uses a class which is more brittle than data attributes. Apply this diff: - _entityAddButton = ".t--entity-add-btn";
+ _entityAddButton = "[data-testid='t--entity-add-btn']"; 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
_entityName = ".t--entity-name"; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
public ActionContextMenuByEntityName({ | ||||||||||||||||||||||||||
|
@@ -103,7 +100,7 @@ export class EntityExplorer { | |||||||||||||||||||||||||
toastToValidate: toastToValidate, | ||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
if (entityType === EntityItems.Page) { | ||||||||||||||||||||||||||
if (entityType === EntityItems.Page && action !== "Rename") { | ||||||||||||||||||||||||||
PageList.HideList(); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
@@ -121,16 +118,18 @@ export class EntityExplorer { | |||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
public ValidateDuplicateMessageToolTip(tooltipText: string) { | ||||||||||||||||||||||||||
this.agHelper.AssertTooltip(tooltipText.concat(" is already being used.")); | ||||||||||||||||||||||||||
this.agHelper.AssertTooltip( | ||||||||||||||||||||||||||
tooltipText.concat(" is already being used or is a restricted keyword."), | ||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
public DeleteAllQueriesForDB(dsName: string) { | ||||||||||||||||||||||||||
AppSidebar.navigate(AppSidebarButton.Editor); | ||||||||||||||||||||||||||
PageLeftPane.switchSegment(PagePaneSegment.Queries); | ||||||||||||||||||||||||||
this.agHelper | ||||||||||||||||||||||||||
.GetElement(this._visibleTextSpan(dsName)) | ||||||||||||||||||||||||||
.parent() | ||||||||||||||||||||||||||
.siblings() | ||||||||||||||||||||||||||
.children() | ||||||||||||||||||||||||||
.each(($el: any) => { | ||||||||||||||||||||||||||
cy.wrap($el) | ||||||||||||||||||||||||||
.find(".t--entity-name") | ||||||||||||||||||||||||||
|
@@ -275,8 +274,9 @@ export class EntityExplorer { | |||||||||||||||||||||||||
action: "Rename", | ||||||||||||||||||||||||||
entityType, | ||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||
else cy.xpath(PageLeftPane.listItemSelector(entityName)).dblclick(); | ||||||||||||||||||||||||||
cy.xpath(this.locator._entityNameEditing(entityName)) | ||||||||||||||||||||||||||
else cy.get(this.locator._entityTestId(entityName)).dblclick(); | ||||||||||||||||||||||||||
cy.get(this.locator._entityNameEditing) | ||||||||||||||||||||||||||
.clear() | ||||||||||||||||||||||||||
.type(renameVal) | ||||||||||||||||||||||||||
.wait(500) | ||||||||||||||||||||||||||
.type("{enter}") | ||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use structured assertions instead of plain strings.
Direct string assertions should be replaced with more structured expectations.
📝 Committable suggestion