fix: number slider + category slider color spec fails (#32935)

Fixes a spec for slider and cateogry widget where it fails when changing
and asserting the background color

/ok-to-test tags="@tag.Slider"<!-- This is an auto-generated comment:
Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8873791272>
> Commit: b7111f115b691aeb6e6ccc2eceb30c476b91e3a3
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8873791272&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->







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

## Summary by CodeRabbit

- **Tests**
- Modified a specific test case to run exclusively, improving focus on
critical functionality during testing.
- **New Features**
- Enhanced color selection capabilities in the property control for a
more intuitive user interface.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
This commit is contained in:
Pawan Kumar 2024-04-29 11:31:46 +05:30 committed by GitHub
parent 45172ac8ae
commit 4f70c70701
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View File

@ -286,7 +286,10 @@ describe(
.GetWidgetCSSFrAttribute(locators._sliderThumb, "background-color")
.then((sliderColor) => {
agHelper
.GetWidgetCSSFrAttribute(propPane._fillColor, "background-color")
.GetWidgetCSSFrAttribute(
`${propPane._propertyControlSelectedColorButton("fillcolor")}`,
"background-color",
)
.then((newColor) => {
expect(sliderColor).to.eq(newColor);
});

View File

@ -377,7 +377,10 @@ describe("Number Slider spec", { tags: ["@tag.Widget", "@tag.Slider"] }, () => {
.GetWidgetCSSFrAttribute(locators._sliderThumb, "background-color")
.then((sliderColor) => {
agHelper
.GetWidgetCSSFrAttribute(propPane._fillColor, "background-color")
.GetWidgetCSSFrAttribute(
`${propPane._propertyControlSelectedColorButton("fillcolor")}`,
"background-color",
)
.then((newColor) => {
expect(sliderColor).to.eq(newColor);
});

View File

@ -139,6 +139,8 @@ export class PropertyPane {
_dropdownOptionSpan = ".t--dropdown-option span";
public _propertyControlColorPicker = (property: string) =>
`.t--property-control-${property} .bp3-input-group input`;
public _propertyControlSelectedColorButton = (property: string) =>
`.t--property-control-${property} ${this._fillColor}`;
_propertyText = ".bp3-ui-text span";
_paneTitle = ".t--property-pane-title";
_segmentedControl = (value: string) =>