test: instructor for courses
This commit is contained in:
@@ -32,6 +32,8 @@ describe("Course Creation", () => {
|
|||||||
.contains("Preview Video")
|
.contains("Preview Video")
|
||||||
.type("https://www.youtube.com/embed/-LPmw2Znl2c");
|
.type("https://www.youtube.com/embed/-LPmw2Znl2c");
|
||||||
cy.get("[id=tags]").type("Learning{enter}Frappe{enter}ERPNext{enter}");
|
cy.get("[id=tags]").type("Learning{enter}Frappe{enter}ERPNext{enter}");
|
||||||
|
cy.get(".search-input").click();
|
||||||
|
cy.get("[id^=headlessui-combobox-option-").first().click();
|
||||||
cy.get("label").contains("Published").click();
|
cy.get("label").contains("Published").click();
|
||||||
cy.get("label").contains("Published On").type("2021-01-01");
|
cy.get("label").contains("Published On").type("2021-01-01");
|
||||||
cy.button("Save").click();
|
cy.button("Save").click();
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<Avatar
|
<Tooltip :text="user.full_name">
|
||||||
class="avatar border border-gray-300"
|
<Avatar
|
||||||
v-if="user"
|
class="avatar border border-gray-300 cursor-auto"
|
||||||
:label="user.full_name"
|
v-if="user"
|
||||||
:image="user.user_image"
|
:label="user.full_name"
|
||||||
:size="size"
|
:image="user.user_image"
|
||||||
v-bind="$attrs"
|
:size="size"
|
||||||
/>
|
v-bind="$attrs"
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Avatar } from 'frappe-ui'
|
import { Avatar, Tooltip } from 'frappe-ui'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
user: {
|
user: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -12,7 +12,13 @@ from lms.lms.doctype.lms_course.test_lms_course import new_course
|
|||||||
|
|
||||||
class TestLMSCertificate(unittest.TestCase):
|
class TestLMSCertificate(unittest.TestCase):
|
||||||
def test_certificate_creation(self):
|
def test_certificate_creation(self):
|
||||||
course = new_course("Test Certificate", {"enable_certification": 1, "expiry": 2})
|
course = new_course(
|
||||||
|
"Test Certificate",
|
||||||
|
{
|
||||||
|
"enable_certification": 1,
|
||||||
|
"expiry": 2,
|
||||||
|
},
|
||||||
|
)
|
||||||
certificate = create_certificate(course.name)
|
certificate = create_certificate(course.name)
|
||||||
|
|
||||||
self.assertEqual(certificate.member, "Administrator")
|
self.assertEqual(certificate.member, "Administrator")
|
||||||
|
|||||||
@@ -68,12 +68,19 @@ def new_course(title, additional_filters=None):
|
|||||||
return frappe.get_doc("LMS Course", course)
|
return frappe.get_doc("LMS Course", course)
|
||||||
else:
|
else:
|
||||||
create_evaluator()
|
create_evaluator()
|
||||||
|
user = frappe.db.get_value(
|
||||||
|
"User",
|
||||||
|
{
|
||||||
|
"user_type": "System User",
|
||||||
|
},
|
||||||
|
)
|
||||||
filters = {
|
filters = {
|
||||||
"title": title,
|
"title": title,
|
||||||
"short_introduction": title,
|
"short_introduction": title,
|
||||||
"description": title,
|
"description": title,
|
||||||
"video_link": "https://youtu.be/pEbIhUySqbk",
|
"video_link": "https://youtu.be/pEbIhUySqbk",
|
||||||
"image": "/assets/lms/images/course-home.png",
|
"image": "/assets/lms/images/course-home.png",
|
||||||
|
"instructors": [{"instructor": user}],
|
||||||
}
|
}
|
||||||
|
|
||||||
if additional_filters:
|
if additional_filters:
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class TestUtils(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def test_evaluation_details(self):
|
def test_evaluation_details(self):
|
||||||
|
user = new_user("Eval", "eval@test.com")
|
||||||
|
|
||||||
course = new_course(
|
course = new_course(
|
||||||
"Test Evaluation Details",
|
"Test Evaluation Details",
|
||||||
{
|
{
|
||||||
@@ -30,9 +32,9 @@ class TestUtils(unittest.TestCase):
|
|||||||
"evaluator": "evaluator@example.com",
|
"evaluator": "evaluator@example.com",
|
||||||
"max_attempts": 3,
|
"max_attempts": 3,
|
||||||
"duration": 2,
|
"duration": 2,
|
||||||
|
"instructors": [{"instructor": user.name}],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
user = new_user("Eval", "eval@test.com")
|
|
||||||
|
|
||||||
# Two evaluations failed within max attempts. Check eligibility for a third evaluation
|
# Two evaluations failed within max attempts. Check eligibility for a third evaluation
|
||||||
create_evaluation(user.name, course.name, getdate("21-03-2022"), 0.4, "Fail")
|
create_evaluation(user.name, course.name, getdate("21-03-2022"), 0.4, "Fail")
|
||||||
|
|||||||
Reference in New Issue
Block a user