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",
});
});
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."
);

View File

@@ -15,10 +15,7 @@
<template #body-content>
<div class="flex flex-col gap-4">
<div>
<div class="mb-1.5 text-sm text-gray-600">
{{ __('Title') }}
</div>
<Input type="text" v-model="topic.title" />
<FormControl v-model="topic.title" :label="__('Title')" type="text" />
</div>
<div>
<div class="mb-1.5 text-sm text-gray-600">
@@ -37,7 +34,7 @@
</Dialog>
</template>
<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 { showToast } from '@/utils'

View File

@@ -15,10 +15,10 @@
<meta name="twitter:title" content="{{ meta.title }}" />
<meta name="twitter:image" content="{{ meta.image }}" />
<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="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>
<body>
<div id="app">