Skip to content

Commit

Permalink
chore: tests for wds button widget (#34242)
Browse files Browse the repository at this point in the history
/ok-to-test tags="@tag.Anvil"

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

- **New Features**
- Introduced test cases for Anvil Button Widgets, including Canvas,
Preview, and Deploy modes.

- **Bug Fixes**
- Updated CSS and HTML selectors for better element targeting and
testing reliability.

- **Style**
  - Improved styling logic for buttons in the InlineButtons component.

- **Chores**
  - Added `data-testid` attributes for better test targeting.
- Refactored code for string concatenations and URL constructions in
DeployModeHelper.
<!-- end of auto-generated comment: release notes by coderabbit.ai
--><!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9597157402>
> Commit: c551705
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9597157402&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Anvil`

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

---------

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
  • Loading branch information
jsartisan and Pawan Kumar authored Jun 20, 2024
1 parent 62fad08 commit e01b34e
Show file tree
Hide file tree
Showing 38 changed files with 10,887 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ANVIL_EDITOR_TEST } from "../../../../../support/Constants";
import {
agHelper,
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
`${ANVIL_EDITOR_TEST}: Anvil tests for Button Widget`,
{ tags: ["@tag.Anvil"] },
() => {
before(() => {
agHelper.AddDsl("anvilButtonWidget");
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("ButtonWidget");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("ButtonWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("ButtonWidget");
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ANVIL_EDITOR_TEST } from "../../../../../support/Constants";
import {
agHelper,
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
`${ANVIL_EDITOR_TEST}: Anvil tests for Icon Button Widget`,
{ tags: ["@tag.Anvil"] },
() => {
before(() => {
agHelper.AddDsl("anvilIconButtonWidget");
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("IconButtonWidget");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("IconButtonWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("IconButtonWidget");
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ANVIL_EDITOR_TEST } from "../../../../../support/Constants";
import {
agHelper,
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
`${ANVIL_EDITOR_TEST}: Anvil tests for Inline Button Widget`,
{ tags: ["@tag.Anvil"] },
() => {
before(() => {
agHelper.AddDsl("anvilInlineButtonWidget");
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("InlineButtonWidget");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("InlineButtonWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("InlineButtonWidget");
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ANVIL_EDITOR_TEST } from "../../../../../support/Constants";
import {
agHelper,
anvilSnapshot,
} from "../../../../../support/Objects/ObjectsCore";

describe(
`${ANVIL_EDITOR_TEST}: Anvil tests for Toolbar Button Widget`,
{ tags: ["@tag.Anvil"] },
() => {
before(() => {
agHelper.AddDsl("anvilToolbarButtonWidget");
});

it("1. Canvas Mode", () => {
anvilSnapshot.verifyCanvasMode("ToolbarButtonWidget");
});

it("2. Preview Mode", () => {
anvilSnapshot.verifyPreviewMode("ToolbarButtonWidget");
});

it("3. Deploy Mode", () => {
anvilSnapshot.verifyDeployMode("ToolbarButtonWidget");
});
},
);
Loading

0 comments on commit e01b34e

Please sign in to comment.