From 7651eb5f977a81631a632dd4bd651dce321a3f43 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 15 May 2024 17:56:11 +0530 Subject: [PATCH] test: fix discussions and asset testing --- cypress/e2e/course_creation.cy.js | 17 ++++++++--------- .../src/components/Modals/DiscussionModal.vue | 7 ++----- lms/public/frontend/index.html | 4 ++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index 10bf569c..1d969640 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -71,9 +71,8 @@ describe("Course Creation", () => { encoding: "base64", }); }); - cy.wait(1000); cy.get("#content .ce-block").type( - "This is an extremely big paragraph that is meant to test the UI. This is a very long paragraph. 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. {enter}" + "This is an extremely big paragraph that is meant to test the UI. This is a very long paragraph. 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.button("Save").click(); @@ -87,11 +86,9 @@ describe("Course Creation", () => { cy.get("div").contains( "Test Course Short Introduction to test the UI" ); - cy.get(".course-image").should( - "have.css", - "background-image", - 'url("/files/profile.png")' - ); + cy.get(".course-image") + .invoke("css", "background-image") + .should("include", "/files/profile"); }); cy.get(".grid a:first").click(); cy.url().should("include", "/lms/courses/test-course"); @@ -120,17 +117,19 @@ describe("Course Creation", () => { cy.get("div").contains( "This is an extremely big paragraph that is meant to test the UI. This is a very long paragraph. 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.get("video") .should("be.visible") .children("source") - .should("have.attr", "src", "/files/Youtube.mov"); + .invoke("attr", "src") + .should("include", "/files/Youtube"); // Add Discussion cy.button("New Question").click(); cy.wait(500); cy.get("[id^=headlessui-dialog-panel-").within(() => { cy.get("label").contains("Title").type("Test Discussion"); - cy.get("div[contenteditable=true").invoke( + cy.get("div[contenteditable=true]").invoke( "text", "This is a test discussion. This will check if the UI is working properly." ); diff --git a/frontend/src/components/Modals/DiscussionModal.vue b/frontend/src/components/Modals/DiscussionModal.vue index 30cc97a3..d2e35f4e 100644 --- a/frontend/src/components/Modals/DiscussionModal.vue +++ b/frontend/src/components/Modals/DiscussionModal.vue @@ -15,10 +15,7 @@ + - +