test: fix discussions and asset testing

This commit is contained in:
Jannat Patel
2024-05-15 17:56:11 +05:30
parent a0fc1b0a9e
commit 7651eb5f97
3 changed files with 12 additions and 16 deletions

View File

@@ -71,9 +71,8 @@ describe("Course Creation", () => {
encoding: "base64", encoding: "base64",
}); });
}); });
cy.wait(1000);
cy.get("#content .ce-block").type( 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(); cy.button("Save").click();
@@ -87,11 +86,9 @@ describe("Course Creation", () => {
cy.get("div").contains( cy.get("div").contains(
"Test Course Short Introduction to test the UI" "Test Course Short Introduction to test the UI"
); );
cy.get(".course-image").should( cy.get(".course-image")
"have.css", .invoke("css", "background-image")
"background-image", .should("include", "/files/profile");
'url("/files/profile.png")'
);
}); });
cy.get(".grid a:first").click(); cy.get(".grid a:first").click();
cy.url().should("include", "/lms/courses/test-course"); cy.url().should("include", "/lms/courses/test-course");
@@ -120,17 +117,19 @@ describe("Course Creation", () => {
cy.get("div").contains( 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. " "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") cy.get("video")
.should("be.visible") .should("be.visible")
.children("source") .children("source")
.should("have.attr", "src", "/files/Youtube.mov"); .invoke("attr", "src")
.should("include", "/files/Youtube");
// Add Discussion // Add Discussion
cy.button("New Question").click(); cy.button("New Question").click();
cy.wait(500); cy.wait(500);
cy.get("[id^=headlessui-dialog-panel-").within(() => { cy.get("[id^=headlessui-dialog-panel-").within(() => {
cy.get("label").contains("Title").type("Test Discussion"); cy.get("label").contains("Title").type("Test Discussion");
cy.get("div[contenteditable=true").invoke( cy.get("div[contenteditable=true]").invoke(
"text", "text",
"This is a test discussion. This will check if the UI is working properly." "This is a test discussion. This will check if the UI is working properly."
); );

View File

@@ -15,10 +15,7 @@
<template #body-content> <template #body-content>
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
<div> <div>
<div class="mb-1.5 text-sm text-gray-600"> <FormControl v-model="topic.title" :label="__('Title')" type="text" />
{{ __('Title') }}
</div>
<Input type="text" v-model="topic.title" />
</div> </div>
<div> <div>
<div class="mb-1.5 text-sm text-gray-600"> <div class="mb-1.5 text-sm text-gray-600">
@@ -37,7 +34,7 @@
</Dialog> </Dialog>
</template> </template>
<script setup> <script setup>
import { Dialog, Input, TextEditor, createResource } from 'frappe-ui' import { Dialog, FormControl, TextEditor, createResource } from 'frappe-ui'
import { reactive, defineModel, computed } from 'vue' import { reactive, defineModel, computed } from 'vue'
import { showToast } from '@/utils' import { showToast } from '@/utils'

View File

@@ -15,10 +15,10 @@
<meta name="twitter:title" content="{{ meta.title }}" /> <meta name="twitter:title" content="{{ meta.title }}" />
<meta name="twitter:image" content="{{ meta.image }}" /> <meta name="twitter:image" content="{{ meta.image }}" />
<meta name="twitter:description" content="{{ meta.description }}" /> <meta name="twitter:description" content="{{ meta.description }}" />
<script type="module" crossorigin src="/assets/lms/frontend/assets/index-mfcOnHa1.js"></script> <script type="module" crossorigin src="/assets/lms/frontend/assets/index-CdhjdjEj.js"></script>
<link rel="modulepreload" crossorigin href="/assets/lms/frontend/assets/frappe-ui-CgFK8870.js"> <link rel="modulepreload" crossorigin href="/assets/lms/frontend/assets/frappe-ui-CgFK8870.js">
<link rel="stylesheet" crossorigin href="/assets/lms/frontend/assets/frappe-ui-DzKBfka9.css"> <link rel="stylesheet" crossorigin href="/assets/lms/frontend/assets/frappe-ui-DzKBfka9.css">
<link rel="stylesheet" crossorigin href="/assets/lms/frontend/assets/index-9UBJh53K.css"> <link rel="stylesheet" crossorigin href="/assets/lms/frontend/assets/index-C1pDkvO9.css">
</head> </head>
<body> <body>
<div id="app"> <div id="app">