itemengine-cypress-automation 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,587 +0,0 @@
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: Question insructions, Set correct answer, Alternate correct answer, Points, \'Exact\' and \'Contains text\', \'Case sensitive\' and \'Ignore spaces before and after\'', () => {
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
-
138
- describe('\'Exact\' radio button is selected, \'Case sensitive\' checkbox is unchecked and \'Ignore spaces before and after\' checkbox is checked', () => {
139
- abortEarlySetup();
140
- before(() => {
141
- 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');
142
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
143
- shortTextResponsePage.questionInstructionsInputField()
144
- .type('Question Instructions');
145
- shortTextResponsePage.pointsInputField()
146
- .type('4');
147
- shortTextResponsePage.setCorrectAnswerResponseField()
148
- .type('Answer input');
149
- shortTextResponsePage.steps.expandAdditonalSettings();
150
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
151
- .click();
152
- shortTextResponsePage.steps.switchToPreviewTab();
153
- });
154
-
155
- 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', () => {
156
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
157
- });
158
-
159
- 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', () => {
160
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
161
- });
162
-
163
- 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', () => {
164
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '4/4', true);
165
- });
166
-
167
- 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', () => {
168
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
169
- });
170
-
171
- 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', () => {
172
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '0/4', false);
173
- });
174
- });
175
-
176
- describe('\'Exact\' radio button is selected, \'Case sensitive\' checkbox is checked and \'Ignore spaces before and after\' checkbox is unchecked', () => {
177
- abortEarlySetup();
178
- before(() => {
179
- 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');
180
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
181
- shortTextResponsePage.questionInstructionsInputField()
182
- .type('Question Instructions');
183
- shortTextResponsePage.pointsInputField()
184
- .type('4');
185
- shortTextResponsePage.setCorrectAnswerResponseField()
186
- .type('Answer input');
187
- shortTextResponsePage.steps.expandAdditonalSettings();
188
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
189
- .click();
190
- shortTextResponsePage.caseSensitiveCheckbox()
191
- .click();
192
- shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
193
- .click();
194
- shortTextResponsePage.steps.switchToPreviewTab();
195
- });
196
-
197
- 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', () => {
198
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
199
- });
200
-
201
- 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', () => {
202
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
203
- });
204
-
205
- 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', () => {
206
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '0/4', false);
207
- });
208
-
209
- 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', () => {
210
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
211
- });
212
- });
213
-
214
- describe('\'Exact\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is unchecked', () => {
215
- abortEarlySetup();
216
- before(() => {
217
- 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');
218
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
219
- shortTextResponsePage.questionInstructionsInputField()
220
- .type('Question Instructions');
221
- shortTextResponsePage.pointsInputField()
222
- .type('4');
223
- shortTextResponsePage.setCorrectAnswerResponseField()
224
- .type('Answer input');
225
- shortTextResponsePage.steps.expandAdditonalSettings();
226
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
227
- .click();
228
- shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
229
- .click();
230
- shortTextResponsePage.steps.switchToPreviewTab();
231
- });
232
-
233
- 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', () => {
234
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
235
- });
236
-
237
- 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', () => {
238
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
239
- });
240
-
241
- 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', () => {
242
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '0/4', false);
243
- });
244
-
245
- 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', () => {
246
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
247
- });
248
- });
249
-
250
- describe('\'Exact\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is checked', () => {
251
- abortEarlySetup();
252
- before(() => {
253
- 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');
254
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
255
- shortTextResponsePage.questionInstructionsInputField()
256
- .type('Question Instructions');
257
- shortTextResponsePage.pointsInputField()
258
- .type('4');
259
- shortTextResponsePage.setCorrectAnswerResponseField()
260
- .type('Answer input');
261
- shortTextResponsePage.steps.expandAdditonalSettings();
262
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
263
- .click();
264
- shortTextResponsePage.caseSensitiveCheckbox()
265
- .click();
266
- shortTextResponsePage.steps.switchToPreviewTab();
267
- });
268
-
269
- 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', () => {
270
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
271
- });
272
-
273
- 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', () => {
274
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
275
- });
276
-
277
- 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', () => {
278
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input ', '4/4', true);
279
- });
280
-
281
- 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', () => {
282
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
283
- });
284
- });
285
-
286
- describe('\'Contains text\' radio button is selected, \'Case sensitive\' checkbox is unchecked and \'Ignore spaces before and after\' checkbox is checked', () => {
287
- abortEarlySetup();
288
- before(() => {
289
- 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');
290
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
291
- shortTextResponsePage.questionInstructionsInputField()
292
- .type('Question Instructions');
293
- shortTextResponsePage.pointsInputField()
294
- .type('4');
295
- shortTextResponsePage.setCorrectAnswerResponseField()
296
- .type('Answer input');
297
- shortTextResponsePage.containsTextRadioButton()
298
- .click();
299
- shortTextResponsePage.steps.expandAdditonalSettings();
300
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
301
- .click();
302
- shortTextResponsePage.steps.switchToPreviewTab();
303
- });
304
-
305
- 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', () => {
306
- cy.log('Pre-step: Switching to preview tab');
307
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
308
- });
309
-
310
- 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', () => {
311
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
312
- });
313
-
314
- 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', () => {
315
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
316
- });
317
-
318
- 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', () => {
319
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
320
- });
321
-
322
- 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', () => {
323
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '0/4', false);
324
- });
325
- });
326
-
327
- describe('\'Contains text\' radio button is selected, \'Case sensitive\' checkbox is checked and \'Ignore spaces before and after\' checkbox is unchecked', () => {
328
- abortEarlySetup();
329
- before(() => {
330
- 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');
331
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
332
- shortTextResponsePage.questionInstructionsInputField()
333
- .type('Question Instructions');
334
- shortTextResponsePage.pointsInputField()
335
- .type('4');
336
- shortTextResponsePage.setCorrectAnswerResponseField()
337
- .type('Answer input');
338
- shortTextResponsePage.containsTextRadioButton()
339
- .click();
340
- shortTextResponsePage.steps.expandAdditonalSettings();
341
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
342
- .click();
343
- shortTextResponsePage.caseSensitiveCheckbox()
344
- .click();
345
- shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
346
- .click();
347
- shortTextResponsePage.steps.switchToPreviewTab();
348
- });
349
-
350
- 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', () => {
351
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
352
- });
353
-
354
- 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', () => {
355
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
356
- });
357
-
358
- 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', () => {
359
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
360
- });
361
-
362
- 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', () => {
363
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
364
- });
365
- });
366
-
367
- describe('\'Contains text\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is unchecked', () => {
368
- abortEarlySetup();
369
- before(() => {
370
- 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');
371
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
372
- shortTextResponsePage.questionInstructionsInputField()
373
- .type('Question Instructions');
374
- shortTextResponsePage.pointsInputField()
375
- .type('4');
376
- shortTextResponsePage.setCorrectAnswerResponseField()
377
- .type('Answer input');
378
- shortTextResponsePage.containsTextRadioButton()
379
- .click();
380
- shortTextResponsePage.steps.expandAdditonalSettings();
381
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
382
- .click();
383
- shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
384
- .click();
385
- shortTextResponsePage.steps.switchToPreviewTab();
386
- });
387
-
388
- 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', () => {
389
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
390
- });
391
-
392
- 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', () => {
393
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
394
- });
395
-
396
- 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', () => {
397
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
398
- });
399
-
400
- 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', () => {
401
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
402
- });
403
- });
404
-
405
- describe('\'Contains text\' radio button is selected, and both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is checked', () => {
406
- abortEarlySetup();
407
- before(() => {
408
- 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');
409
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
410
- shortTextResponsePage.questionInstructionsInputField()
411
- .type('Question Instructions');
412
- shortTextResponsePage.pointsInputField()
413
- .type('4');
414
- shortTextResponsePage.setCorrectAnswerResponseField()
415
- .type('Answer input');
416
- shortTextResponsePage.containsTextRadioButton()
417
- .click();
418
- shortTextResponsePage.caseSensitiveCheckbox()
419
- .click();
420
- shortTextResponsePage.steps.expandAdditonalSettings();
421
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
422
- .click();
423
- shortTextResponsePage.steps.switchToPreviewTab();
424
- });
425
-
426
- 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', () => {
427
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
428
- });
429
-
430
- 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', () => {
431
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
432
- });
433
-
434
- 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', () => {
435
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
436
- });
437
-
438
- 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', () => {
439
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
440
- });
441
- });
442
-
443
- describe('User can select different property (Exact or Contains text) across multiple set answer tabs (Correct answer tab and Alternate answer tabs)', () => {
444
- abortEarlySetup();
445
- before(() => {
446
- cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field, checking the allow students to check answer checkbox and switching to preview tab');
447
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
448
- shortTextResponsePage.questionInstructionsInputField()
449
- .type('Question Instructions');
450
- cy.log('Setting \'Exact\' property to the Correct tab and \'Contains text\' property to the \'Alternate 1\' tab');
451
- shortTextResponsePage.pointsInputField()
452
- .type('2');
453
- shortTextResponsePage.setCorrectAnswerResponseField()
454
- .type('Lorem ipsum');
455
- cy.log('Adding an alternate correct answer set with more points value');
456
- shortTextResponsePage.steps.addAlternateTab(1);
457
- shortTextResponsePage.pointsInputField()
458
- .type('4');
459
- shortTextResponsePage.setCorrectAnswerResponseField()
460
- .type('Answer input');
461
- shortTextResponsePage.containsTextRadioButton()
462
- .click();
463
- shortTextResponsePage.steps.expandAdditonalSettings();
464
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
465
- .click();
466
- shortTextResponsePage.steps.switchToPreviewTab();
467
- });
468
-
469
- it('When user gives an answer that is exactly same as the set correct answer text of \'Correct\' tab in the answer input field, then full score as per the points set for that tab should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
470
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Lorem ipsum', '2/4', true);
471
- });
472
-
473
- it('When user gives an answer that contains the set correct answer text of \'Correct\' tab in the answer but not exact, 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', () => {
474
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Lorem ipsum dolor', '0/4', false);
475
- });
476
-
477
- it('When user gives an answer that contains the set correct answer text of \'Alternate 1\' tab in the answer input field but not exact, then full score should be displayed and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
478
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('this is an Answer input', '4/4', true);
479
- });
480
-
481
- it('When user gives an answer that does not contain the set correct answer text of \'Alternate 1\' tab 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', () => {
482
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answerinput', '0/4', false);
483
- });
484
- });
485
-
486
- describe('\'Case sensitive\' property should be applied globally to all the set correct answer tabs (Correct answer tab and Alternate answer tabs)', () => {
487
- abortEarlySetup();
488
- before(() => {
489
- cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field, checking the allow students to check answer checkbox and switching to preview tab');
490
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
491
- shortTextResponsePage.questionInstructionsInputField()
492
- .type('Question Instructions');
493
- cy.log('Setting \'Exact\' property to the Correct tab and \'Contains text\' property to the \'Alternate 1\' tab');
494
- shortTextResponsePage.pointsInputField()
495
- .type('2');
496
- shortTextResponsePage.setCorrectAnswerResponseField()
497
- .type('Lorem ipsum');
498
- cy.log('Adding an alternate correct answer set with more points value');
499
- shortTextResponsePage.steps.addAlternateTab(1);
500
- shortTextResponsePage.pointsInputField()
501
- .type('4');
502
- shortTextResponsePage.setCorrectAnswerResponseField()
503
- .type('Answer input');
504
- shortTextResponsePage.containsTextRadioButton()
505
- .click();
506
- shortTextResponsePage.steps.expandAdditonalSettings();
507
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
508
- .click();
509
- shortTextResponsePage.steps.switchToPreviewTab();
510
- });
511
-
512
- it('\'Case sensitive\' property unchecked : When the user enters correct answer with identical casing, appropriate points should be given for both the correct answer and alternate answer tab responses and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
513
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Lorem ipsum', '2/4', true);
514
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
515
- });
516
-
517
- it('\'Case sensitive\' property unchecked : When the user enters correct answer with incorrect casing, appropriate points should be given for both the correct answer and alternate answer tab responses and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
518
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('lorem ipsum', '2/4', true);
519
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '4/4', true);
520
- });
521
-
522
- it('\'Case sensitive\' property checked : When the user enters correct answer with identical casing, appropriate points should be given for both the correct answer and alternate answer tab responses and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
523
- cy.log('Pre -step : Go to Edit tab, check \'Case sensitive\' checkbox and switch back to Preview tab');
524
- shortTextResponsePage.steps.switchToEditTab();
525
- shortTextResponsePage.caseSensitiveCheckbox()
526
- .click();
527
- shortTextResponsePage.steps.switchToPreviewTab();
528
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Lorem ipsum', '2/4', true);
529
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
530
- });
531
-
532
- it('\'Case sensitive\' property checked : When the user enters correct answer with incorrect casing, 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', () => {
533
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('lorem ipsum', '0/4', false);
534
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('answer input', '0/4', false);
535
- });
536
- });
537
-
538
- describe('\'Ignore spaces before and after\' property should be applied globally to all the set correct answer tabs (Correct answer tab and Alternate answer tabs)', () => {
539
- abortEarlySetup();
540
- before(() => {
541
- cy.log('Navigating to Short text response question type, giving input to question instruction input field, points input field and response input field, checking the allow students to check answer checkbox and switching to preview tab');
542
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
543
- shortTextResponsePage.questionInstructionsInputField()
544
- .type('Question Instructions');
545
- cy.log('Setting \'Exact\' property in both tabs as \'Contains text\' property by default functions like \'Ignore spaces before and after\' property');
546
- shortTextResponsePage.pointsInputField()
547
- .type('2');
548
- shortTextResponsePage.setCorrectAnswerResponseField()
549
- .type('Lorem ipsum');
550
- cy.log('Adding an alternate correct answer set with more points value');
551
- shortTextResponsePage.steps.addAlternateTab(1);
552
- shortTextResponsePage.pointsInputField()
553
- .type('4');
554
- shortTextResponsePage.setCorrectAnswerResponseField()
555
- .type('Answer input');
556
- shortTextResponsePage.steps.expandAdditonalSettings();
557
- shortTextResponsePage.allowStudentsToCheckAnswerCheckbox()
558
- .click();
559
- shortTextResponsePage.steps.switchToPreviewTab();
560
- });
561
-
562
- it('\'Ignore spaces before and after\' property checked : When the user enters correct answer with extra spaces before and after, appropriate points should be given for both the correct answer and alternate answer tab responses and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
563
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Lorem ipsum ', '2/4', true);
564
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '4/4', true);
565
- });
566
-
567
- it('\'Ignore spaces before and after\' property checked : When the user enters correct answer without extra spaces before and after, appropriate points should be given for both the correct answer and alternate answer tab responses and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
568
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Lorem ipsum', '2/4', true);
569
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
570
- });
571
-
572
- it('\'Ignore spaces before and after\' property unchecked : When the user enters correct answer with extra spaces before and after, appropriate points should be given for both the correct answer and alternate answer tab responses and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
573
- cy.log('Pre - step : Go to Edit tab, uncheck \'Ignore spaces before and after\' checkbox and switch back to Preview tab');
574
- shortTextResponsePage.steps.switchToEditTab();
575
- shortTextResponsePage.ignoreSpacesBeforeAndAfterCheckbox()
576
- .click();
577
- shortTextResponsePage.steps.switchToPreviewTab();
578
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Lorem ipsum ', '0/4', false);
579
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel(' Answer input ', '0/4', false);
580
- });
581
-
582
- it('\'Ignore spaces before and after property\' unchecked : When the user enters correct answer without extra spaces before and after, appropriate points should be given for both the correct answer and alternate answer tab responses and when user clicks on \'Check answer\' button, a green check mark should be displayed beside the answer', () => {
583
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Lorem ipsum', '2/4', true);
584
- shortTextResponsePage.tests.verifyAnswerInputScoreAndCorrectIncorrectAnswerLabel('Answer input', '4/4', true);
585
- });
586
- });
587
- });
@@ -1,18 +0,0 @@
1
- describe('template spec 1', () => {
2
- it('passes', () => {
3
- cy.wait(10000)
4
- })
5
-
6
- it('passes', () => {
7
- cy.wait(10000)
8
- })
9
-
10
- it('fails', () => {
11
- cy.wait(10000)
12
- expect(true).to.be.eq(false)
13
- })
14
-
15
- it('passes', () => {
16
- cy.wait(10000)
17
- })
18
- })
@@ -1,18 +0,0 @@
1
- describe('template spec 2', () => {
2
- it('passes', () => {
3
- cy.wait(10000)
4
- })
5
-
6
- it('passes', () => {
7
- cy.wait(10000)
8
- })
9
-
10
- it('passes', () => {
11
- cy.wait(10000)
12
- expect(true).to.be.eq(true)
13
- })
14
-
15
- it('passes', () => {
16
- cy.wait(10000)
17
- })
18
- })