Skip to content

Commit

Permalink
fix: Fix iframe and widget test case for clicking (appsmithorg#38039)
Browse files Browse the repository at this point in the history
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Iframe"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/12236274208>
> Commit: 7bd2b6a
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12236274208&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Iframe`
> Spec:
> <hr>Mon, 09 Dec 2024 13:30:29 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


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

- **Bug Fixes**
- Improved the Iframe widget test by ensuring button clicks can proceed
under all conditions.
- Enhanced entity context management during URL property updates in
tests.

- **Tests**
- Updated test specification to include the Iframe widget test,
replacing the previous fork template entry.
- Adjusted visibility assertion to use conditional waits in the Iframe
widget tests.

- **Style**
- Modified CSS selector spacing in the CommonLocators to improve element
targeting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
sagar-qa007 authored Dec 9, 2024
1 parent c739c49 commit dcbf9bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ describe(

// User interaction - Click
getIframeBody(1).find(locators._pageHeaderToggle).click({ force: true });
getIframeBody(1).find(locators._pageHeaderMenuList).should("be.visible");
agHelper.WaitForCondition(() => {
return getIframeBody(1)
.find(locators._pageHeaderMenuList)
.then(($el: JQuery<HTMLElement>) => $el.length > 0);
});
});

it("2. Verify colors, borders and shadows", () => {
Expand Down Expand Up @@ -81,7 +85,7 @@ describe(
propPane.UpdatePropertyFieldValue("URL", " ");
agHelper.ValidateToastMessage("url updated");

agHelper.ClickButton("Submit");
agHelper.ClickButton("Submit", { force: true });
getIframeBody(0)
.find("input")
.should("be.visible")
Expand All @@ -90,6 +94,7 @@ describe(
expect(inputValue).to.equal("submitclicked");
});

EditorNavigation.SelectEntityByName("Iframe1", EntityType.Widget);
propPane.UpdatePropertyFieldValue(
"srcDoc",
`<!DOCTYPE html>
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export class CommonLocators {
_treeSelectedContent = ".rc-tree-select-selection-item-content";
_switcherIcon = ".switcher-icon";
_root = "#root";
_pageHeaderToggle = ".navbar__items>button";
_pageHeaderToggle = ".navbar__items > button";
_pageHeaderMenuList = ".navbar-sidebar__backdrop";
_enterFullScreen = ".application-demo-new-dashboard-control-enter-fullscreen";
_dashboardContainer = ".application-demo-new-dashboard-container";
Expand Down

0 comments on commit dcbf9bf

Please sign in to comment.