Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ describe(
});

// to work on redesign of the test, commenting for now
it.skip("7. Verify colors, borders and shadows", () => {
it("7. Verify colors, borders and shadows", () => {
// Verify font color picker opens up
propPane.MoveToTab("Style");
agHelper.GetNClick(propPane._propertyControlColorPicker("accentcolor"));
Expand Down Expand Up @@ -220,11 +220,16 @@ describe(
// Border Color
propPane.SelectColorFromColorPicker("bordercolor", 13);
assertHelper.AssertNetworkStatus("@updateLayout");
agHelper.AssertCSS(
tabs._tabsWidgetStyle,
"border-color",
"rgb(185, 28, 28)",
);

agHelper
.GetWidgetCSSFrAttribute(propPane._borderColorCursor, "color")
.then((color) => {
agHelper
.GetWidgetCSSFrAttribute(locators._widgetBorder, "color", 1)
.then((bgcolor) => {
expect(color).to.eq(bgcolor);
});
});

agHelper.AssertAttribute(propPane._colorPickerInput, "type", "text", 2);
propPane.TogglePropertyState("bordercolor", "On", "");
Expand Down
1 change: 1 addition & 0 deletions app/client/cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,5 @@ export class CommonLocators {
_saveDatasource = `[data-testid='t--store-as-datasource']`;
_propertyCollapseBody = ".bp3-collapse-body";
_propertyCollapse = ".bp3-collapse";
_widgetBorder = ".t--draggable-tabswidget div div div";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Use data- attribute selector instead of CSS path*

The current selector .t--draggable-tabswidget div div div is fragile and depends on DOM structure. Consider:

  1. Using a data-* attribute for better resilience
  2. Making the property name more specific to tabs widget

Apply this diff:

-  _widgetBorder = ".t--draggable-tabswidget div div div";
+  _tabsWidgetBorder = "[data-testid='t--tabs-widget-border']";

Then add the corresponding data-testid attribute to the tabs widget border element.

Committable suggestion was skipped due to low confidence.

}
1 change: 1 addition & 0 deletions app/client/cypress/support/Pages/PropertyPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export class PropertyPane {
_dataIcon = (icon: string) => `[data-icon="${icon}"]`;
_iconDropdown = "[data-test-id='virtuoso-scroller']";
_dropdownControlError = "[data-testid='t---dropdown-control-error']";
_borderColorCursor = ".t--property-control-bordercolor .bp3-input-group div";

public OpenJsonFormFieldSettings(fieldName: string) {
this.agHelper.GetNClick(this._jsonFieldEdit(fieldName));
Expand Down