itemengine-cypress-automation 1.0.113 → 1.0.114
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
- package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
- package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
- package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
- package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
- package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
- package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
- package/cypress/pages/audioResponsePage.js +523 -66
- package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
- package/cypress/pages/components/equationEditorFlyout.js +11 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
- package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
- package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
- package/cypress/pages/components/questionInputFieldComponent.js +0 -7
- package/cypress/pages/essayResponseBasicPage.js +1 -26
- package/cypress/pages/essayResponsePage.js +21 -284
- package/cypress/pages/shortTextResponsePage.js +142 -103
- package/cypress/pages/textEntryMathPage.js +58 -7
- package/package.json +1 -1
@@ -0,0 +1,163 @@
|
|
1
|
+
import { textEntryMathPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import { equationEditorFlyout } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
let checkAnswerViews = ['Question preview', 'Item preview', 'Student view'];
|
6
|
+
const views = utilities.getViews(checkAnswerViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
describe('Create item page - Text entry math - Check answer functionality', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
views.forEach((view) => {
|
15
|
+
const checkAnswer = (view) => {
|
16
|
+
switch (view) {
|
17
|
+
case checkAnswerViews[0]:
|
18
|
+
case checkAnswerViews[1]:
|
19
|
+
textEntryMathPage.steps.checkAnswer();
|
20
|
+
break;
|
21
|
+
case checkAnswerViews[2]:
|
22
|
+
studentViewPage.steps.checkAnswer();
|
23
|
+
break;
|
24
|
+
default:
|
25
|
+
throw new Error(`Unsupported page identifier: ${view}`);
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
describe(`Check answer functionality - ${view}`, { tags: 'smoke' }, () => {
|
30
|
+
abortEarlySetup();
|
31
|
+
before(() => {
|
32
|
+
switch (view) {
|
33
|
+
case 'Question preview':
|
34
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
35
|
+
cy.barsPreLoaderWait();
|
36
|
+
textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
|
37
|
+
textEntryMathPage.steps.addResponseToken();
|
38
|
+
textEntryMathPage.steps.addResponseToken();
|
39
|
+
textEntryMathPage.steps.addResponseToken();
|
40
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
41
|
+
textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
|
42
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
43
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
44
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
45
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
46
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
|
47
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
|
48
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
49
|
+
equationEditorFlyout.steps.enterEquationUsingPiSymbol();
|
50
|
+
textEntryMathPage.steps.allotPoints(20);
|
51
|
+
textEntryMathPage.steps.checkAllowStudentToCheckAnswerCheckbox();
|
52
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
53
|
+
break;
|
54
|
+
case 'Item preview':
|
55
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
56
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
57
|
+
break;
|
58
|
+
case 'Student view':
|
59
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
60
|
+
break;
|
61
|
+
}
|
62
|
+
});
|
63
|
+
|
64
|
+
beforeEach(() => {
|
65
|
+
switch (view) {
|
66
|
+
case 'Question preview':
|
67
|
+
textEntryMathPage.steps.switchToStudentView();
|
68
|
+
textEntryMathPage.steps.resetQuestionPreview();
|
69
|
+
break;
|
70
|
+
case 'Item preview':
|
71
|
+
textEntryMathPage.steps.switchToStudentView();
|
72
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
73
|
+
break;
|
74
|
+
case 'Student view':
|
75
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
76
|
+
break;
|
77
|
+
}
|
78
|
+
});
|
79
|
+
|
80
|
+
if (view === 'Question preview') {
|
81
|
+
after(() => {
|
82
|
+
textEntryMathPage.steps.clickOnSaveQuestionButton();
|
83
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
84
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
85
|
+
});
|
86
|
+
};
|
87
|
+
|
88
|
+
it('When the user selects \'Check answer\' button without attempting the question, then correct/incorrect icons, correct/incorrect answer label and border should not be displayed', () => {
|
89
|
+
checkAnswer(view);
|
90
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
91
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
92
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
93
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
94
|
+
textEntryMathPage.steps.verifyCorrectAnswerSectionNotExists();
|
95
|
+
});
|
96
|
+
|
97
|
+
it('When the user attempts the question incorrectly, then on clicking Check answer button, incorrect icons should be displayed besides all responses, and \'Your answer is incorrect\' should be displayed', () => {
|
98
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
99
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 1');
|
100
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
101
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
102
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 2');
|
103
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
104
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
|
105
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 3');
|
106
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
107
|
+
checkAnswer(view);
|
108
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
|
109
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(1);
|
110
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(2);
|
111
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
112
|
+
textEntryMathPage.steps.verifyCorrectAnswerSectionNotExists();
|
113
|
+
});
|
114
|
+
|
115
|
+
it('When the user attempts the question partially correct, then on clicking Check answer button, correct icons should be displayed beside the correct responses, incorrect icons should be displayed beside the incorrect responses, and \'Your answer is incorrect\' should be displayed', () => {
|
116
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
117
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
118
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
119
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
120
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
121
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
|
122
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('6*3.14');
|
123
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
124
|
+
checkAnswer(view);
|
125
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(0);
|
126
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(1);
|
127
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(2);
|
128
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
129
|
+
textEntryMathPage.steps.verifyCorrectAnswerSectionNotExists();
|
130
|
+
});
|
131
|
+
|
132
|
+
it('When the user attempts the question partially correct with a incomplete response, then on clicking Check answer button, incorrect icons should be displayed beside the incorrect responses, no icons should be displayed beside unattempted responses and \'Your answer is incorrect\' should be displayed', () => {
|
133
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
134
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
135
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
136
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
137
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
138
|
+
checkAnswer(view);
|
139
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(0);
|
140
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(1);
|
141
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
142
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
143
|
+
textEntryMathPage.steps.verifyCorrectAnswerSectionNotExists();
|
144
|
+
});
|
145
|
+
|
146
|
+
it('When user attempts the question correctly, then on clicking Check answer button, then correct icons should be displayed beside all the responses, and \'Your answer is correct\' should be displayed', () => {
|
147
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
148
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
149
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
150
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1)
|
151
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
152
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
|
153
|
+
equationEditorFlyout.steps.enterEquationUsingPiSymbol();
|
154
|
+
checkAnswer(view);
|
155
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(0);
|
156
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(1);
|
157
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(2);
|
158
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
159
|
+
textEntryMathPage.steps.verifyCorrectAnswerSectionNotExists();
|
160
|
+
});
|
161
|
+
});
|
162
|
+
});
|
163
|
+
});
|
@@ -357,15 +357,15 @@ describe('Create item page - Text entry math: Equivalent structure evaluation me
|
|
357
357
|
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
358
358
|
});
|
359
359
|
|
360
|
-
it('When user has selected \'Fraction\' from the syntax dropdown and user enters input using decimal fractions in preview tab response fields they should be treated as
|
360
|
+
it('When user has selected \'Fraction\' from the syntax dropdown and user enters input using decimal fractions in preview tab response fields they should be treated as incorrect', () => {
|
361
361
|
textEntryMathPage.steps.resetQuestionPreview();
|
362
362
|
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
363
363
|
equationEditorFlyout.steps.enterEquation([{ categoryName: 'basic', symbolName: ['fraction'] }, { categoryName: 'keypad', symbolName: ['four'] }]);
|
364
364
|
equationEditorFlyout.steps.enterTextInFirstEmptyBox(['9.2']);
|
365
365
|
equationEditorFlyout.steps.clickOnOkButton();
|
366
366
|
textEntryMathPage.steps.switchToGradingView();
|
367
|
-
textEntryMathPage.steps.
|
368
|
-
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('
|
367
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
|
368
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
369
369
|
});
|
370
370
|
|
371
371
|
it('When user has selected \'Fraction\' from the syntax dropdown and user enters input using symbols in the form of fractions in preview tab response fields they should be treated as incorrect', () => {
|
@@ -468,7 +468,7 @@ describe('Create item page - Text entry math: Equivalent structure evaluation me
|
|
468
468
|
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
469
469
|
});
|
470
470
|
|
471
|
-
it('When user has selected \'Mixed fraction\' from the syntax dropdown and user enters input using decimal mixed fractions in preview tab response fields they should be treated as
|
471
|
+
it('When user has selected \'Mixed fraction\' from the syntax dropdown and user enters input using decimal mixed fractions in preview tab response fields they should be treated as incorrect', () => {
|
472
472
|
textEntryMathPage.steps.resetQuestionPreview();
|
473
473
|
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
474
474
|
equationEditorFlyout.steps.enterTextInPreviewInputField('1.3');
|
@@ -476,8 +476,8 @@ describe('Create item page - Text entry math: Equivalent structure evaluation me
|
|
476
476
|
equationEditorFlyout.steps.enterTextInFirstEmptyBox(['2.4', '8.6']);
|
477
477
|
equationEditorFlyout.steps.clickOnOkButton();
|
478
478
|
textEntryMathPage.steps.switchToGradingView();
|
479
|
-
textEntryMathPage.steps.
|
480
|
-
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('
|
479
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
|
480
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
481
481
|
});
|
482
482
|
|
483
483
|
it('When user has selected \'Mixed fraction\' from the syntax dropdown and user enters input using symbols in the symbols and fractions in preview tab response fields they should be treated as incorrect', () => {
|
@@ -1138,8 +1138,8 @@ describe('Create item page - Text entry math: Equivalent structure evaluation me
|
|
1138
1138
|
equationEditorFlyout.steps.enterEquation([{ categoryName: 'relationships', symbolName: ['lessThan'] }, { categoryName: 'keypad', symbolName: ['two'] }, { categoryName: 'greek', symbolName: ['pi'] }]);
|
1139
1139
|
equationEditorFlyout.steps.clickOnOkButton();
|
1140
1140
|
textEntryMathPage.steps.switchToGradingView();
|
1141
|
-
textEntryMathPage.steps.
|
1142
|
-
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('
|
1141
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
|
1142
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
1143
1143
|
});
|
1144
1144
|
|
1145
1145
|
it('When user has selected \'Equation\' from the syntax dropdown and user enters input addition of matrices in preview tab response fields they should be treated as correct', () => {
|
@@ -178,14 +178,14 @@ describe('Create item page - Text entry math: Value is equivalent evaluation met
|
|
178
178
|
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
179
179
|
});
|
180
180
|
|
181
|
-
it('When the user enters polynomial quadratic equations in \'Specify correct answer\' and the user enters the same equation in different order then it should be treated as
|
181
|
+
it('When the user enters polynomial quadratic equations in \'Specify correct answer\' and the user enters the same equation in different order then it should be treated as incorrect', () => {
|
182
182
|
textEntryMathPage.steps.resetQuestionPreview();
|
183
183
|
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
184
184
|
equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['four'] }, { categoryName: 'basic', symbolName: ['y', 'x', 'add'] }, { categoryName: 'keypad', symbolName: ['two'] }, { categoryName: 'basic', symbolName: ['x', 'square', 'y', 'square', 'add'] }, { categoryName: 'keypad', symbolName: ['four'] }]);
|
185
185
|
equationEditorFlyout.steps.clickOnOkButton();
|
186
186
|
textEntryMathPage.steps.switchToGradingView();
|
187
|
-
textEntryMathPage.steps.
|
188
|
-
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('
|
187
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
|
188
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
189
189
|
});
|
190
190
|
|
191
191
|
it('When the user enters a equation with iota in \'Specify correct answer\' response field and then the user enters the exact same equation then it should be treated as correct', () => {
|
@@ -0,0 +1,154 @@
|
|
1
|
+
import { textEntryMathPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import { equationEditorFlyout } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
7
|
+
const views = utilities.getViews(previewContentViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
|
10
|
+
describe('Create item page - Text entry math: Preview contents', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
views.forEach((view) => {
|
16
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
17
|
+
abortEarlySetup();
|
18
|
+
before(() => {
|
19
|
+
switch (view) {
|
20
|
+
case 'Question preview':
|
21
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
22
|
+
cy.barsPreLoaderWait();
|
23
|
+
textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
|
24
|
+
textEntryMathPage.steps.addResponseToken();
|
25
|
+
textEntryMathPage.steps.addResponseToken();
|
26
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
27
|
+
textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
|
28
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
29
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
30
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
31
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
32
|
+
textEntryMathPage.steps.allotPoints(10);
|
33
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
34
|
+
break;
|
35
|
+
case 'Item view':
|
36
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
37
|
+
break;
|
38
|
+
case 'Item preview':
|
39
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
40
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
41
|
+
break;
|
42
|
+
case 'Student view':
|
43
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
44
|
+
break;
|
45
|
+
case 'Grading view':
|
46
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
47
|
+
break;
|
48
|
+
case 'Correct answer view':
|
49
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
50
|
+
break;
|
51
|
+
default:
|
52
|
+
throw new Error('Invalid view');
|
53
|
+
}
|
54
|
+
});
|
55
|
+
|
56
|
+
after(() => {
|
57
|
+
if (view === 'Question preview') {
|
58
|
+
textEntryMathPage.steps.clickOnSaveQuestionButton();
|
59
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'exist');
|
60
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
61
|
+
}
|
62
|
+
if (view === 'Student view') {
|
63
|
+
studentViewPage.steps.submitResponse();
|
64
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
65
|
+
}
|
66
|
+
});
|
67
|
+
|
68
|
+
it('Question instructions should be visible', () => {
|
69
|
+
utilities.verifyInnerText(textEntryMathPage.questionInstructionsText(), 'Enter the correct answer in the response field');
|
70
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.questionInstructionsText(), 'visible');
|
71
|
+
});
|
72
|
+
|
73
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
74
|
+
it(`The two empty response fields should be disabled ${view}`, () => {
|
75
|
+
utilities.verifyTextContent(textEntryMathPage.responseFieldPreviewTab(), '')
|
76
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.responseFieldPreviewTab(), 'visible');
|
77
|
+
utilities.verifyElementCount(textEntryMathPage.responseFieldPreviewTab(), '2');
|
78
|
+
});
|
79
|
+
|
80
|
+
it(`User should able to enter answers in the response fields for ${view}`, () => {
|
81
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
82
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
83
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
84
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(0, 'Correct answer 1');
|
85
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
86
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
87
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(1, '2x2y2+4xy+4');
|
88
|
+
textEntryMathPage.steps.verifyResponseFieldEquationAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
89
|
+
});
|
90
|
+
} else if (view === 'Grading view') {
|
91
|
+
it(`The response fields should be filled with the submitted responses and user should not be able to edit them`, () => {
|
92
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(0, 'Correct answer 1');
|
93
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(1, '2x2y2+4xy+4');
|
94
|
+
textEntryMathPage.steps.verifyResponseFieldEquationAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
95
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
96
|
+
utilities.verifyElementVisibilityState(equationEditorFlyout.dialogBox(), 'notExist');
|
97
|
+
});
|
98
|
+
} else {
|
99
|
+
it(`The response input fields should be displayed filled with correct answers`, () => {
|
100
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(0, 'Correct answer 1');
|
101
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(1, '2x2y2+4xy+4');
|
102
|
+
textEntryMathPage.steps.verifyResponseFieldEquationAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
103
|
+
});
|
104
|
+
}
|
105
|
+
|
106
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
107
|
+
switch (view) {
|
108
|
+
case 'Question preview':
|
109
|
+
case 'Item preview':
|
110
|
+
case 'Item view':
|
111
|
+
case 'Item preview':
|
112
|
+
case 'Student view':
|
113
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.responseFieldPreviewTab(), 0), {
|
114
|
+
'border-color': css.color.activeButtons,
|
115
|
+
'border-style': 'dashed',
|
116
|
+
'background-color': css.color.optionsBg
|
117
|
+
});
|
118
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.responseFieldPreviewTab().find('span'), 0), {
|
119
|
+
'color': css.color.text,
|
120
|
+
'font-size': css.fontSize.default,
|
121
|
+
'font-weight': css.fontWeight.regular
|
122
|
+
});
|
123
|
+
break;
|
124
|
+
case 'Grading view':
|
125
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.responseFieldPreviewTab(), 0), {
|
126
|
+
'border-color': css.color.correctAnswer,
|
127
|
+
'border-style': 'dashed',
|
128
|
+
'background-color': css.color.optionsBg
|
129
|
+
});
|
130
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.responseFieldPreviewTab().find('span'), 0), {
|
131
|
+
'color': css.color.text,
|
132
|
+
'font-size': css.fontSize.default,
|
133
|
+
'font-weight': css.fontWeight.regular
|
134
|
+
});
|
135
|
+
break;
|
136
|
+
case 'Correct answer view':
|
137
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.responseFieldPreviewTab().find('p'), 0), {
|
138
|
+
'color': css.color.text,
|
139
|
+
'font-size': css.fontSize.default,
|
140
|
+
'font-weight': css.fontWeight.regular,
|
141
|
+
});
|
142
|
+
break;
|
143
|
+
default:
|
144
|
+
throw new Error('Invalid view');
|
145
|
+
}
|
146
|
+
});
|
147
|
+
|
148
|
+
it('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
149
|
+
cy.checkAccessibility(textEntryMathPage.questionInstructionsText().parents('[class*="__ContentWrapper"]'));
|
150
|
+
});
|
151
|
+
});
|
152
|
+
});
|
153
|
+
});
|
154
|
+
|