diff --git a/packages/files-ui/cypress/tests/file-preview-spec.ts b/packages/files-ui/cypress/tests/file-preview-spec.ts index ffe19a8ba7..6f2dc17cee 100644 --- a/packages/files-ui/cypress/tests/file-preview-spec.ts +++ b/packages/files-ui/cypress/tests/file-preview-spec.ts @@ -69,7 +69,7 @@ describe("File Preview", () => { homePage.uploadFile("../fixtures/uploadedFiles/file.zip") // setup an api intercepter for download requests - cy.intercept("POST", "https://stage.imploy.site/api/v1/bucket/*/download").as("downloadRequest").then(() => { + cy.intercept("POST", "**/bucket/*/download").as("downloadRequest").then(() => { homePage.fileItemName().dblclick() previewModal.unsupportedFileLabel().should("exist") previewModal.downloadUnsupportedFileButton().should("be.visible") diff --git a/packages/files-ui/cypress/tests/survey-banner-spec.ts b/packages/files-ui/cypress/tests/survey-banner-spec.ts index ba13369114..fb66f27708 100644 --- a/packages/files-ui/cypress/tests/survey-banner-spec.ts +++ b/packages/files-ui/cypress/tests/survey-banner-spec.ts @@ -3,26 +3,28 @@ import { homePage } from "../support/page-objects/homePage" describe("Survey Banner", () => { + const dismissedSurveyKey = "csf.dismissedSurveyBannerV3" + context("desktop", () => { it("User can view and dismiss the survey banner", () => { // intercept and stub the account creation date to be > 7 days - cy.intercept("GET", "https://stage.imploy.site/api/v1/user/profile", (req) => { + cy.intercept("GET", "**/user/profile", (req) => { req.on("response", (res) => { - res.body.created_at = profileCreatedDate + res.body.created_at = profileCreatedDate }) }) // intercept and stub the response to ensure the banner is displayed - cy.intercept("GET", "https://stage.imploy.site/api/v1/user/store", { - body: [{ "csf.dismissedSurveyBannerV3": "false" }] + cy.intercept("GET", "**/user/store", { + body: { [dismissedSurveyKey]: "false" } }) cy.web3Login() homePage.surveyBanner().should("be.visible") // set up a spy for the POST response - cy.intercept("POST", "https://stage.imploy.site/api/v1/user/store").as("storePost").then(() => { + cy.intercept("POST", "**/user/store").as("storePost").then(() => { // dismiss the survey banner homePage.closeBannerButton().click() @@ -30,14 +32,14 @@ describe("Survey Banner", () => { // intercept POST to ensure the key was updated after the banner is dismissed cy.wait("@storePost").its("request.body").should("contain", { - "csf.dismissedSurveyBannerV3": "true" + [dismissedSurveyKey]: "true" }) }) }) it("User should not see the survey banner if previously dismissed", () => { - cy.intercept("GET", "https://stage.imploy.site/api/v1/user/store", { - body: [{ "csf.dismissedSurveyBannerV3": "true" }] + cy.intercept("GET", "**/user/store", { + body: { [dismissedSurveyKey]: "true" } }) cy.web3Login() @@ -45,8 +47,8 @@ describe("Survey Banner", () => { }) it("User should see banner if account age is greater than 7 days and api response is empty", () => { - cy.intercept("GET", "https://stage.imploy.site/api/v1/user/store", { - body: [{}] + cy.intercept("GET", "**/user/store", { + body: {} }) cy.web3Login() @@ -55,14 +57,14 @@ describe("Survey Banner", () => { it("User should not see banner if account age is less than 7 days and api response is empty", () => { // intercept and stub the account creation date to make it less than 7 days - cy.intercept("GET", "https://stage.imploy.site/api/v1/user/profile", (req) => { + cy.intercept("GET", "**/user/profile", (req) => { req.on("response", (res) => { res.body.created_at = res.body.updated_at }) }) - cy.intercept("GET", "https://stage.imploy.site/api/v1/user/store", { - body: [{}] + cy.intercept("GET", "**/user/store", { + body: {} }) cy.web3Login()