test: find the course image label and attach course image to its sibling input

This commit is contained in:
Jannat Patel
2025-04-21 10:53:22 +05:30
parent e821755721
commit 9143cc39d9

View File

@@ -19,12 +19,23 @@ describe("Course Creation", () => {
); );
cy.fixture("profile.png", "base64").then((fileContent) => { cy.fixture("profile.png", "base64").then((fileContent) => {
cy.get('input[type="file"]').should("be.hidden").attachFile({ /* cy.get('input[type="file"]').should("be.hidden").attachFile({
fileContent, fileContent,
fileName: "profile.png", fileName: "profile.png",
mimeType: "image/png", mimeType: "image/png",
encoding: "base64", encoding: "base64",
}); }); */
cy.get("div")
.contains("Course Image")
.siblings("div")
.children('input[type="file"]')
.attachFile({
fileContent,
fileName: "profile.png",
mimeType: "image/png",
encoding: "base64",
});
}); });
cy.get("label") cy.get("label")