fix: Updated fix for embedSettings spec (#38195)

## Description
Updated new code for the coping url from the clipboard in cypress as
older code has been deprecated.

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.Settings"

### 🔍 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/12368303561>
> Commit: 049ddf45a1805d8ef1714d1063df3ed70356b2ae
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12368303561&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Settings`
> Spec:
> <hr>Tue, 17 Dec 2024 07:49:08 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 reliability of clipboard interactions in end-to-end tests for
embed settings.
  
- **New Features**
- Updated test specifications to include a new entry for "EmbedSettings"
in the testing suite, replacing the previous "Fork_Template" entry.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Sagar Khalasi 2024-12-17 13:21:05 +05:30 committed by GitHub
parent 6ce764c076
commit d905a4c845
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,12 +48,9 @@ describe("Embed settings options", { tags: ["@tag.Settings"] }, function () {
.click()
.wait(1000);
_.agHelper.ClickButton("Copy application url");
cy.window()
.its("navigator.clipboard")
.invoke("readText")
.then((text) => {
cy.wrap(text).as("deployUrl");
});
cy.window().then((win) => {
cy.stub(win.navigator.clipboard, "writeText").as("deployUrl").resolves();
});
cy.enablePublicAccess();
cy.wait(8000); //adding wait time for iframe to load fully!
_.agHelper.RefreshPage();