test(ui): find course with the test title instead of checking the first course card

(cherry picked from commit 8c54d77740)
This commit is contained in:
Jannat Patel
2026-03-06 17:22:12 +05:30
committed by Mergify
parent 7ee95604f4
commit eda72b7cff

View File

@@ -104,15 +104,17 @@ describe("Course Creation", () => {
cy.closeOnboardingModal();
cy.url().should("include", "/lms/courses");
cy.get(".grid a:first").within(() => {
cy.get("div").contains("Test Course");
cy.get("div").contains(
"Test Course Short Introduction to test the UI"
);
cy.get(".bg-cover")
.invoke("css", "background-image")
.should("include", "/files/profile");
});
cy.get("div")
.contains("Test Course")
.closest("a")
.within(() => {
cy.get("div").contains(
"Test Course Short Introduction to test the UI"
);
cy.get(".bg-cover")
.invoke("css", "background-image")
.should("include", "/files/profile");
});
cy.get(".grid a:first").click();
cy.url().should("include", "/lms/courses/test-course");
cy.get("div").contains("Test Course");