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

This commit is contained in:
Jannat Patel
2025-04-21 17:10:33 +05:30
parent 7ed5dfdb8f
commit 89fdbf5660

View File

@@ -19,12 +19,16 @@ describe("Course Creation", () => {
);
cy.fixture("profile.png", "base64").then((fileContent) => {
cy.get('input[type="file"]').attachFile({
fileContent,
fileName: "profile.png",
mimeType: "image/png",
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")