itemengine-cypress-automation 1.0.574-IEI-7080-e6d1871.0 → 1.0.574-IEI-7071-main-360bc22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ describe('Create item page - Fill in the gaps with text: Partial different weigh
25
25
  fillInTheGapsTextPage.steps.switchToPreviewTab();
26
26
  });
27
27
 
28
- it.only('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective response area numeration', () => {
28
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective response area numeration', () => {
29
29
  fillInTheGapsTextPage.steps.switchToGradingView();
30
30
  fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
31
31
  if (alternativeAnswerCheck) {
@@ -0,0 +1,63 @@
1
+ import { shortTextResponsePage } from "../../../../pages/shortTextResponsePage";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Short text response: All or nothing with alternative answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Alternative answer\' points are more than \'Correct answer\' points', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
14
+ cy.barsPreLoaderWait();
15
+ 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.');
16
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
17
+ shortTextResponsePage.steps.allotPoints(10);
18
+ shortTextResponsePage.steps.clickOnAddAlternativeAnswerButton();
19
+ shortTextResponsePage.steps.allotPoints(20);
20
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
21
+ shortTextResponsePage.steps.switchToPreviewTab();
22
+ });
23
+
24
+ it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed and answer input field should have incorrect answer border and correct answer section should be displayed below response input field', () => {
25
+ shortTextResponsePage.steps.switchToGradingView();
26
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
27
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
28
+ shortTextResponsePage.steps.switchToStudentView();
29
+ });
30
+
31
+ it('When the user attempts the question with response from the correct accordion, then the user should be awarded with points specified for correct accordion (less than overall points) and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed and correct answer section should not be displayed', () => {
32
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
33
+ shortTextResponsePage.steps.verifyPreviewScore(10, 20);
34
+ shortTextResponsePage.steps.switchToGradingView();
35
+ shortTextResponsePage.steps.verifyCorrectIcon();
36
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
37
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
38
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
39
+ });
40
+
41
+ it('When the user attempts the question with response from the alternative accordion, then the user should be awarded with points specified for alternative accordion and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed and correct answer section should not be displayed', () => {
42
+ shortTextResponsePage.steps.resetQuestionPreview();
43
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
44
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
45
+ shortTextResponsePage.steps.switchToGradingView();
46
+ shortTextResponsePage.steps.verifyCorrectIcon();
47
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
48
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
49
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
50
+ });
51
+
52
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed beside response input field, incorrect answer border and correct answer section should be displayed', () => {
53
+ shortTextResponsePage.steps.resetQuestionPreview();
54
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil');
55
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
56
+ shortTextResponsePage.steps.switchToGradingView();
57
+ shortTextResponsePage.steps.verifyIncorrectIcon();
58
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
59
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Fossil fuel combustion');
60
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
61
+ });
62
+ });
63
+ });
@@ -0,0 +1,63 @@
1
+ import { shortTextResponsePage } from "../../../../pages/shortTextResponsePage";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Short text response: All or nothing with alternative answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points is equal to \'Alternative answer\' points', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
14
+ cy.barsPreLoaderWait();
15
+ 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.');
16
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
17
+ shortTextResponsePage.steps.allotPoints(20);
18
+ shortTextResponsePage.steps.clickOnAddAlternativeAnswerButton();
19
+ shortTextResponsePage.steps.allotPoints(20);
20
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
21
+ shortTextResponsePage.steps.switchToPreviewTab();
22
+ });
23
+
24
+ it('When the user switches to \'Grading\' view without attempting the question, then incorrect border and correct answer section should be displayed', () => {
25
+ shortTextResponsePage.steps.switchToGradingView();
26
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
27
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
28
+ shortTextResponsePage.steps.switchToStudentView();
29
+ });
30
+
31
+ it('When the user attempts the question with response from the correct accordion, then the user should be awarded with points specified for correct accordion and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed and correct answer section should not be displayed', () => {
32
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
33
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
34
+ shortTextResponsePage.steps.switchToGradingView();
35
+ shortTextResponsePage.steps.verifyCorrectIcon();
36
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
37
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
38
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
39
+ });
40
+
41
+ it('When the user attempts the question with response from the alternative accordion, then the user should be awarded with points specified for alternative accordion (same as correct answer points) and on switching to \'Grading\' view, correct icon should only be displayed beside response input field, correct answer border and correct answer section should not be displayed in question preview', () => {
42
+ shortTextResponsePage.steps.resetQuestionPreview();
43
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
44
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
45
+ shortTextResponsePage.steps.switchToGradingView();
46
+ shortTextResponsePage.steps.verifyCorrectIcon();
47
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
48
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
49
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
50
+ });
51
+
52
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed beside response input field, incorrect answer border and correct answer section should be displayed in question preview', () => {
53
+ shortTextResponsePage.steps.resetQuestionPreview();
54
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
55
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
56
+ shortTextResponsePage.steps.switchToGradingView();
57
+ shortTextResponsePage.steps.verifyIncorrectIcon();
58
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
59
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
60
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
61
+ });
62
+ });
63
+ });
@@ -0,0 +1,87 @@
1
+ import { shortTextResponsePage } from "../../../../pages/shortTextResponsePage";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Short text response: All or nothing with alternative answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points are more than \'Alternative answer\' points', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
14
+ cy.barsPreLoaderWait();
15
+ 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.');
16
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
17
+ shortTextResponsePage.steps.allotPoints(20);
18
+ shortTextResponsePage.steps.clickOnAddAlternativeAnswerButton();
19
+ shortTextResponsePage.steps.allotPoints(10);
20
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Fossil fuel combustion');
21
+ shortTextResponsePage.steps.switchToPreviewTab();
22
+ });
23
+
24
+ it('When the user selects \'Grading\' view without attempting the question then incorrect answer border and correct answer section should be displayed and correct/incorrect icons should not be displayed', () => {
25
+ shortTextResponsePage.steps.switchToGradingView();
26
+ shortTextResponsePage.steps.verifyCorrectIncorrectIconNotVisibleGradingView();
27
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
28
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
29
+ shortTextResponsePage.steps.switchToStudentView();
30
+ });
31
+
32
+ it('When the user attempts the question with response from the correct accordion, then the user should be awarded with points specified for correct accordion and on switching to \'Grading\' view, correct icon and correct answer border should be displayed and correct answer section should not be displayed', () => {
33
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
34
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
35
+ shortTextResponsePage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
36
+ shortTextResponsePage.steps.switchToGradingView();
37
+ shortTextResponsePage.steps.verifyCorrectIcon();
38
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
39
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
40
+ });
41
+
42
+ shortTextResponsePage.tests.verifyPointsCorrectAnswerLabelAndBorderCSSAndA11y('short text response');
43
+
44
+ it('When the user attempts the question with response from the alternative accordion, then the user should be awarded with points specified for alternative accordion (less than overall points) and on switching to \'Grading\' view, correct icon should be displayed beside response input field and correct answer border be displayed and correct answer section should not be displayed', () => {
45
+ shortTextResponsePage.steps.resetQuestionPreview();
46
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
47
+ shortTextResponsePage.steps.verifyPreviewScore(10, 20);
48
+ shortTextResponsePage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
49
+ shortTextResponsePage.steps.switchToGradingView();
50
+ shortTextResponsePage.steps.verifyCorrectIcon();
51
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
52
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
53
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
54
+ });
55
+
56
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed beside response input field, incorrect answer border and correct answer section should be displayed in question preview', () => {
57
+ shortTextResponsePage.steps.resetQuestionPreview();
58
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect answer');
59
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
60
+ shortTextResponsePage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
61
+ shortTextResponsePage.steps.switchToGradingView();
62
+ shortTextResponsePage.steps.verifyIncorrectIcon();
63
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
64
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
65
+ });
66
+
67
+ shortTextResponsePage.tests.verifyIncorrectAnswerLabelAndBorderCSSAndA11y('short text response');
68
+
69
+ it('When the user sets \'Award minimum score only if attempted\' in minimum scoring dropdown and allots minimum points such that minimum points are less than alternative answer points, then attempts the question with response from the alternative accordion, the user should be awarded with alternative answer points', () => {
70
+ shortTextResponsePage.steps.switchToEditTab();
71
+ shortTextResponsePage.steps.expandMinimumScoringDropdown();
72
+ shortTextResponsePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
73
+ shortTextResponsePage.steps.allotMinimumPoints(3);
74
+ shortTextResponsePage.steps.switchToPreviewTab();
75
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
76
+ shortTextResponsePage.steps.verifyPreviewScore(10, 20);
77
+ });
78
+
79
+ it('When the user sets minimum points such that minimum points are greater than alternative answer points, then attempts the question with response from the alternative accordion, the user should be awarded with minimum points', () => {
80
+ shortTextResponsePage.steps.switchToEditTab();
81
+ shortTextResponsePage.steps.allotMinimumPoints(13);
82
+ shortTextResponsePage.steps.switchToPreviewTab();
83
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Fossil fuel combustion');
84
+ shortTextResponsePage.steps.verifyPreviewScore(13, 20);
85
+ });
86
+ });
87
+ });
@@ -0,0 +1,163 @@
1
+ import { shortTextResponsePage } from "../../../../pages/shortTextResponsePage";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Short text response: All or nothing with alternative answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question preview: Auto scored - All or nothing with alternative answer - When \'Correct answer\' points is equal to \'Alternative answer\' points', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
14
+ cy.barsPreLoaderWait();
15
+ 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.');
16
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
17
+ shortTextResponsePage.steps.allotPoints(20);
18
+ shortTextResponsePage.steps.switchToPreviewTab();
19
+ });
20
+
21
+ it('When the user switches to \'Grading\' view without attempting the question, then incorrect border and correct answer section should not be displayed', () => {
22
+ shortTextResponsePage.steps.switchToGradingView();
23
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
24
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
25
+ shortTextResponsePage.steps.switchToStudentView();
26
+ });
27
+
28
+ it('When the user attempts the question correctly, then the user should be awarded with points specified and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed and correct answer section should not be displayed', () => {
29
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
30
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
31
+ shortTextResponsePage.steps.switchToGradingView();
32
+ shortTextResponsePage.steps.verifyCorrectIcon();
33
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
34
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
35
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
36
+ });
37
+
38
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed beside response input field, incorrect answer border and correct answer section should be displayed in question preview', () => {
39
+ shortTextResponsePage.steps.resetQuestionPreview();
40
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
41
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
42
+ shortTextResponsePage.steps.switchToGradingView();
43
+ shortTextResponsePage.steps.verifyIncorrectIcon();
44
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
45
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
46
+ shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
47
+ });
48
+ });
49
+
50
+ describe('Question preview: Auto scored - \'Round negative scores to zero\' penalty scoring', () => {
51
+ abortEarlySetup();
52
+ before(() => {
53
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
54
+ cy.barsPreLoaderWait();
55
+ 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.');
56
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
57
+ shortTextResponsePage.steps.allotPoints(20);
58
+ shortTextResponsePage.steps.expandPenaltyScoringDropdown();
59
+ shortTextResponsePage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
60
+ shortTextResponsePage.steps.allotPenaltyPoints(5);
61
+ shortTextResponsePage.steps.switchToPreviewTab();
62
+ });
63
+
64
+ it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points,\'Round negative scores to zero\' is checked and attempts the question incorrectly, then the user should not be awarded with negative points', () => {
65
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
66
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
67
+ shortTextResponsePage.steps.switchToGradingView();
68
+ shortTextResponsePage.steps.verifyIncorrectIcon();
69
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
70
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
71
+
72
+ });
73
+
74
+ it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points,\'Round negative scores to zero\' is unchecked and attempts the question incorrectly, then the user should not be awarded with negative points', () => {
75
+ shortTextResponsePage.steps.switchToEditTab();
76
+ shortTextResponsePage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
77
+ shortTextResponsePage.steps.switchToPreviewTab();
78
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
79
+ shortTextResponsePage.steps.verifyPreviewScore(-5, 20);
80
+ shortTextResponsePage.steps.switchToGradingView();
81
+ shortTextResponsePage.steps.verifyIncorrectIcon();
82
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
83
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
84
+ });
85
+
86
+ it('When the user attempts the question correctly, then the user should be awarded 20 points and on switching to \'Grading\' view, correct icon should be displayed beside response input field, correct answer border should be displayed in question preview', () => {
87
+ shortTextResponsePage.steps.resetQuestionPreview();
88
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
89
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
90
+ shortTextResponsePage.steps.switchToGradingView();
91
+ shortTextResponsePage.steps.verifyCorrectIcon();
92
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
93
+ shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
94
+ });
95
+ });
96
+
97
+ describe('Question preview: Auto scored - minimum scoring', () => {
98
+ abortEarlySetup();
99
+ before(() => {
100
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
101
+ cy.barsPreLoaderWait();
102
+ 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.');
103
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
104
+ shortTextResponsePage.steps.allotPoints(20);
105
+ shortTextResponsePage.steps.expandMinimumScoringDropdown();
106
+ shortTextResponsePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
107
+ shortTextResponsePage.steps.allotMinimumPoints(5);
108
+ shortTextResponsePage.steps.switchToPreviewTab();
109
+ });
110
+
111
+ it('When the user sets minimum scoring to \'Award minimum score\', allots minimum points going to student view without attempting the question, then the user should be awarded with minimum points', () => {
112
+ shortTextResponsePage.steps.verifyPreviewScore(5, 20);
113
+ shortTextResponsePage.steps.switchToGradingView();
114
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
115
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
116
+ });
117
+
118
+ it('When the user sets minimum scoring to \'Award minimum score\', allots minimum points and attempts the question incorrectly, then the user should be awarded with minimum points', () => {
119
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
120
+ shortTextResponsePage.steps.verifyPreviewScore(5, 20);
121
+ shortTextResponsePage.steps.switchToGradingView();
122
+ shortTextResponsePage.steps.verifyIncorrectIcon();
123
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
124
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
125
+ });
126
+
127
+ it('When the user sets minimum scoring to \'Award minimum score\', allots minimum points and attempts the question correctly, then the user should be awarded with 20 points', () => {
128
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
129
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
130
+ shortTextResponsePage.steps.switchToGradingView();
131
+ shortTextResponsePage.steps.verifyCorrectIcon();
132
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
133
+ });
134
+
135
+ it('When the user sets minimum scoring to \'Award minimum score only if attempted\', allots minimum points going to student view without attempting the question, then the user should be awarded with minimum points', () => {
136
+ shortTextResponsePage.steps.switchToEditTab();
137
+ shortTextResponsePage.steps.expandMinimumScoringDropdown();
138
+ shortTextResponsePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
139
+ shortTextResponsePage.steps.allotMinimumPoints(5);
140
+ shortTextResponsePage.steps.switchToPreviewTab();
141
+ shortTextResponsePage.steps.verifyPreviewScore(0, 20);
142
+ shortTextResponsePage.steps.switchToGradingView();
143
+ shortTextResponsePage.steps.verifyCorrectIncorrectBorderNotExist();
144
+ });
145
+
146
+ it('When the user sets minimum scoring to \'Award minimum score only if attempted\', allots minimum points and attempts the question incorrectly, then the user should be awarded with minimum points', () => {
147
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect');
148
+ shortTextResponsePage.steps.verifyPreviewScore(5, 20);
149
+ shortTextResponsePage.steps.switchToGradingView();
150
+ shortTextResponsePage.steps.verifyIncorrectIcon();
151
+ shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
152
+ shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
153
+ });
154
+
155
+ it('When the user sets minimum scoring to \'Award minimum score only if attempted\', allots minimum points and attempts the question correctly, then the user should be awarded with 20 points', () => {
156
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Buildings');
157
+ shortTextResponsePage.steps.verifyPreviewScore(20, 20);
158
+ shortTextResponsePage.steps.switchToGradingView();
159
+ shortTextResponsePage.steps.verifyCorrectIcon();
160
+ shortTextResponsePage.steps.verifyCorrectAttemptBorder();
161
+ });
162
+ });
163
+ });
@@ -1,6 +1,6 @@
1
- import { shortTextResponsePage } from "../../../pages";
2
- import abortEarlySetup from "../../../support/helpers/abortEarly";
3
- import utilities from "../../../support/helpers/utilities";
1
+ import { shortTextResponsePage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
6
  describe('Create Item page - Short text response: Scoring Section - Manually scored and Non scored', () => {
@@ -13,7 +13,7 @@ describe('Create Item page - Short text response: Scoring Section - Manually sco
13
13
  before(() => {
14
14
  cy.log('Adding question instructions and correct answer response, select Manually scored scoring type and add points for the question');
15
15
  shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
16
- shortTextResponsePage.steps.addQuestionInstructions();
16
+ shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('short text response instruction');
17
17
  shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
18
18
  shortTextResponsePage.steps.allotPoints(20);
19
19
  shortTextResponsePage.steps.expandScoringTypeDropdown();
@@ -22,9 +22,8 @@ describe('Create Item page - Short text response: Scoring Section - Manually sco
22
22
  shortTextResponsePage.steps.switchToPreviewTab();
23
23
  });
24
24
 
25
- //need to remove skip after https://redmine.zeuslearning.com/issues/571485 is resolved
26
- it.skip('In Preview tab, Question Instructions and response field should be displayed', () => {
27
- shortTextResponsePage.steps.verifyQuestionInstructionsText();
25
+ it('In Preview tab, Question Instructions and response field should be displayed', () => {
26
+ shortTextResponsePage.steps.verifyQuestionInstructionsTextPreviewTab('short text response instruction');
28
27
  utilities.verifyElementVisibilityState(shortTextResponsePage.previewTabResponseField(), 'visible');
29
28
  });
30
29
 
@@ -43,7 +42,6 @@ describe('Create Item page - Short text response: Scoring Section - Manually sco
43
42
  shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Buildings');
44
43
  shortTextResponsePage.steps.expandScoringTypeDropdown();
45
44
  shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Non scored');
46
- //shortTextResponsePage.steps.checkAllowStudentToCheckAnswerCheckbox();
47
45
  shortTextResponsePage.steps.switchToPreviewTab();
48
46
  });
49
47
 
@@ -63,11 +61,6 @@ describe('Create Item page - Short text response: Scoring Section - Manually sco
63
61
  shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
64
62
  shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Buildings');
65
63
  shortTextResponsePage.steps.switchToStudentView();
66
- /*cy.log('When the user clicks on \'Check answer\' button, red cross mark icon should be displayed besides the response field, Incorrect answer label and border should not be displayed and no correct answer wrapper should be displayed');
67
- shortTextResponsePage.steps.checkAnswer();
68
- shortTextResponsePage.steps.verifyIncorrectIcon();
69
- shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
70
- shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();*/
71
64
  });
72
65
 
73
66
  it('When user attempts the question correctly, then on switching to \'Grading\' view, then correct icons should be displayed beside correct response and correct answer border should be displayed and correct answer wrapper should not be displayed in the question preview', () => {
@@ -78,11 +71,6 @@ describe('Create Item page - Short text response: Scoring Section - Manually sco
78
71
  shortTextResponsePage.steps.verifyCorrectAttemptBorder();
79
72
  shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
80
73
  shortTextResponsePage.steps.switchToStudentView();
81
- /*cy.log('When the user clicks on \'Check answer\' button, then green checkmark icon should be displayed besides response fields, Correct answer label and border should not be displayed and no correct answer container should be displayed and no correct answer container should be displayed')
82
- shortTextResponsePage.steps.checkAnswer();
83
- shortTextResponsePage.steps.verifyCorrectIcon();
84
- shortTextResponsePage.steps.verifyCorrectAttemptBorder();
85
- shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();*/
86
74
  });
87
75
 
88
76
  it('User should able to save question with non scored scoring type', () => {
@@ -1,10 +1,13 @@
1
- import { shortTextResponsePage } from "../../../pages";
1
+ import { shortTextResponsePage, itemPreviewPage, studentViewPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
6
  const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
7
7
  const clipboardFunctions = ['Cut', 'Copy', 'Paste'];
8
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
9
+ const views = utilities.getViews(correctAnswerViews);
10
+ let itemReferenceID = "";
8
11
 
9
12
  describe('Create Item page - Short text response - drag and drop: Additional settings', () => {
10
13
  before(() => {
@@ -65,6 +68,46 @@ describe('Create Item page - Short text response - drag and drop: Additional set
65
68
  });
66
69
  });
67
70
 
71
+ describe('Additional settings: Clipboard functions functionality in previewTab', () => {
72
+ abortEarlySetup();
73
+ before(() => {
74
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
75
+ cy.barsPreLoaderWait();
76
+ shortTextResponsePage.steps.expandAdditionalSettings();
77
+ });
78
+
79
+ it('When the user deselect cut option, then when try to cut the response from the response field, it should not be cut and a warning message as\'Cut option is disabled\' should be displayed', () => {
80
+ shortTextResponsePage.steps.unselectClipboardFunctionButton(0);
81
+ shortTextResponsePage.steps.switchToPreviewTab();
82
+ shortTextResponsePage.steps.enterTextInAnswerInputField('Apple');
83
+ shortTextResponsePage.steps.cutTextFromAnswerResponseField();
84
+ utilities.verifyInnerText(shortTextResponsePage.warningMessage(), 'Cut is disabled.');
85
+ utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessage(), 'visible');
86
+ });
87
+
88
+ it('When the user deselect copy option, then when try to cut the response from the response field, it should not be cut and a warning message as\'Copy option is disabled\' should be displayed', () => {
89
+ shortTextResponsePage.steps.switchToEditTab();
90
+ shortTextResponsePage.steps.unselectClipboardFunctionButton(1);
91
+ shortTextResponsePage.steps.selectClipboardFunctionButton(0);
92
+ shortTextResponsePage.steps.switchToPreviewTab();
93
+ shortTextResponsePage.steps.enterTextInAnswerInputField('Banana');
94
+ shortTextResponsePage.steps.copyTextFromAnswerResponseField();
95
+ utilities.verifyInnerText(shortTextResponsePage.warningMessage(), 'Copy is disabled.');
96
+ utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessage(), 'visible');
97
+ });
98
+
99
+ it('When the user deselect paste option, then when try to paste the response from the response field, it should not be pasted and a warning message as\'Paste option is disabled\' should be displayed', () => {
100
+ shortTextResponsePage.steps.switchToEditTab();
101
+ shortTextResponsePage.steps.unselectClipboardFunctionButton(2);
102
+ shortTextResponsePage.steps.selectClipboardFunctionButton(1);
103
+ shortTextResponsePage.steps.switchToPreviewTab();
104
+ shortTextResponsePage.steps.enterTextInAnswerInputField('Cherry');
105
+ shortTextResponsePage.steps.pasteTextFromAnswerResponseField();
106
+ utilities.verifyInnerText(shortTextResponsePage.warningMessage(), 'Paste is disabled.');
107
+ utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessage(), 'visible');
108
+ });
109
+ });
110
+
68
111
  describe('Additional settings: Placeholder text', () => {
69
112
  abortEarlySetup();
70
113
  before(() => {
@@ -236,7 +279,7 @@ describe('Create Item page - Short text response - drag and drop: Additional set
236
279
  });
237
280
  });
238
281
  });
239
-
282
+
240
283
  describe('Setting tab: Accessibility section', () => {
241
284
  abortEarlySetup();
242
285
  before(() => {
@@ -370,4 +413,58 @@ describe('Create Item page - Short text response - drag and drop: Additional set
370
413
 
371
414
  shortTextResponsePage.tests.verifyDetailsSection();
372
415
  });
416
+
417
+ views.forEach((view) => {
418
+ describe(`${view}: Additional Settings: Clipboard functions`, () => {
419
+ abortEarlySetup();
420
+ before(() => {
421
+ switch (view) {
422
+ case 'Question preview':
423
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
424
+ cy.barsPreLoaderWait();
425
+ shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Correct answer');
426
+ shortTextResponsePage.steps.allotPoints(10);
427
+ shortTextResponsePage.steps.expandAdditionalSettings();
428
+ shortTextResponsePage.steps.deselectAllClipboardFunctionButton();
429
+ shortTextResponsePage.steps.switchToPreviewTab();
430
+ break;
431
+ case 'Item preview':
432
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
433
+ itemPreviewPage.steps.switchToPreviewTab();
434
+ break;
435
+ case 'Student view':
436
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
437
+ break;
438
+ };
439
+ });
440
+
441
+ beforeEach(() => {
442
+ switch (view) {
443
+ case 'Question preview':
444
+ break;
445
+ case 'Item preview':
446
+ shortTextResponsePage.steps.switchToGradingView();
447
+ break;
448
+ case 'Student view':
449
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
450
+ break;
451
+ }
452
+ });
453
+
454
+ if (view === 'Question preview') {
455
+ after(() => {
456
+ shortTextResponsePage.steps.clickOnSaveQuestionButton();
457
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
458
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
459
+ });
460
+ };
461
+
462
+ it(`When the user deselect all the Clipboard functions option and try to ${clipboardFunctions} then warning message \'Cut, copy and paste options are disabled.\' should be displayed in ${view}`, () => {
463
+ shortTextResponsePage.steps.enterTextInAnswerInputField('Apple');
464
+ shortTextResponsePage.steps.copyTextFromAnswerResponseField();
465
+ utilities.verifyElementVisibilityState(shortTextResponsePage.warningMessageContainer(), 'visible');
466
+ utilities.verifyInnerText(shortTextResponsePage.warningMessageContainer(), 'Cut, copy and paste options are disabled.');
467
+ });
468
+ });
469
+ });
373
470
  });