From d905a4c845a7b84741d142f1dfd7c1e14108932c Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Tue, 17 Dec 2024 13:21:05 +0530 Subject: [PATCH] fix: Updated fix for embedSettings spec (#38195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 049ddf45a1805d8ef1714d1063df3ed70356b2ae > Cypress dashboard. > Tags: `@tag.Settings` > Spec: >
Tue, 17 Dec 2024 07:49:08 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## 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. --- .../ClientSide/EmbedSettings/EmbedSettings_spec.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/EmbedSettings/EmbedSettings_spec.js b/app/client/cypress/e2e/Regression/ClientSide/EmbedSettings/EmbedSettings_spec.js index ea53ef2ba7..d139fd045d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/EmbedSettings/EmbedSettings_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/EmbedSettings/EmbedSettings_spec.js @@ -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();