itemengine-cypress-automation 1.0.27 → 1.0.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,104 @@
1
+ import { fillInTheGapsDropdownPage, fillInTheGapsScoring } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+
5
+ let optionsForResponse1 = ['Correct answer 1', 'Alternate correct answer 1', 'Incorrect answer 1', 'Incorrect answer 2'];
6
+ let optionsForResponse2 = ['Correct answer 2', 'Alternate correct answer 2', 'Incorrect answer 1', 'Incorrect answer 2'];
7
+
8
+ describe('Create Item page - Fill in the Gaps - dropdown: Auto Scored Scoring Section', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Show correct answer', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
17
+ cy.log('Adding a response token')
18
+ fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
19
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
20
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
21
+ });
22
+
23
+ fillInTheGapsDropdownPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
24
+
25
+ fillInTheGapsScoring.tests.verifyShowCorrectAnswerBasicFunctionality('fill in the gaps - dropdown');
26
+ });
27
+
28
+ describe('Question Preview: AutoScored - All or Nothing', () => {
29
+ abortEarlySetup();
30
+ before(() => {
31
+ cy.log('Navigate to fill in the gaps - dropdown question type, fill the necessary details and points and switch to preview tab');
32
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
33
+ fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
34
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
35
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
36
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
37
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
38
+ fillInTheGapsDropdownPage.steps.allotPoints(20);
39
+ fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
40
+ fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
41
+ fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
42
+ .click();
43
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
44
+ });
45
+
46
+ fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingScoring('fill in the gaps - dropdown');
47
+ });
48
+
49
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer with \'Match from all responses property - \"false\"\'', () => {
50
+ abortEarlySetup();
51
+ before(() => {
52
+ cy.log('Navigate to fill in the gaps - dropdown question type, adding correct answer responses and alternate answer responses for autoscored - all or nothing scoring, adding points and switch to preview tab');
53
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
54
+ fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
55
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
56
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
57
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
58
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
59
+ fillInTheGapsDropdownPage.steps.allotPoints(7);
60
+ fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
61
+ fillInTheGapsDropdownPage.alternateAnswerButton()
62
+ .click();
63
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Alternate correct answer 1');
64
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Alternate correct answer 2');
65
+ fillInTheGapsDropdownPage.steps.allotPoints(3);
66
+ fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
67
+ fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
68
+ fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
69
+ .click();
70
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
71
+ });
72
+
73
+ fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - dropdown')
74
+ });
75
+
76
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer with \'Match from all responses property - \"true\"\'', () => {
77
+ abortEarlySetup();
78
+ before(() => {
79
+ cy.log('Navigate to fill in the gaps - dropdown question type, adding correct answer responses and alternate answer responses for autoscored - all or nothing scoring');
80
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
81
+ fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
82
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
83
+ fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
84
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Correct answer 1');
85
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Correct answer 2');
86
+ fillInTheGapsDropdownPage.steps.allotPoints(7);
87
+ fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
88
+ fillInTheGapsDropdownPage.alternateAnswerButton()
89
+ .click();
90
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'Alternate correct answer 1');
91
+ fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'Alternate correct answer 2');
92
+ fillInTheGapsDropdownPage.steps.allotPoints(3);
93
+ fillInTheGapsDropdownPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
94
+ fillInTheGapsDropdownPage.matchFromAllResponsesCheckbox()
95
+ .click();
96
+ fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
97
+ fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
98
+ .click();
99
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
100
+ });
101
+
102
+ fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - dropdown')
103
+ });
104
+ });