Add cypress test for "Fremdeinschätzung"
This commit is contained in:
parent
f0013648e9
commit
af2b63b15f
|
|
@ -77,7 +77,11 @@ function hasActionButton(): boolean {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="courseConfig" class="mb-14 space-y-8">
|
<div
|
||||||
|
v-if="courseConfig"
|
||||||
|
class="mb-14 space-y-8"
|
||||||
|
:data-cy="`panel-${courseConfig.course_slug}`"
|
||||||
|
>
|
||||||
<div class="flex flex-col space-y-8 bg-white p-6">
|
<div class="flex flex-col space-y-8 bg-white p-6">
|
||||||
<div class="border-b border-gray-300 pb-8">
|
<div class="border-b border-gray-300 pb-8">
|
||||||
<div class="flex flex-row items-start justify-between">
|
<div class="flex flex-row items-start justify-between">
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ onMounted(async () => {
|
||||||
<div class="w-[325px]">
|
<div class="w-[325px]">
|
||||||
<BaseBox
|
<BaseBox
|
||||||
:details-link="`/dashboard/persons?course=${props.courseId}`"
|
:details-link="`/dashboard/persons?course=${props.courseId}`"
|
||||||
data-cy="dashboard.mentor.competenceSummary"
|
data-cy="dashboard.mentor.menteeCount"
|
||||||
>
|
>
|
||||||
<template #title>{{ $t("a.Personen") }}</template>
|
<template #title>{{ $t("a.Personen") }}</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ onMounted(async () => {
|
||||||
<div class="w-[325px]">
|
<div class="w-[325px]">
|
||||||
<BaseBox
|
<BaseBox
|
||||||
:details-link="`/course/${props.courseSlug}/learning-mentor/tasks`"
|
:details-link="`/course/${props.courseSlug}/learning-mentor/tasks`"
|
||||||
data-cy="dashboard.mentor.competenceSummary"
|
data-cy="dashboard.mentor.openTasksCount"
|
||||||
>
|
>
|
||||||
<template #title>{{ $t("Zu erledigen") }}</template>
|
<template #title>{{ $t("Zu erledigen") }}</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,12 @@ async function navigate(routeName: string) {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="mt-6 flex items-center" @click="emit('logout')">
|
<button
|
||||||
|
type="button"
|
||||||
|
class="mt-6 flex items-center"
|
||||||
|
data-cy="logout-button"
|
||||||
|
@click="emit('logout')"
|
||||||
|
>
|
||||||
<it-icon-logout class="inline-block" />
|
<it-icon-logout class="inline-block" />
|
||||||
<span class="ml-1">{{ $t("mainNavigation.logout") }}</span>
|
<span class="ml-1">{{ $t("mainNavigation.logout") }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,11 @@ const mentorTabTitle = computed(() =>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav-item">
|
<div class="nav-item">
|
||||||
<div v-if="userStore.loggedIn" class="flex items-center">
|
<div
|
||||||
|
v-if="userStore.loggedIn"
|
||||||
|
class="flex items-center"
|
||||||
|
data-cy="header-profile"
|
||||||
|
>
|
||||||
<Popover class="relative">
|
<Popover class="relative">
|
||||||
<PopoverButton @click="popoverClick($event)">
|
<PopoverButton @click="popoverClick($event)">
|
||||||
<div v-if="userStore.avatar_url">
|
<div v-if="userStore.avatar_url">
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ const onFailed = () => {
|
||||||
<button
|
<button
|
||||||
class="inline-flex flex-1 items-center border-2 p-4 text-left"
|
class="inline-flex flex-1 items-center border-2 p-4 text-left"
|
||||||
:class="currentEvaluation === 'SUCCESS' ? 'border-green-500' : 'border-gray-300'"
|
:class="currentEvaluation === 'SUCCESS' ? 'border-green-500' : 'border-gray-300'"
|
||||||
|
data-cy="success"
|
||||||
@click="onPassed"
|
@click="onPassed"
|
||||||
>
|
>
|
||||||
<it-icon-smiley-happy class="mr-4 h-16 w-16"></it-icon-smiley-happy>
|
<it-icon-smiley-happy class="mr-4 h-16 w-16"></it-icon-smiley-happy>
|
||||||
|
|
@ -54,6 +55,7 @@ const onFailed = () => {
|
||||||
<button
|
<button
|
||||||
class="inline-flex flex-1 items-center border-2 p-4 text-left"
|
class="inline-flex flex-1 items-center border-2 p-4 text-left"
|
||||||
:class="currentEvaluation === 'FAIL' ? 'border-orange-500' : 'border-gray-300'"
|
:class="currentEvaluation === 'FAIL' ? 'border-orange-500' : 'border-gray-300'"
|
||||||
|
data-cy="fail"
|
||||||
@click="onFailed"
|
@click="onFailed"
|
||||||
>
|
>
|
||||||
<it-icon-smiley-thinking class="mr-4 h-16 w-16"></it-icon-smiley-thinking>
|
<it-icon-smiley-thinking class="mr-4 h-16 w-16"></it-icon-smiley-thinking>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,12 @@ const emit = defineEmits(["release"]);
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<ItButton variant="primary" size="large" @click="emit('release')">
|
<ItButton
|
||||||
|
variant="primary"
|
||||||
|
size="large"
|
||||||
|
data-cy="feedback-release-button"
|
||||||
|
@click="emit('release')"
|
||||||
|
>
|
||||||
{{ $t("a.Fremdeinschätzung freigeben") }}
|
{{ $t("a.Fremdeinschätzung freigeben") }}
|
||||||
</ItButton>
|
</ItButton>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ const getParticipantById = (id: string): Participant | null => {
|
||||||
v-for="item in selfEvaluationFeedback.completions"
|
v-for="item in selfEvaluationFeedback.completions"
|
||||||
:key="item.user_id"
|
:key="item.user_id"
|
||||||
class="flex flex-col items-start justify-between gap-4 border-b py-2 pl-5 pr-5 last:border-b-0 md:flex-row md:items-center md:justify-between md:gap-16"
|
class="flex flex-col items-start justify-between gap-4 border-b py-2 pl-5 pr-5 last:border-b-0 md:flex-row md:items-center md:justify-between md:gap-16"
|
||||||
|
:data-cy="`self-evalution-feedback-${item.user_id}`"
|
||||||
>
|
>
|
||||||
<!-- Left -->
|
<!-- Left -->
|
||||||
<div class="flex flex-grow flex-row items-center justify-start">
|
<div class="flex flex-grow flex-row items-center justify-start">
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ const onRequestFeedback = async () => {
|
||||||
variant="primary"
|
variant="primary"
|
||||||
size="large"
|
size="large"
|
||||||
:disabled="!currentSessionRequestedMentor"
|
:disabled="!currentSessionRequestedMentor"
|
||||||
|
data-cy="request-feedback-button"
|
||||||
@click="onRequestFeedback"
|
@click="onRequestFeedback"
|
||||||
>
|
>
|
||||||
<p v-if="!currentSessionRequestedMentor">
|
<p v-if="!currentSessionRequestedMentor">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
import { login, logout } from "../../helpers";
|
||||||
|
import { TEST_STUDENT1_VV_USER_ID } from "../../../consts";
|
||||||
|
|
||||||
|
describe("fremdeinschätzung.cy.js", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.manageCommand("cypress_reset --create-learning-mentor");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("teilnehmer macht selbsteinschätzung; begleiter kann fremdeinschätzung machen", () => {
|
||||||
|
// teilnehmer macht selbsteinschätzung
|
||||||
|
login("student-vv@eiger-versicherungen.ch", "test");
|
||||||
|
cy.visit(
|
||||||
|
"/course/versicherungsvermittler-in/learn/basis/evaluate/mein-neuer-job-arbeitstechnik-soziale-medien-datenschutz-und-beratungspflichten",
|
||||||
|
);
|
||||||
|
cy.makeSelfEvaluation([true, false, true], false);
|
||||||
|
|
||||||
|
cy.get('[data-cy="dropdown-select"]').click();
|
||||||
|
cy.get('[data-cy="dropdown-select-option-Micheala Weber-Mentor"]').click();
|
||||||
|
cy.get('[data-cy="request-feedback-button"]').click();
|
||||||
|
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
|
||||||
|
cy.visit("/");
|
||||||
|
cy.get('[data-cy="header-profile"]').click();
|
||||||
|
cy.get('[data-cy="logout-button"]').click();
|
||||||
|
cy.wait(1000);
|
||||||
|
|
||||||
|
// fremdeinschätzung vornehmen
|
||||||
|
login("test-mentor1@example.com", "test");
|
||||||
|
cy.visit("/");
|
||||||
|
|
||||||
|
cy.get(
|
||||||
|
'[data-cy="panel-versicherungsvermittler-in"] [data-cy="dashboard.mentor.openTasksCount"]',
|
||||||
|
).should("contain", "1");
|
||||||
|
cy.get(
|
||||||
|
'[data-cy="panel-versicherungsvermittler-in"] [data-cy="dashboard.mentor.openTasksCount"] [data-cy="basebox.detailsLink"]',
|
||||||
|
).click();
|
||||||
|
|
||||||
|
cy.contains("Fremdeinschätzung vornehmen").click();
|
||||||
|
|
||||||
|
// viktor vollgas auswählen
|
||||||
|
cy.get(
|
||||||
|
`[data-cy="self-evalution-feedback-${TEST_STUDENT1_VV_USER_ID}"]`,
|
||||||
|
).should("contain", "Selbsteinschätzung geteilt");
|
||||||
|
cy.contains("Fremdeinschätzung vornehmen").click();
|
||||||
|
cy.makeSelfEvaluation([true, true, true], false);
|
||||||
|
|
||||||
|
cy.get('[data-cy="feedback-release-button"]').click();
|
||||||
|
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
|
||||||
|
|
||||||
|
cy.visit("/");
|
||||||
|
cy.get(
|
||||||
|
'[data-cy="panel-versicherungsvermittler-in"] [data-cy="dashboard.mentor.openTasksCount"]',
|
||||||
|
).should("contain", "0");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -87,13 +87,13 @@ function loadObjectJson(
|
||||||
value,
|
value,
|
||||||
djangoModelPath,
|
djangoModelPath,
|
||||||
serializerModelPath,
|
serializerModelPath,
|
||||||
valueAsString = false
|
valueAsString = false,
|
||||||
) {
|
) {
|
||||||
const djangoModel = _.last(djangoModelPath.split("."));
|
const djangoModel = _.last(djangoModelPath.split("."));
|
||||||
const djangoModelImportPath = _.initial(djangoModelPath.split(".")).join(".");
|
const djangoModelImportPath = _.initial(djangoModelPath.split(".")).join(".");
|
||||||
const serializerModel = _.last(serializerModelPath.split("."));
|
const serializerModel = _.last(serializerModelPath.split("."));
|
||||||
const serializerModelImportPath = _.initial(
|
const serializerModelImportPath = _.initial(
|
||||||
serializerModelPath.split(".")
|
serializerModelPath.split("."),
|
||||||
).join(".");
|
).join(".");
|
||||||
|
|
||||||
let filterPart = `${key}=${value}`;
|
let filterPart = `${key}=${value}`;
|
||||||
|
|
@ -134,7 +134,7 @@ Cypress.Commands.add("loadAssignmentCompletion", (key, value) => {
|
||||||
value,
|
value,
|
||||||
"vbv_lernwelt.assignment.models.AssignmentCompletion",
|
"vbv_lernwelt.assignment.models.AssignmentCompletion",
|
||||||
"vbv_lernwelt.assignment.serializers.CypressAssignmentCompletionSerializer",
|
"vbv_lernwelt.assignment.serializers.CypressAssignmentCompletionSerializer",
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ Cypress.Commands.add("loadSecurityRequestResponseLog", (key, value) => {
|
||||||
value,
|
value,
|
||||||
"vbv_lernwelt.core.models.SecurityRequestResponseLog",
|
"vbv_lernwelt.core.models.SecurityRequestResponseLog",
|
||||||
"vbv_lernwelt.core.serializers.CypressSecurityRequestResponseLogSerializer",
|
"vbv_lernwelt.core.serializers.CypressSecurityRequestResponseLogSerializer",
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ Cypress.Commands.add("loadExternalApiRequestLog", (key, value) => {
|
||||||
value,
|
value,
|
||||||
"vbv_lernwelt.core.models.ExternalApiRequestLog",
|
"vbv_lernwelt.core.models.ExternalApiRequestLog",
|
||||||
"vbv_lernwelt.core.serializers.CypressExternalApiRequestLogSerializer",
|
"vbv_lernwelt.core.serializers.CypressExternalApiRequestLogSerializer",
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -164,7 +164,7 @@ Cypress.Commands.add("loadFeedbackResponse", (key, value) => {
|
||||||
value,
|
value,
|
||||||
"vbv_lernwelt.feedback.models.FeedbackResponse",
|
"vbv_lernwelt.feedback.models.FeedbackResponse",
|
||||||
"vbv_lernwelt.feedback.serializers.CypressFeedbackResponseSerializer",
|
"vbv_lernwelt.feedback.serializers.CypressFeedbackResponseSerializer",
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -174,7 +174,7 @@ Cypress.Commands.add("loadCheckoutInformation", (key, value) => {
|
||||||
value,
|
value,
|
||||||
"vbv_lernwelt.shop.models.CheckoutInformation",
|
"vbv_lernwelt.shop.models.CheckoutInformation",
|
||||||
"vbv_lernwelt.shop.serializers.CypressCheckoutInformationSerializer",
|
"vbv_lernwelt.shop.serializers.CypressCheckoutInformationSerializer",
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -189,7 +189,7 @@ Cypress.Commands.add("loadUser", (key, value) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Cypress.Commands.add("makeSelfEvaluation", (answers) => {
|
Cypress.Commands.add("makeSelfEvaluation", (answers, withCompletion = true) => {
|
||||||
for (let i = 0; i < answers.length; i++) {
|
for (let i = 0; i < answers.length; i++) {
|
||||||
const answer = answers[i];
|
const answer = answers[i];
|
||||||
if (answer) {
|
if (answer) {
|
||||||
|
|
@ -197,10 +197,15 @@ Cypress.Commands.add("makeSelfEvaluation", (answers) => {
|
||||||
} else {
|
} else {
|
||||||
cy.get('[data-cy="fail"]').click();
|
cy.get('[data-cy="fail"]').click();
|
||||||
}
|
}
|
||||||
if (i < answers.length - 1) {
|
|
||||||
cy.get('[data-cy="next-step"]').click({ force: true });
|
if (withCompletion) {
|
||||||
|
if (i < answers.length - 1) {
|
||||||
|
cy.get('[data-cy="next-step"]').click({ force: true });
|
||||||
|
} else {
|
||||||
|
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cy.get('[data-cy="complete-and-continue"]').click({ force: true });
|
cy.get('[data-cy="next-step"]').click({ force: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue