itemengine-cypress-automation 1.0.13 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettings.js +830 -0
  2. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAutoScoredScoring.js +990 -0
  3. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridEditTabBasicSection.js +588 -0
  4. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridEditTabScoringSection.js +297 -0
  5. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridHeaderSection.js +98 -0
  6. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridManuallyAndNonScoredScoring.js +206 -0
  7. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeights.js +1152 -0
  8. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeights.js +1108 -0
  9. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridRandomizeOptions.js +124 -0
  10. package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridSetCorrectAnswerSection.js +175 -0
  11. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettings.js +2 -487
  12. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAdditionalSettingsBasic.js +336 -0
  13. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseConditionalCheckboxes.js +154 -0
  14. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseContainsConditionalRadioButton.js +166 -0
  15. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseCustomSpecialCharacters.js +167 -0
  16. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseExactConditionalRadioButton.js +157 -0
  17. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseManuallyScoredNonScoredScoringSection.js +1 -1
  18. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseSetCorrectAnswerSection.js +137 -0
  19. package/package.json +1 -1
  20. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseEditTabBasicSections.js +0 -587
  21. package/cypress/e2e/ILC/sorry-cypress-test/spec1.js +0 -18
  22. package/cypress/e2e/ILC/sorry-cypress-test/spec2.js +0 -18
  23. package/cypress/e2e/ILC/sorry-cypress-test/spec3.js +0 -18
@@ -0,0 +1,166 @@
1
+ import { shortTextResponsePage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Short text response: \'Contains text\', \'Case sensitive\' and \'Ignore spaces before and after\'', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('\'Contains text\' radio button is selected, \'Case sensitive\' checkbox is unchecked and \'Ignore spaces before and after\' checkbox is checked', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field, selecting Contains text radio button and checking the allow students to check answer checkbox and switching to Preview tab');
14
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
15
+ shortTextResponsePage.questionInstructionsInputField()
16
+ .type('Question Instructions');
17
+ shortTextResponsePage.pointsInputField()
18
+ .type('4');
19
+ shortTextResponsePage.setCorrectAnswerResponseField()
20
+ .type('Answer input');
21
+ shortTextResponsePage.containsTextRadioButton()
22
+ .click();
23
+ shortTextResponsePage.steps.expandAdditonalSettings();
24
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
25
+ .click();
26
+ shortTextResponsePage.steps.switchToPreviewTab();
27
+ });
28
+
29
+ it('When user gives an answer that contains the set correct answer text with different casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
30
+ cy.log('Pre-step: Switching to preview tab');
31
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
32
+ });
33
+
34
+ it('When user gives an answer that contains the set correct answer text with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
35
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
36
+ });
37
+
38
+ it('When user gives an answer that contains the set correct answer text with extra spaces in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
39
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
40
+ });
41
+
42
+ it('When user gives an answer that contains the set correct answer text with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
43
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
44
+ });
45
+
46
+ it('When user gives an answer that contains the set correct answer text having extra spaces in between its words in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
47
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '0/4', false);
48
+ });
49
+ });
50
+
51
+ describe('\'Contains text\' radio button is selected, \'Case sensitive\' checkbox is checked and \'Ignore spaces before and after\' checkbox is unchecked', () => {
52
+ abortEarlySetup();
53
+ before(() => {
54
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field, selecting Contains text radio button and checking the allow students to check answer checkbox and switching to Preview tab');
55
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
56
+ shortTextResponsePage.questionInstructionsInputField()
57
+ .type('Question Instructions');
58
+ shortTextResponsePage.pointsInputField()
59
+ .type('4');
60
+ shortTextResponsePage.setCorrectAnswerResponseField()
61
+ .type('Answer input');
62
+ shortTextResponsePage.containsTextRadioButton()
63
+ .click();
64
+ shortTextResponsePage.steps.expandAdditonalSettings();
65
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
66
+ .click();
67
+ shortTextResponsePage.caseSensitiveCheckbox()
68
+ .click();
69
+ shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
70
+ .click();
71
+ shortTextResponsePage.steps.switchToPreviewTab();
72
+ });
73
+
74
+ it('When user gives an answer that contains the set correct answer text with different casing in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
75
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
76
+ });
77
+
78
+ it('When user gives an answer that contains the set correct answer text with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
79
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
80
+ });
81
+
82
+ it('When user gives an answer that contains the set correct answer text with extra spaces in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
83
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
84
+ });
85
+
86
+ it('When user gives an answer that contains the set correct answer text with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
87
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
88
+ });
89
+ });
90
+
91
+ describe('\'Contains text\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is unchecked', () => {
92
+ abortEarlySetup();
93
+ before(() => {
94
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field, selecting Contains text radio button, unchecking the Ignore spaces before and after checkbox, checking the allow students to check answer checkbox and switching to preview tab');
95
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
96
+ shortTextResponsePage.questionInstructionsInputField()
97
+ .type('Question Instructions');
98
+ shortTextResponsePage.pointsInputField()
99
+ .type('4');
100
+ shortTextResponsePage.setCorrectAnswerResponseField()
101
+ .type('Answer input');
102
+ shortTextResponsePage.containsTextRadioButton()
103
+ .click();
104
+ shortTextResponsePage.steps.expandAdditonalSettings();
105
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
106
+ .click();
107
+ shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
108
+ .click();
109
+ shortTextResponsePage.steps.switchToPreviewTab();
110
+ });
111
+
112
+ it('When user gives an answer that contains the set correct answer text with different casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
113
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
114
+ });
115
+
116
+ it('When user gives an answer that contains the set correct answer text with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
117
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
118
+ });
119
+
120
+ it('When user gives an answer that contains the set correct answer text with extra spaces in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
121
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
122
+ });
123
+
124
+ it('When user gives an answer that contains the set correct answer text with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
125
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
126
+ });
127
+ });
128
+
129
+ describe('\'Contains text\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is checked', () => {
130
+ abortEarlySetup();
131
+ before(() => {
132
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field, selecting Contains text radio button, checking the Case sensitive checkbox, checking the allow students to check answer checkbox and switching to preview tab');
133
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
134
+ shortTextResponsePage.questionInstructionsInputField()
135
+ .type('Question Instructions');
136
+ shortTextResponsePage.pointsInputField()
137
+ .type('4');
138
+ shortTextResponsePage.setCorrectAnswerResponseField()
139
+ .type('Answer input');
140
+ shortTextResponsePage.containsTextRadioButton()
141
+ .click();
142
+ shortTextResponsePage.caseSensitiveCheckbox()
143
+ .click();
144
+ shortTextResponsePage.steps.expandAdditonalSettings();
145
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
146
+ .click();
147
+ shortTextResponsePage.steps.switchToPreviewTab();
148
+ });
149
+
150
+ it('When user gives an answer that contains the set correct answer text with different casing in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
151
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
152
+ });
153
+
154
+ it('When user gives an answer that contains the set correct answer text with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
155
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
156
+ });
157
+
158
+ it('When user gives an answer that contains the set correct answer text with extra spaces in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
159
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
160
+ });
161
+
162
+ it('When user gives an answer that contains the set correct answer text with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
163
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
164
+ });
165
+ });
166
+ });
@@ -0,0 +1,167 @@
1
+ import { dialogBoxBase, shortTextResponsePage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import { specialOrMathCharacters } from "../../../fixtures/specialAndMathCharacters";
4
+ const css = Cypress.env('css');
5
+ let customSpecialCharacters = [':', ')', '`']
6
+
7
+ describe('Short text response - Additional settings', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Additional Settings: Custom special characters section', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
16
+ shortTextResponsePage.steps.expandAdditonalSettings();
17
+ });
18
+
19
+ shortTextResponsePage.tests.verifyAdditionalSettingsCustomSpecialCharactersSection();
20
+
21
+ it('When the user checks the \'Display special characters\' checkbox then the \'Special characters\' button should be displayed when user focuses in the response field in set correct answer section ', () => {
22
+ cy.log('Checking Custom characters button is not visible before focusing any option')
23
+ shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
24
+ .should('not.have.class', 'active-special-character-button')
25
+ .should('not.be.visible');
26
+ shortTextResponsePage.setCorrectAnswerResponseField()
27
+ .click();
28
+ shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
29
+ .should('have.class', 'active-special-character-button')
30
+ .should('be.visible');
31
+ });
32
+
33
+ it('When the user has added no input to the \'Custom special characters\' input field then the default Special characters flyout should be displayed on clicking the \'Special characters\' button in the response field', () => {
34
+ shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
35
+ .should('be.visible')
36
+ .click();
37
+ shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
38
+ });
39
+
40
+ shortTextResponsePage.tests.verifySpecialCharactersFlyoutSymbols()
41
+
42
+ it(`When user clicks on a symbol in the ${specialOrMathCharacters['specialCharacters'].popupTitle} popup, then that symbol should be inserted in the response field`, () => {
43
+ cy.log('Clicking on all symbols.');
44
+ let symbolsString = specialOrMathCharacters['specialCharacters'].characters.map((icon) => icon.symbol);
45
+ symbolsString = symbolsString.join('');
46
+ shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
47
+ dialogBoxBase.steps.closeWarningPopup();
48
+ shortTextResponsePage.setCorrectAnswerResponseField()
49
+ .should('have.value', symbolsString);
50
+ cy.log('Post step: Clearing the set correct answer input field')
51
+ shortTextResponsePage.setCorrectAnswerResponseField()
52
+ .clear();
53
+ });
54
+
55
+ it('When the \'Display special characters\' checkbox is checked then user should be able to enter value in the \'Custom special characters\' input field', () => {
56
+ shortTextResponsePage.customSpecialCharactersInputField()
57
+ .type(':)`')
58
+ .should('have.value', ':)`');
59
+ });
60
+
61
+ it('When the user clicks on the \'Special characters\' button in the response field then a flyout with the title \'Special characters\' and close button should be displayed', () => {
62
+ shortTextResponsePage.setCorrectAnswerResponseField()
63
+ .click();
64
+ shortTextResponsePage.setCorrectAnsResponseFieldSpecialCharactersButton()
65
+ .should('be.visible')
66
+ .click();
67
+ shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
68
+ });
69
+
70
+ it('The flyout should contain all the added Special characters entered in the \'Custom special characters\' input field', () => {
71
+ shortTextResponsePage.specialCharactersFlyoutIcon()
72
+ .each(($el, index) => {
73
+ cy.wrap($el)
74
+ .should('have.text', `${customSpecialCharacters[index]}`)
75
+ });
76
+ });
77
+
78
+ it('When user clicks on the characters then they should be added to the set correct answer response field', () => {
79
+ shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
80
+ dialogBoxBase.steps.closeWarningPopup();
81
+ shortTextResponsePage.setCorrectAnswerResponseField()
82
+ .should('have.value', ':)`');
83
+ });
84
+
85
+ //Special custom characters test cases for preview tab response field
86
+ it('When the \'Custom special characters\' functionality is disabled then the \'Special characters\' button should not be displayed in the preview tab response field', () => {
87
+ shortTextResponsePage.customSpecialCharactersInputField()
88
+ .clear();
89
+ shortTextResponsePage.displaySpecialCharactersCheckbox()
90
+ .click()
91
+ .should('not.be.checked');
92
+ shortTextResponsePage.steps.switchToPreviewTab();
93
+ shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
94
+ .should('not.exist');
95
+ });
96
+
97
+ it('When the user has enabled the \'Custom special characters\' functionality then the \'Special characters\' button should be displayed when user focuses in any response field in the preview tab', () => {
98
+ cy.log('Pre step: Enable the Custom special characters')
99
+ shortTextResponsePage.steps.switchToEditTab();
100
+ shortTextResponsePage.displaySpecialCharactersCheckbox()
101
+ .click()
102
+ .should('be.checked');
103
+ shortTextResponsePage.steps.switchToPreviewTab();
104
+ shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
105
+ .should('not.have.class', 'active-special-character-button')
106
+ .and('not.be.visible');
107
+ shortTextResponsePage.previewTabResponseField()
108
+ .click();
109
+ shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
110
+ .should('have.class', 'active-special-character-button')
111
+ .and('be.visible');
112
+ });
113
+
114
+ it('When the user has added no input to the \'Custom special characters\' input field then the default Special characters flyout should be displayed on clicking the \'Special characters\' button in the response field', () => {
115
+ shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
116
+ .should('be.visible')
117
+ .click();
118
+ shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
119
+ });
120
+
121
+ shortTextResponsePage.tests.verifySpecialCharactersFlyoutSymbols()
122
+
123
+ it(`When user clicks on a symbol in the ${specialOrMathCharacters['specialCharacters'].popupTitle} popup, then that symbol should be inserted in the response field`, () => {
124
+ cy.log('Clicking on all symbols.');
125
+ let symbolsString = specialOrMathCharacters['specialCharacters'].characters.map((icon) => icon.symbol);
126
+ symbolsString = symbolsString.join('');
127
+ shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
128
+ dialogBoxBase.steps.closeWarningPopup();
129
+ shortTextResponsePage.previewTabResponseField()
130
+ .should('have.value', symbolsString);
131
+ });
132
+
133
+ it('When the \'Display special characters\' checkbox is checked then user should be able to enter value in the \'Custom special characters\' input field', () => {
134
+ cy.log('Pre step: Swicth to Edit tab')
135
+ shortTextResponsePage.steps.switchToEditTab()
136
+ shortTextResponsePage.customSpecialCharactersInputField()
137
+ .type(':)`')
138
+ .should('have.value', ':)`');
139
+ cy.log('Post step: Switch to Preview tab')
140
+ shortTextResponsePage.steps.switchToPreviewTab()
141
+ });
142
+
143
+ it('When the user clicks on the \'Special characters\' button then a flyout with the title \'Special characters\' and close button should be displayed in the preview tab', () => {
144
+ shortTextResponsePage.previewTabResponseField()
145
+ .click();
146
+ shortTextResponsePage.previewTabResponseFieldSpecialCharactersButton()
147
+ .should('be.visible')
148
+ .click();
149
+ shortTextResponsePage.steps.verifySpecialCharactersFlyoutHeaderContents();
150
+ });
151
+
152
+ it('The flyout should contain all the added Special characters entered in the \'Custom special characters\' input field', () => {
153
+ shortTextResponsePage.specialCharactersFlyoutIcon()
154
+ .each(($el, index) => {
155
+ cy.wrap($el)
156
+ .should('have.text', `${customSpecialCharacters[index]}`)
157
+ });
158
+ });
159
+
160
+ it('When user clicks on the characters then they should be added to the preview tab input field', () => {
161
+ shortTextResponsePage.steps.clickingOnSpecialCharactersSymbolsFromFlyout();
162
+ dialogBoxBase.steps.closeWarningPopup();
163
+ shortTextResponsePage.previewTabResponseField()
164
+ .should('have.value', ':)`');
165
+ });
166
+ });
167
+ });
@@ -0,0 +1,157 @@
1
+ import { shortTextResponsePage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Short text response: \'Exact\', \'Case sensitive\' and \'Ignore spaces before and after\'', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('\'Exact\' radio button is selected, \'Case sensitive\' checkbox is unchecked and \'Ignore spaces before and after\' checkbox is checked', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field and checking the allow students to check answer checkbox and switch to Preview tab');
14
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
15
+ shortTextResponsePage.questionInstructionsInputField()
16
+ .type('Question Instructions');
17
+ shortTextResponsePage.pointsInputField()
18
+ .type('4');
19
+ shortTextResponsePage.setCorrectAnswerResponseField()
20
+ .type('Answer input');
21
+ shortTextResponsePage.steps.expandAdditonalSettings();
22
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
23
+ .click();
24
+ shortTextResponsePage.steps.switchToPreviewTab();
25
+ });
26
+
27
+ it('When user gives an answer with different casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
28
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
29
+ });
30
+
31
+ it('When user gives an answer with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
32
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
33
+ });
34
+
35
+ it('When user gives an answer with extra spaces in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
36
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '4/4', true);
37
+ });
38
+
39
+ it('When user gives an answer with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
40
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
41
+ });
42
+
43
+ it('When user gives an answer having extra spaces in between its words in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
44
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '0/4', false);
45
+ });
46
+ });
47
+
48
+ describe('\'Exact\' radio button is selected, \'Case sensitive\' checkbox is checked and \'Ignore spaces before and after\' checkbox is unchecked', () => {
49
+ abortEarlySetup();
50
+ before(() => {
51
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field and checking the allow students to check answer checkbox and switching to Preview tab');
52
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
53
+ shortTextResponsePage.questionInstructionsInputField()
54
+ .type('Question Instructions');
55
+ shortTextResponsePage.pointsInputField()
56
+ .type('4');
57
+ shortTextResponsePage.setCorrectAnswerResponseField()
58
+ .type('Answer input');
59
+ shortTextResponsePage.steps.expandAdditonalSettings();
60
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
61
+ .click();
62
+ shortTextResponsePage.caseSensitiveCheckbox()
63
+ .click();
64
+ shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
65
+ .click();
66
+ shortTextResponsePage.steps.switchToPreviewTab();
67
+ });
68
+
69
+ it('When user gives an answer with different casing in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
70
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
71
+ });
72
+
73
+ it('When user gives an answer with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
74
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
75
+ });
76
+
77
+ it('When user gives an answer with extra spaces in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
78
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '0/4', false);
79
+ });
80
+
81
+ it('When user gives an answer with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
82
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
83
+ });
84
+ });
85
+
86
+ describe('\'Exact\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is unchecked', () => {
87
+ abortEarlySetup();
88
+ before(() => {
89
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field and checking the allow students to check answer checkbox, unchecking the Ignore spaces before and after checkbox and switching to preview tab');
90
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
91
+ shortTextResponsePage.questionInstructionsInputField()
92
+ .type('Question Instructions');
93
+ shortTextResponsePage.pointsInputField()
94
+ .type('4');
95
+ shortTextResponsePage.setCorrectAnswerResponseField()
96
+ .type('Answer input');
97
+ shortTextResponsePage.steps.expandAdditonalSettings();
98
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
99
+ .click();
100
+ shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
101
+ .click();
102
+ shortTextResponsePage.steps.switchToPreviewTab();
103
+ });
104
+
105
+ it('When user gives an answer with different casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
106
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
107
+ });
108
+
109
+ it('When user gives an answer with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
110
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
111
+ });
112
+
113
+ it('When user gives an answer with extra spaces in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
114
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '0/4', false);
115
+ });
116
+
117
+ it('When user gives an answer with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
118
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
119
+ });
120
+ });
121
+
122
+ describe('\'Exact\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is checked', () => {
123
+ abortEarlySetup();
124
+ before(() => {
125
+ cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field and checking the allow students to check answer checkbox, checking the Case sensitive checkbox and switching to preview tab');
126
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
127
+ shortTextResponsePage.questionInstructionsInputField()
128
+ .type('Question Instructions');
129
+ shortTextResponsePage.pointsInputField()
130
+ .type('4');
131
+ shortTextResponsePage.setCorrectAnswerResponseField()
132
+ .type('Answer input');
133
+ shortTextResponsePage.steps.expandAdditonalSettings();
134
+ shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
135
+ .click();
136
+ shortTextResponsePage.caseSensitiveCheckbox()
137
+ .click();
138
+ shortTextResponsePage.steps.switchToPreviewTab();
139
+ });
140
+
141
+ it('When user gives an answer with different casing in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
142
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
143
+ });
144
+
145
+ it('When user gives an answer with identical casing in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
146
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
147
+ });
148
+
149
+ it('When user gives an answer with extra spaces in the answer input field, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
150
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '4/4', true);
151
+ });
152
+
153
+ it('When user gives an answer with incorrect spelling in the answer input field, then the score should be displayed as 0 points and when user clicks on \'Check answer\' button, a red cross mark should be displayed beside the answer', () => {
154
+ shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
155
+ });
156
+ });
157
+ });
@@ -1,4 +1,4 @@
1
- import { selectQuestionResourceToolPage, shortTextResponsePage } from "../../../pages";
1
+ import { shortTextResponsePage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  const css = Cypress.env('css');
4
4
 
@@ -0,0 +1,137 @@
1
+ import { shortTextResponsePage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create item page - Short text response: Set correct answer, Alternate correct answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Set Correct Answer section', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
14
+ });
15
+
16
+ shortTextResponsePage.tests.verifyAutoScoredSetCorrectAnswerHeaderSectionContents('short text response');
17
+ shortTextResponsePage.tests.verifySetCorrectAnswerTabContentsAndFunctionality('Correct tab');
18
+
19
+ it('CSS of correct response conditions section', { tags: 'css' }, () => {
20
+ const labels = [shortTextResponsePage.caseSensitiveCheckboxLabel, shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckboxLabel, shortTextResponsePage.exactRadioOptionLabel, shortTextResponsePage.containsTextRadioOptionLabel]
21
+ const uncheckedRadioButtons = [shortTextResponsePage.exactRadioButton, shortTextResponsePage.containsTextRadioButton]
22
+ labels.forEach((checkinglabel) => {
23
+ checkinglabel()
24
+ .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
25
+ });
26
+ shortTextResponsePage.caseSensitiveCheckbox()
27
+ .parent()
28
+ .find('svg')
29
+ .should('have.css', 'fill', css.color.uncheckedCheckbox);
30
+ shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
31
+ .parent('.icon-checkbox-selected')
32
+ .find('.checkbox-icon-border-rect')
33
+ .should('have.css', 'fill', css.color.activeButtons);
34
+ uncheckedRadioButtons.forEach((uncheckedRadioButton) => {
35
+ uncheckedRadioButton()
36
+ .parent()
37
+ .find('svg')
38
+ .should('have.css', 'fill', css.color.activeButtons);
39
+ });
40
+ });
41
+
42
+ it('\'Case sensitive\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
43
+ shortTextResponsePage.caseSensitiveCheckboxLabel()
44
+ .verifyInnerText('Case sensitive')
45
+ .and('be.visible');
46
+ shortTextResponsePage.caseSensitiveCheckbox()
47
+ .should('not.be.checked');
48
+ });
49
+
50
+ it('\'Ignore spaces before and after\' functionality label and checkbox should be displayed and by default it should be checked', () => {
51
+ shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckboxLabel()
52
+ .verifyInnerText('Ignore spaces before and after');
53
+ shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
54
+ .should('be.checked');
55
+ });
56
+
57
+ it('\'Exact\' functionality label and radio button should be displayed and by default it should be checked', () => {
58
+ shortTextResponsePage.exactRadioOptionLabel()
59
+ .verifyInnerText('Exact');
60
+ shortTextResponsePage.exactRadioButton()
61
+ .should('be.checked');
62
+ });
63
+
64
+ it('\'Contains text\' functionality label and radio button should be displayed and by default it should be unchecked', () => {
65
+ shortTextResponsePage.containsTextRadioOptionLabel()
66
+ .verifyInnerText('Contains text');
67
+ shortTextResponsePage.containsTextRadioButton()
68
+ .should('not.be.checked');
69
+ });
70
+ });
71
+
72
+ describe('Alternate correct answer', () => {
73
+ abortEarlySetup();
74
+ before(() => {
75
+ shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
76
+ });
77
+
78
+ shortTextResponsePage.tests.verifyAutoScoredAlternateAnswer();
79
+
80
+ it('When user has added points and filled the correct answer response field in the \'Correct\' tab, then the user should be able to add alternate answer for the question using \'Add Alternate Answer\' button', () => {
81
+ shortTextResponsePage.setCorrectAnswerResponseField()
82
+ .type('Lorem Ipsum');
83
+ shortTextResponsePage.steps.allotPoints(20);
84
+ shortTextResponsePage.alternateAnswerButton()
85
+ .click();
86
+ });
87
+
88
+ it('Accessibility of \'Alternate\' correct answer tab', { tags: 'a11y' }, () => {
89
+ cy.checkAccessibility(shortTextResponsePage.correctTab().parents('[class*="ShortTextResponseComponentstyles__AnswerTabWrapper"]'));
90
+ });
91
+
92
+ it('When user adds an alternate correct answer, by default, \'Exact\' radio button should be checked and \'Contains text\' radio button should be unchecked', () => {
93
+ shortTextResponsePage.exactRadioButton()
94
+ .should('be.checked');
95
+ shortTextResponsePage.containsTextRadioButton()
96
+ .should('not.be.checked');
97
+ });
98
+
99
+ shortTextResponsePage.tests.verifySetCorrectAnswerTabContentsAndFunctionality('Alternate tab');
100
+
101
+ it('When user changes match type from \'Exact\' to \'Contains text\' in \'Alternate 1\' tab, changes should not get reflected in \'Correct\' tab', () => {
102
+ shortTextResponsePage.containsTextRadioButton()
103
+ .click();
104
+ shortTextResponsePage.exactRadioButton()
105
+ .should('not.be.checked');
106
+ shortTextResponsePage.containsTextRadioButton()
107
+ .should('be.checked');
108
+ shortTextResponsePage.correctTab()
109
+ .click();
110
+ shortTextResponsePage.exactRadioButton()
111
+ .should('be.checked');
112
+ shortTextResponsePage.containsTextRadioButton()
113
+ .should('not.be.checked');
114
+ });
115
+
116
+ it('User should be able to add another alternate answer for the question using \'Add Alternate Answer\' button and the name for this new tab should be \'Alternate 2\'', () => {
117
+ shortTextResponsePage.steps.addAlternateTab(2);
118
+ });
119
+
120
+ shortTextResponsePage.tests.verifyWarningPopupAndTabNavigationWhenNoPointsAddedInAlternateTab();
121
+
122
+ it('User should be able to remove alternate correct answer by clicking on the Close icon button alongside alternate answer tab and the name of the alternate answer tabs should get updated accordingly', () => {
123
+ cy.log('Set correct answer and points in alternate 2 tab, then switch to Alternate 1 tab and click delete icon button');
124
+ shortTextResponsePage.setCorrectAnswerResponseField()
125
+ .type('Lorem Ipsum');
126
+ shortTextResponsePage.steps.allotPoints(2);
127
+ shortTextResponsePage.alternateAnswerTab(1)
128
+ .click();
129
+ shortTextResponsePage.deleteAlternateTabButton()
130
+ .click();
131
+ shortTextResponsePage.alternateAnswerTab(2)
132
+ .should('not.exist');
133
+ shortTextResponsePage.alternateAnswerTab(1)
134
+ .verifyInnerText('Alternate 1');
135
+ });
136
+ });
137
+ });