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,109 @@
|
|
1
|
+
import { shortTextResponsePage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
6
|
+
const views = utilities.getViews(previewContentViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
describe('Create item page - Short text response : Preview contents', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
views.forEach((view) => {
|
15
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
switch (view) {
|
19
|
+
case 'Question preview':
|
20
|
+
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
23
|
+
shortTextResponsePage.steps.allotPoints(5);
|
24
|
+
shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('The quick brown fox');
|
25
|
+
shortTextResponsePage.steps.switchToPreviewTab();
|
26
|
+
break;
|
27
|
+
case 'Item view':
|
28
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
29
|
+
break;
|
30
|
+
case 'Item preview':
|
31
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
32
|
+
shortTextResponsePage.steps.switchToPreviewTab();
|
33
|
+
break;
|
34
|
+
case 'Student view':
|
35
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
36
|
+
break;
|
37
|
+
case 'Grading view':
|
38
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
39
|
+
break;
|
40
|
+
case 'Correct answer view':
|
41
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
42
|
+
break;
|
43
|
+
default:
|
44
|
+
throw new Error('Invalid view');
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
after(() => {
|
49
|
+
if (view === 'Question preview') {
|
50
|
+
shortTextResponsePage.steps.clickOnSaveQuestionButton();
|
51
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
52
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
53
|
+
}
|
54
|
+
if (view === 'Student view') {
|
55
|
+
studentViewPage.steps.submitResponse();
|
56
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
57
|
+
}
|
58
|
+
});
|
59
|
+
|
60
|
+
it('Question instructions should be visible', () => {
|
61
|
+
utilities.verifyInnerText(shortTextResponsePage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
62
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.questionInstructionsText(), 'visible');
|
63
|
+
});
|
64
|
+
|
65
|
+
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
66
|
+
it('Answer input field should be visible and by default it should be empty', () => {
|
67
|
+
shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('');
|
68
|
+
utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabResponseField(), 'visible')
|
69
|
+
});
|
70
|
+
|
71
|
+
it('User should be able to enter text in answer input field', () => {
|
72
|
+
shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('The quick brown fox');
|
73
|
+
shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('The quick brown fox');
|
74
|
+
});
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
it(`The response field should be displayed filled with correct answer`, () => {
|
78
|
+
shortTextResponsePage.steps.verifyTextInAnswerInputFieldPreviewTab('The quick brown fox');
|
79
|
+
utilities.verifyElementDisabled(shortTextResponsePage.previewTabResponseField());
|
80
|
+
});
|
81
|
+
}
|
82
|
+
|
83
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
84
|
+
switch (view) {
|
85
|
+
case 'Question preview':
|
86
|
+
case 'Item preview':
|
87
|
+
case 'Item view':
|
88
|
+
case 'Item preview':
|
89
|
+
case 'Student view':
|
90
|
+
utilities.verifyCSS(shortTextResponsePage.previewTabResponseField().parent().find('fieldset'), {
|
91
|
+
'color': css.color.text,
|
92
|
+
'border': `1px solid ${css.color.primaryBtnBg}`
|
93
|
+
});
|
94
|
+
break;
|
95
|
+
case 'Grading view':
|
96
|
+
case 'Correct answer view':
|
97
|
+
shortTextResponsePage.steps.verifyCorrectAttemptBorder();
|
98
|
+
break;
|
99
|
+
default:
|
100
|
+
throw new Error('Invalid view');
|
101
|
+
}
|
102
|
+
});
|
103
|
+
|
104
|
+
it('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
105
|
+
cy.checkAccessibility(shortTextResponsePage.questionInstructionsText().parents('[class*="ContentWrapper"]'));
|
106
|
+
});
|
107
|
+
});
|
108
|
+
});
|
109
|
+
});
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { shortTextResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create Item page - single selection: Specify correct answer, Alternative correct answer', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Specify correct answer section - \'Correct\' accordion', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
cy.log('Navigating to short text response question type');
|
13
|
+
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
});
|
16
|
+
|
17
|
+
shortTextResponsePage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('short text response');
|
18
|
+
|
19
|
+
shortTextResponsePage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
20
|
+
});
|
21
|
+
|
22
|
+
describe('Specify correct answer section - \'Alternative\' accordion', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
before(() => {
|
25
|
+
cy.log('Navigating to single selection question type');
|
26
|
+
shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
|
27
|
+
cy.barsPreLoaderWait();
|
28
|
+
});
|
29
|
+
|
30
|
+
shortTextResponsePage.tests.verifyAutoScoredAddAlternativeAnswerButtonAndValidation('short text response');
|
31
|
+
|
32
|
+
it('When user has added points and set correct answer in the \'Correct\' accordion, then the user should be able to add alternative answer for the question using \'Add alternative answer\' button', () => {
|
33
|
+
shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct answer');
|
34
|
+
shortTextResponsePage.steps.allotPoints(20);
|
35
|
+
shortTextResponsePage.steps.addAlternativeAnswerAccordion(1);
|
36
|
+
});
|
37
|
+
|
38
|
+
it('When user has added an alternate answer accordion, then the newly added alternate answer accordion should be in expanded state and the correct answer accordion should be in collapsed state', () => {
|
39
|
+
shortTextResponsePage.steps.verifyCorrectAnswerAccordionIsCollapsed();
|
40
|
+
shortTextResponsePage.steps.verifyAlternateAnswerAccordionIsExpanded(1);
|
41
|
+
});
|
42
|
+
|
43
|
+
//Failed due to https://redmine.zeuslearning.com/issues/561067
|
44
|
+
shortTextResponsePage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Alternative');
|
45
|
+
|
46
|
+
it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the name for this new accordion should be \'Alternative 2\'', () => {
|
47
|
+
shortTextResponsePage.steps.addAlternativeAnswerAccordion(2);
|
48
|
+
});
|
49
|
+
|
50
|
+
shortTextResponsePage.tests.verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion();
|
51
|
+
|
52
|
+
it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the name of the alternative answer accordions should get updated accordingly', () => {
|
53
|
+
cy.log('specify correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
|
54
|
+
shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Petals');
|
55
|
+
shortTextResponsePage.steps.allotPoints(5);
|
56
|
+
shortTextResponsePage.steps.deleteAlternativeAnswerAccordion(1);
|
57
|
+
shortTextResponsePage.steps.verifyAlternativeAnswerAccordionNotExists(2);
|
58
|
+
shortTextResponsePage.steps.verifyAlternativeAnswerAccordionLabel(1);
|
59
|
+
});
|
60
|
+
|
61
|
+
it('When correct answers and points are set in alternate answer and user clicks on correct answer accordion, then correct answer accordion should be expanded and the alternate answer accordion should be collapsed', () => {
|
62
|
+
shortTextResponsePage.steps.expandCorrectAnswerAccordion();
|
63
|
+
shortTextResponsePage.steps.verifyAlternateAnswerAccordionIsCollapsed(1);
|
64
|
+
});
|
65
|
+
});
|
66
|
+
});
|
@@ -0,0 +1,326 @@
|
|
1
|
+
import { textEntryMathPage, gradingViewPage, itemPreviewPage, studentViewPage, dialogBoxBase } from "../../../pages";
|
2
|
+
import { equationEditorFlyout } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const grepTags = Cypress.env('grepTags');
|
6
|
+
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
7
|
+
const views = utilities.getViews(correctAnswerViews);
|
8
|
+
var itemReferenceID = "";
|
9
|
+
|
10
|
+
describe('Create Item page - Text entry math: All or nothing ', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
16
|
+
describe('Question preview modes: Student view and Grading view', () => {
|
17
|
+
abortEarlySetup();
|
18
|
+
before(() => {
|
19
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
20
|
+
cy.barsPreLoaderWait();
|
21
|
+
textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
|
22
|
+
textEntryMathPage.steps.addResponseToken();
|
23
|
+
textEntryMathPage.steps.addResponseToken();
|
24
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
25
|
+
});
|
26
|
+
|
27
|
+
textEntryMathPage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
|
28
|
+
|
29
|
+
it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
|
30
|
+
textEntryMathPage.steps.switchToEditTab();
|
31
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
32
|
+
textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
|
33
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
34
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
35
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
36
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
37
|
+
textEntryMathPage.steps.allotPoints(20);
|
38
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
39
|
+
textEntryMathPage.steps.verifyPreviewScore(0, 20);
|
40
|
+
});
|
41
|
+
|
42
|
+
it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab, users response should not persist', () => {
|
43
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
44
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField(0, 'Correct answer 1');
|
45
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
46
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
47
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
48
|
+
textEntryMathPage.steps.resetQuestionPreview();
|
49
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(0, '');
|
50
|
+
textEntryMathPage.steps.verifyResponseAreaTextContentPreviewTab(1, '');
|
51
|
+
});
|
52
|
+
});
|
53
|
+
};
|
54
|
+
|
55
|
+
//Failing due to https://redmine.zeuslearning.com/issues/561708, https://redmine.zeuslearning.com/issues/561177
|
56
|
+
views.forEach((view) => {
|
57
|
+
describe(`Text entry math: all or nothing scoring - ${view}`, { tags: 'smoke' }, () => {
|
58
|
+
abortEarlySetup();
|
59
|
+
before(() => {
|
60
|
+
switch (view) {
|
61
|
+
case 'Question preview':
|
62
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
63
|
+
cy.barsPreLoaderWait();
|
64
|
+
textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
|
65
|
+
textEntryMathPage.steps.addResponseToken();
|
66
|
+
textEntryMathPage.steps.addResponseToken();
|
67
|
+
textEntryMathPage.steps.addResponseToken();
|
68
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
69
|
+
textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
|
70
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
71
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
72
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
73
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
74
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
|
75
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
|
76
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
77
|
+
equationEditorFlyout.steps.enterEquationUsingPiSymbol();
|
78
|
+
textEntryMathPage.steps.allotPoints(20);
|
79
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
80
|
+
break;
|
81
|
+
case 'Item preview':
|
82
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
83
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
84
|
+
break;
|
85
|
+
case 'Grading view':
|
86
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
87
|
+
break;
|
88
|
+
}
|
89
|
+
});
|
90
|
+
|
91
|
+
beforeEach(() => {
|
92
|
+
switch (view) {
|
93
|
+
case 'Question preview':
|
94
|
+
textEntryMathPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
95
|
+
textEntryMathPage.steps.resetQuestionPreview();
|
96
|
+
break;
|
97
|
+
case 'Item preview':
|
98
|
+
itemPreviewPage.steps.switchToStudentView();
|
99
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
100
|
+
break;
|
101
|
+
case 'Grading view':
|
102
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
103
|
+
break;
|
104
|
+
}
|
105
|
+
});
|
106
|
+
|
107
|
+
if (view === 'Question preview') {
|
108
|
+
after(() => {
|
109
|
+
textEntryMathPage.steps.clickOnSaveQuestionButton();
|
110
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
111
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
112
|
+
});
|
113
|
+
};
|
114
|
+
|
115
|
+
it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed correct answers section should be displayed with the correct answers, correct answer label and border should not be displayed', () => {
|
116
|
+
if (view === 'Grading view') {
|
117
|
+
studentViewPage.steps.submitResponse();
|
118
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
119
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
120
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
121
|
+
}
|
122
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
123
|
+
textEntryMathPage.steps.switchToGradingView();
|
124
|
+
textEntryMathPage.steps.verifyPreviewScore(0, 20);
|
125
|
+
}
|
126
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.tickIcon(), 'notExist');
|
127
|
+
textEntryMathPage.steps.verifyResponseFieldNumerationPreviewTab();
|
128
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
|
129
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
130
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
|
131
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(0);
|
132
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(1);
|
133
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
134
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, and \'Your answer is incorrect\' label should be displayed', () => {
|
138
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
139
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 1');
|
140
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
141
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
142
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 2');
|
143
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
144
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
|
145
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 3');
|
146
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
147
|
+
if (view === 'Grading view') {
|
148
|
+
studentViewPage.steps.submitResponse();
|
149
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
150
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
151
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
152
|
+
}
|
153
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
154
|
+
textEntryMathPage.steps.verifyPreviewScore(0, 20);
|
155
|
+
textEntryMathPage.steps.switchToGradingView();
|
156
|
+
}
|
157
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
|
158
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(1);
|
159
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(2);
|
160
|
+
textEntryMathPage.steps.verifyResponseFieldNumerationPreviewTab();
|
161
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
|
162
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
163
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
|
164
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
165
|
+
});
|
166
|
+
|
167
|
+
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icons should be displayed besides the correct responses, incorrect icons should be displayed beside the incorrect responses, and \'Your answer is incorrect\' label should be displayed', () => {
|
168
|
+
if (view === 'Grading view') {
|
169
|
+
studentViewPage.steps.clearResponses();
|
170
|
+
}
|
171
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
172
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
173
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
174
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
175
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
176
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
|
177
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('6*3.14');
|
178
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
179
|
+
if (view === 'Grading view') {
|
180
|
+
studentViewPage.steps.submitResponse();
|
181
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
|
182
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
183
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
184
|
+
}
|
185
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
186
|
+
textEntryMathPage.steps.verifyPreviewScore(0, 20);
|
187
|
+
textEntryMathPage.steps.switchToGradingView();
|
188
|
+
}
|
189
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(0);
|
190
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(1);
|
191
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(2);
|
192
|
+
textEntryMathPage.steps.verifyResponseFieldNumerationPreviewTab();
|
193
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
|
194
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
195
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
|
196
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
197
|
+
});
|
198
|
+
|
199
|
+
it('When the user attempts the question partially correct with a incomplete response, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icons should be displayed besides the correct responses and unattempted correct options, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' should be displayed', () => {
|
200
|
+
if (view === 'Grading view') {
|
201
|
+
studentViewPage.steps.clearResponses();
|
202
|
+
}
|
203
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
204
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
205
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
206
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
207
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
208
|
+
if (view === 'Grading view') {
|
209
|
+
studentViewPage.steps.submitResponse();
|
210
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
|
211
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
212
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
213
|
+
}
|
214
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
215
|
+
textEntryMathPage.steps.verifyPreviewScore(0, 20);
|
216
|
+
textEntryMathPage.steps.switchToGradingView();
|
217
|
+
}
|
218
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(0);
|
219
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(1);
|
220
|
+
textEntryMathPage.steps.verifyCorrectIncorrectIconNotExist(2);
|
221
|
+
textEntryMathPage.steps.verifyResponseFieldNumerationPreviewTab();
|
222
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
|
223
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
|
224
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
|
225
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
226
|
+
});
|
227
|
+
|
228
|
+
it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, and \'Your answer is correct\' should be displayed', () => {
|
229
|
+
if (view === 'Grading view') {
|
230
|
+
studentViewPage.steps.clearResponses();
|
231
|
+
}
|
232
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
233
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
|
234
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
235
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
236
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
237
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
|
238
|
+
equationEditorFlyout.steps.enterEquationUsingPiSymbol();
|
239
|
+
if (view === 'Grading view') {
|
240
|
+
studentViewPage.steps.submitResponse();
|
241
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
242
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
243
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
244
|
+
}
|
245
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
246
|
+
textEntryMathPage.steps.verifyPreviewScore(20, 20);
|
247
|
+
textEntryMathPage.steps.switchToGradingView();
|
248
|
+
}
|
249
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(0);
|
250
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(1);
|
251
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(2);
|
252
|
+
textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
253
|
+
textEntryMathPage.steps.verifyCorrectAnswerSectionNotExists();
|
254
|
+
});
|
255
|
+
});
|
256
|
+
});
|
257
|
+
|
258
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
259
|
+
describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
|
260
|
+
abortEarlySetup();
|
261
|
+
before(() => {
|
262
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
263
|
+
cy.barsPreLoaderWait();
|
264
|
+
textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
|
265
|
+
textEntryMathPage.steps.addResponseToken();
|
266
|
+
textEntryMathPage.steps.addResponseToken();
|
267
|
+
textEntryMathPage.steps.addResponseToken();
|
268
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
269
|
+
textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
|
270
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
271
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
272
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
273
|
+
equationEditorFlyout.steps.enterQuadraticEquation();
|
274
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
|
275
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
|
276
|
+
textEntryMathPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
277
|
+
equationEditorFlyout.steps.enterEquationUsingPiSymbol();
|
278
|
+
textEntryMathPage.steps.allotPoints(20);
|
279
|
+
});
|
280
|
+
|
281
|
+
it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
|
282
|
+
textEntryMathPage.steps.expandMinimumScoringDropdown();
|
283
|
+
textEntryMathPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
|
284
|
+
textEntryMathPage.steps.allotMinimumPoints(2);
|
285
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
286
|
+
textEntryMathPage.steps.switchToGradingView();
|
287
|
+
textEntryMathPage.steps.verifyPreviewScore(2, 20);
|
288
|
+
textEntryMathPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
289
|
+
});
|
290
|
+
|
291
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
292
|
+
textEntryMathPage.steps.resetQuestionPreview();
|
293
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
294
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 1');
|
295
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
296
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
297
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 2');
|
298
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
299
|
+
textEntryMathPage.steps.verifyPreviewScore(2, 20);
|
300
|
+
textEntryMathPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
301
|
+
});
|
302
|
+
|
303
|
+
it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
|
304
|
+
textEntryMathPage.steps.switchToEditTab();
|
305
|
+
textEntryMathPage.steps.expandMinimumScoringDropdown();
|
306
|
+
textEntryMathPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
307
|
+
textEntryMathPage.steps.allotMinimumPoints(2);
|
308
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
309
|
+
textEntryMathPage.steps.switchToGradingView();
|
310
|
+
textEntryMathPage.steps.verifyPreviewScore(0, 20);
|
311
|
+
textEntryMathPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
312
|
+
});
|
313
|
+
|
314
|
+
it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
|
315
|
+
textEntryMathPage.steps.resetQuestionPreview();
|
316
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
317
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 1');
|
318
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
319
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
|
320
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 2');
|
321
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
322
|
+
textEntryMathPage.steps.verifyPreviewScore(2, 20);
|
323
|
+
});
|
324
|
+
});
|
325
|
+
};
|
326
|
+
});
|