From 1661389b07ec91cfef7f43f9f32e9ac60d435fd2 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 11 Mar 2026 12:53:01 +0530 Subject: [PATCH] test: fixed course image issue --- cypress/e2e/course_creation.cy.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index 0ed474b3..8a8e0f2d 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -21,11 +21,17 @@ describe("Course Creation", () => { "Test Course Description. I need a very big description to test the UI. This is a very big description. It contains more than once sentence. Its meant to be this long as this is a UI test. Its unbearably long and I'm not sure why I'm typing this much. I'm just going to keep typing until I feel like its long enough. I think its long enough now. I'm going to stop typing now." ); - cy.fixture("profile.png", "base64").then((fileContent) => { + cy.contains("Course Image") + .should("exist") + .parent() + .find('input[type="file"]') + .attachFile("profile.png", { force: true }); + + /* cy.fixture("profile.png", "base64").then((fileContent) => { expect(fileContent).to.exist; cy.get("div") .contains("Course Image") - .siblings("div") + .parent() .children('input[type="file"]') .attachFile({ fileContent, @@ -33,7 +39,7 @@ describe("Course Creation", () => { mimeType: "image/png", encoding: "base64", }); - }); + }); */ /* Instructor */ cy.get("label")