itemengine-cypress-automation 1.0.364-IEI-6049-and-IEI-6066-manualAndNonScoredScript-b38e163.0 → 1.0.364-IEI-5423-cypress-636f028.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.
@@ -12,6 +12,7 @@ const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
12
12
 
13
13
  const defaultStateColor = 'rgb(120, 60, 60)';
14
14
  const activeStateColor = 'rgb(60, 120, 120)';
15
+ const defaultStateBorderColorWithOpacity = 'rgba(120, 61, 61, 0.5)';
15
16
 
16
17
  describe('Create Item page - Image highlight: Customize image highlight style', () => {
17
18
  before(() => {
@@ -156,6 +157,34 @@ describe('Create Item page - Image highlight: Customize image highlight style',
156
157
  });
157
158
  });
158
159
 
160
+ describe('Border opacity image highlight style : Edit tab content and functionality', () => {
161
+ abortEarlySetup();
162
+ before(() => {
163
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
164
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
165
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
166
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
167
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
168
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
169
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
170
+ imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
171
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
172
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
173
+ });
174
+
175
+ it('When user changes the opacity in color picker the changes should be displayed', () => {
176
+ imageHighlightPage.steps.clickOnBorderColorIcon();
177
+ imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
178
+ colorPopupComponent.steps.clickInColorSaturationPalette();
179
+ imageHighlightPage.steps.clickInAlphaPicker();
180
+ imageHighlightPage.steps.clickOnOkButton();
181
+ imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
182
+ imageHighlightPage.steps.verifyEditedBorderOpacityInSpecifyCorrectAnswerSection(2, defaultStateBorderColorWithOpacity);
183
+ imageHighlightPage.steps.switchToPreviewTab();
184
+ imageHighlightPage.steps.verifyEditedBorderOpacityInPreviewtabSection(2, defaultStateBorderColorWithOpacity);
185
+ });
186
+
187
+ });
159
188
  // Change 'Stroke color' to 'Border color' in the following tests after https://redmine.zeuslearning.com/issues/580697 has been resolved.
160
189
 
161
190
  describe('Border color image highlight style : Edit tab content and functionality', () => {
@@ -179,241 +179,6 @@ describe('Create item page - List ordering: All or nothing ', () => {
179
179
  });
180
180
  });
181
181
 
182
- views.forEach((view) => {
183
- describe(`${view}: List ordering (Dropdown) - Manually scored`, { tags: 'smoke' }, () => {
184
- abortEarlySetup();
185
- before(() => {
186
- switch (view) {
187
- case 'Question preview':
188
- listOrderingPage.steps.navigateToCreateQuestion('list ordering');
189
- cy.barsPreLoaderWait();
190
- listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
191
- listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange the items in the correct order.');
192
- listOrderingPage.steps.expandScoringTypeDropdown();
193
- listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
194
- listOrderingPage.steps.addInputToOptionsInputField(['sprout', 'plant', 'flower', 'seed']);
195
- listOrderingPage.steps.allotPoints(20);
196
- listOrderingPage.steps.switchToPreviewTab();
197
- break;
198
- case 'Item preview':
199
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
200
- itemPreviewPage.steps.switchToPreviewTab();
201
- break;
202
- case 'Grading view':
203
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
204
- break;
205
- };
206
- });
207
-
208
- beforeEach(() => {
209
- switch (view) {
210
- case 'Question preview':
211
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
212
- listOrderingPage.steps.resetQuestionPreview();
213
- break;
214
- case 'Item preview':
215
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
216
- itemPreviewPage.steps.resetQuestionPreview();
217
- break;
218
- case 'Grading view':
219
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
220
- break;
221
- }
222
- });
223
-
224
- if (view === 'Question preview') {
225
- after(() => {
226
- listOrderingPage.steps.clickOnSaveQuestionButton();
227
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
228
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
229
- });
230
- };
231
-
232
- it('Question instructions should be visible', () => {
233
- listOrderingPage.steps.verifyQuestionInstructionsTextPreviewTab('Arrange the items in the correct order.');
234
- listOrderingPage.steps.verifyVisibityOfQuestionInstructionsText();
235
- });
236
-
237
- it('User should be able to attempt the question in student view, and correct/incorrect icons, "Your answer is correct/incorrect" label, and correct answer section should not be displayed in grading view', () => {
238
- listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([
239
- { optionIndex: 0, position: '2' },
240
- { optionIndex: 1, position: '3' },
241
- { optionIndex: 2, position: '4' },
242
- { optionIndex: 3, position: '1' },
243
- ]);
244
- if (view === 'Grading view') {
245
- studentViewPage.steps.submitResponse();
246
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
247
- studentViewPage.steps.clickOnGoToGradingViewButton();
248
- gradingViewPage.steps.verifyGradingViewScore('', 20);
249
- };
250
- if (view === 'Question preview' || view === 'Item preview') {
251
- listOrderingPage.steps.checkManuallyScoredScoringLabel();
252
- };
253
- listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(0);
254
- listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
255
- });
256
- });
257
- });
258
-
259
- views.forEach((view) => {
260
- describe(`${view}: List ordering (Dropdown) - Non scored`, { tags: 'smoke' }, () => {
261
- abortEarlySetup();
262
- before(() => {
263
- switch (view) {
264
- case 'Question preview':
265
- listOrderingPage.steps.navigateToCreateQuestion('list ordering');
266
- cy.barsPreLoaderWait();
267
- listOrderingPage.steps.selectOrderingLayoutOption('Dropdown menu');
268
- listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange the items in the correct order.');
269
- listOrderingPage.steps.expandScoringTypeDropdown();
270
- listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
271
- listOrderingPage.steps.addInputToOptionsInputField(['sprout', 'plant', 'flower', 'seed']);
272
- listOrderingPage.steps.selectPositionForAllOptionsSpecifyCorrectAnswerSection([
273
- { optionIndex: 0, position: '2' },
274
- { optionIndex: 1, position: '3' },
275
- { optionIndex: 2, position: '4' },
276
- { optionIndex: 3, position: '1' },
277
- ]);
278
- listOrderingPage.steps.switchToPreviewTab();
279
- break;
280
- case 'Item preview':
281
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
282
- itemPreviewPage.steps.switchToPreviewTab();
283
- break;
284
- case 'Grading view':
285
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
286
- break;
287
- };
288
- });
289
-
290
- beforeEach(() => {
291
- switch (view) {
292
- case 'Question preview':
293
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
294
- listOrderingPage.steps.resetQuestionPreview();
295
- break;
296
- case 'Item preview':
297
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
298
- itemPreviewPage.steps.resetQuestionPreview();
299
- break;
300
- case 'Grading view':
301
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
302
- break;
303
- }
304
- });
305
-
306
- if (view === 'Question preview') {
307
- after(() => {
308
- listOrderingPage.steps.clickOnSaveQuestionButton();
309
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
310
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
311
- });
312
- };
313
-
314
- it('When the user selects "Grading" view without attempting the question, non-scoring label should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label "Correct answers" should be displayed with correct answers and correct/incorrect icons should not be displayed', () => {
315
- if (view === 'Grading view') {
316
- utilities.verifyElementDisabledClass(studentViewPage.submitButton());
317
- };
318
- if (view === 'Question preview' || view === 'Item preview') {
319
- listOrderingPage.steps.checkNonScoredScoringLabel();
320
- listOrderingPage.steps.switchToGradingView();
321
- listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(0);
322
- listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(1);
323
- listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(2);
324
- listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(3);
325
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
326
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
327
- listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(['sprout', 'plant', 'flower', 'seed'], ['2', '3', '4', '1']);
328
- };
329
- });
330
-
331
- it('When the user attempts the question incorrectly, then non-scoring label should be displayed and on switching to "Grading" view, incorrect icons should be displayed beside all incorrect responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
332
- listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([
333
- { optionIndex: 0, position: '1' },
334
- { optionIndex: 1, position: '2' },
335
- { optionIndex: 2, position: '3' },
336
- { optionIndex: 3, position: '4' },
337
- ]);
338
- if (view === 'Grading view') {
339
- studentViewPage.steps.submitResponse();
340
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
341
- studentViewPage.steps.clickOnGoToGradingViewButton();
342
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
343
- };
344
- if (view === 'Question preview' || view === 'Item preview') {
345
- listOrderingPage.steps.checkNonScoredScoringLabel();
346
- listOrderingPage.steps.switchToGradingView();
347
- };
348
- //Remove the if block and keep the steps common for all views after https://weldnorthed.atlassian.net/browse/IEI-6058 is fixed
349
- if (view === 'Question preview') {
350
- listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(0);
351
- listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
352
- listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(2);
353
- listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
354
- }
355
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
356
- listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(['sprout', 'plant', 'flower', 'seed'], ['2', '3', '4', '1']);
357
- });
358
-
359
- it('When the user attempts the question partially correct, then non-scoring label should be displayed and on switching to "Grading" view, correct icon should be displayed beside the correct responses, incorrect icon should be displayed beside the incorrect responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
360
- listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([
361
- { optionIndex: 0, position: '2' },
362
- { optionIndex: 1, position: '1' },
363
- { optionIndex: 2, position: '4' },
364
- { optionIndex: 3, position: '3' },
365
- ]);
366
- if (view === 'Grading view') {
367
- studentViewPage.steps.submitResponse();
368
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
369
- studentViewPage.steps.clickOnGoToGradingViewButton();
370
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
371
- };
372
- if (view === 'Question preview' || view === 'Item preview') {
373
- listOrderingPage.steps.checkNonScoredScoringLabel();
374
- listOrderingPage.steps.switchToGradingView();
375
- };
376
- //Remove the if block and keep the steps common for all views after https://weldnorthed.atlassian.net/browse/IEI-6058 is fixed
377
- if (view === 'Question preview') {
378
- listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
379
- listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(1);
380
- listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
381
- listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
382
- }
383
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
384
- listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(['sprout', 'plant', 'flower', 'seed'], ['2', '3', '4', '1']);
385
- });
386
-
387
- it('When the user attempts the question correctly, and on switching to "Grading" view, non-scoring label should be displayed, correct icons should be displayed beside the correct responses, a status message with text "Your answer is correct" should be displayed and correct answer section should not be displayed', () => {
388
- listOrderingPage.steps.selectPositionForAllOptionsPreviewTab([
389
- { optionIndex: 0, position: '2' },
390
- { optionIndex: 1, position: '3' },
391
- { optionIndex: 2, position: '4' },
392
- { optionIndex: 3, position: '1' },
393
- ]);
394
- if (view === 'Grading view') {
395
- studentViewPage.steps.submitResponse();
396
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
397
- studentViewPage.steps.clickOnGoToGradingViewButton();
398
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
399
- };
400
- if (view === 'Question preview' || view === 'Item preview') {
401
- listOrderingPage.steps.checkNonScoredScoringLabel();
402
- listOrderingPage.steps.switchToGradingView();
403
- };
404
- //Remove the if block and keep the steps common for all views after https://weldnorthed.atlassian.net/browse/IEI-6058 is fixed
405
- if (view === 'Question preview') {
406
- listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(0);
407
- listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(1);
408
- listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(2);
409
- listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
410
- }
411
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
412
- listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
413
- });
414
- });
415
- });
416
-
417
182
  if (!grepTags || !grepTags.includes('smoke')) {
418
183
  describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
419
184
  abortEarlySetup();
@@ -196,221 +196,6 @@ describe('Create item page - List ordering: All or nothing ', () => {
196
196
  });
197
197
  });
198
198
 
199
- views.forEach((view) => {
200
- describe(`${view}: List ordering - Manually scored`, { tags: 'smoke' }, () => {
201
- abortEarlySetup();
202
- before(() => {
203
- switch (view) {
204
- case 'Question preview':
205
- listOrderingPage.steps.navigateToCreateQuestion('list ordering');
206
- cy.barsPreLoaderWait();
207
- listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange the items in the correct order.');
208
- listOrderingPage.steps.expandScoringTypeDropdown();
209
- listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
210
- listOrderingPage.steps.addInputToOptionsInputField(['seed', 'sprout', 'plant', 'flower']);
211
- listOrderingPage.steps.allotPoints(20);
212
- listOrderingPage.steps.switchToPreviewTab();
213
- break;
214
- case 'Item preview':
215
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
216
- itemPreviewPage.steps.switchToPreviewTab();
217
- break;
218
- case 'Grading view':
219
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
220
- break;
221
- };
222
- });
223
-
224
- beforeEach(() => {
225
- switch (view) {
226
- case 'Question preview':
227
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
228
- listOrderingPage.steps.resetQuestionPreview();
229
- break;
230
- case 'Item preview':
231
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
232
- itemPreviewPage.steps.resetQuestionPreview();
233
- break;
234
- case 'Grading view':
235
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
236
- break;
237
- }
238
- });
239
-
240
- if (view === 'Question preview') {
241
- after(() => {
242
- listOrderingPage.steps.clickOnSaveQuestionButton();
243
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
244
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
245
- });
246
- };
247
-
248
- it('Question instructions should be visible', () => {
249
- listOrderingPage.steps.verifyQuestionInstructionsTextPreviewTab('Arrange the items in the correct order.');
250
- listOrderingPage.steps.verifyVisibityOfQuestionInstructionsText();
251
- });
252
-
253
- it('User should be able to attempt the question in student view, and correct/incorrect icons, "Your answer is correct/incorrect" label, and correct answer section should not be displayed in grading view', () => {
254
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('seed', 0);
255
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('sprout', 1);
256
- if (view === 'Grading view') {
257
- studentViewPage.steps.submitResponse();
258
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
259
- studentViewPage.steps.clickOnGoToGradingViewButton();
260
- gradingViewPage.steps.verifyGradingViewScore('', 20);
261
- };
262
- if (view === 'Question preview' || view === 'Item preview') {
263
- listOrderingPage.steps.checkManuallyScoredScoringLabel();
264
- };
265
- listOrderingPage.steps.verifyCorrectIncorrectIconsNotExist();
266
- listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
267
- });
268
- });
269
- });
270
-
271
- views.forEach((view) => {
272
- describe(`${view}: List ordering - Non scored`, { tags: 'smoke' }, () => {
273
- abortEarlySetup();
274
- before(() => {
275
- switch (view) {
276
- case 'Question preview':
277
- listOrderingPage.steps.navigateToCreateQuestion('list ordering');
278
- cy.barsPreLoaderWait();
279
- listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange the items in the correct order.');
280
- listOrderingPage.steps.expandScoringTypeDropdown();
281
- listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
282
- listOrderingPage.steps.addInputToOptionsInputField(['seed', 'plant', 'sprout', 'flower']);
283
- listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('seed', 0);
284
- listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('sprout', 1);
285
- listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('plant', 2);
286
- listOrderingPage.steps.clickAndReorderOptionInSpecifyCorrectAnswerSection('flower', 3);
287
- listOrderingPage.steps.switchToPreviewTab();
288
- break;
289
- case 'Item preview':
290
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
291
- itemPreviewPage.steps.switchToPreviewTab();
292
- break;
293
- case 'Grading view':
294
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
295
- break;
296
- };
297
- });
298
-
299
- beforeEach(() => {
300
- switch (view) {
301
- case 'Question preview':
302
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
303
- listOrderingPage.steps.resetQuestionPreview();
304
- break;
305
- case 'Item preview':
306
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
307
- itemPreviewPage.steps.resetQuestionPreview();
308
- break;
309
- case 'Grading view':
310
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
311
- break;
312
- }
313
- });
314
-
315
- if (view === 'Question preview') {
316
- after(() => {
317
- listOrderingPage.steps.clickOnSaveQuestionButton();
318
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
319
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
320
- });
321
- };
322
-
323
- it('When the user selects "Grading" view without attempting the question, non-scoring label should be displayed, correct/incorrect status message should be displayed, correct answers section with a label "Correct answers" should be displayed with correct answers and correct/incorrect icons should be displayed', () => {
324
- if (view === 'Grading view') {
325
- studentViewPage.steps.submitResponse();
326
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
327
- studentViewPage.steps.clickOnGoToGradingViewButton();
328
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
329
- };
330
- if (view === 'Question preview' || view === 'Item preview') {
331
- listOrderingPage.steps.checkNonScoredScoringLabel();
332
- listOrderingPage.steps.switchToGradingView();
333
- };
334
- listOrderingPage.steps.verifyCorrectOptionIcon('seed');
335
- listOrderingPage.steps.verifyIncorrectOptionIcon('plant');
336
- listOrderingPage.steps.verifyIncorrectOptionIcon('sprout');
337
- listOrderingPage.steps.verifyCorrectOptionIcon('flower');
338
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
339
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
340
- listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
341
- });
342
-
343
- it('When the user attempts the question incorrectly, then non-scoring label should be displayed and on switching to "Grading" view, incorrect icons should be displayed beside all incorrect responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
344
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('flower', 0);
345
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('seed', 3);
346
- if (view === 'Grading view') {
347
- studentViewPage.steps.submitResponse();
348
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
349
- studentViewPage.steps.clickOnGoToGradingViewButton();
350
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
351
- };
352
- if (view === 'Question preview' || view === 'Item preview') {
353
- listOrderingPage.steps.checkNonScoredScoringLabel();
354
- listOrderingPage.steps.switchToGradingView();
355
- };
356
- listOrderingPage.steps.verifyIncorrectOptionIcon('flower');
357
- listOrderingPage.steps.verifyIncorrectOptionIcon('seed');
358
- listOrderingPage.steps.verifyIncorrectOptionIcon('sprout');
359
- listOrderingPage.steps.verifyIncorrectOptionIcon('plant');
360
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
361
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
362
- listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
363
- });
364
-
365
- it('When the user attempts the question partially correct, then non-scoring label should be displayed and on switching to "Grading" view, correct icons should be displayed beside the correct responses, incorrect icons should be displayed beside the incorrect responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
366
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('seed', 0);
367
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('flower', 1);
368
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('sprout', 2);
369
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('plant', 3);
370
- if (view === 'Grading view') {
371
- studentViewPage.steps.submitResponse();
372
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
373
- studentViewPage.steps.clickOnGoToGradingViewButton();
374
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
375
- };
376
- if (view === 'Question preview' || view === 'Item preview') {
377
- listOrderingPage.steps.checkNonScoredScoringLabel();
378
- listOrderingPage.steps.switchToGradingView();
379
- };
380
- listOrderingPage.steps.verifyCorrectOptionIcon('seed');
381
- listOrderingPage.steps.verifyIncorrectOptionIcon('flower');
382
- listOrderingPage.steps.verifyIncorrectOptionIcon('sprout');
383
- listOrderingPage.steps.verifyIncorrectOptionIcon('plant');
384
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
385
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
386
- listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
387
- });
388
-
389
- it('When the user attempts the question correctly, and on switching to "Grading" view, non-scoring label should be displayed, correct icons should be displayed beside the correct responses, a status message with text "Your answer is correct" should be displayed and correct answer section should not be displayed', () => {
390
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('seed', 0);
391
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('sprout', 1);
392
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('plant', 2);
393
- listOrderingPage.steps.clickAndReorderOptionInPreviewTab('flower', 3);
394
- if (view === 'Grading view') {
395
- studentViewPage.steps.submitResponse();
396
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
397
- studentViewPage.steps.clickOnGoToGradingViewButton();
398
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
399
- };
400
- if (view === 'Question preview' || view === 'Item preview') {
401
- listOrderingPage.steps.checkNonScoredScoringLabel();
402
- listOrderingPage.steps.switchToGradingView();
403
- };
404
- listOrderingPage.steps.verifyCorrectOptionIcon('seed');
405
- listOrderingPage.steps.verifyCorrectOptionIcon('sprout');
406
- listOrderingPage.steps.verifyCorrectOptionIcon('plant');
407
- listOrderingPage.steps.verifyCorrectOptionIcon('flower');
408
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
409
- listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
410
- });
411
- });
412
- });
413
-
414
199
  if (!grepTags || !grepTags.includes('smoke')) {
415
200
  describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
416
201
  abortEarlySetup();
@@ -199,227 +199,6 @@ describe('Create item page - List ordering: All or nothing ', () => {
199
199
  });
200
200
  });
201
201
 
202
- views.forEach((view) => {
203
- describe(`${view}: List ordering (Reorder as a separate list) - Manually scored`, { tags: 'smoke' }, () => {
204
- abortEarlySetup();
205
- before(() => {
206
- switch (view) {
207
- case 'Question preview':
208
- listOrderingPage.steps.navigateToCreateQuestion('list ordering');
209
- cy.barsPreLoaderWait();
210
- listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
211
- listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange the items in the correct order.');
212
- listOrderingPage.steps.expandScoringTypeDropdown();
213
- listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
214
- listOrderingPage.steps.addInputToOptionsInputField(['seed', 'sprout', 'plant', 'flower']);
215
- listOrderingPage.steps.allotPoints(20);
216
- listOrderingPage.steps.switchToPreviewTab();
217
- break;
218
- case 'Item preview':
219
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
220
- itemPreviewPage.steps.switchToPreviewTab();
221
- break;
222
- case 'Grading view':
223
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
224
- break;
225
- };
226
- });
227
-
228
- beforeEach(() => {
229
- switch (view) {
230
- case 'Question preview':
231
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
232
- listOrderingPage.steps.resetQuestionPreview();
233
- break;
234
- case 'Item preview':
235
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
236
- itemPreviewPage.steps.resetQuestionPreview();
237
- break;
238
- case 'Grading view':
239
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
240
- break;
241
- }
242
- });
243
-
244
- if (view === 'Question preview') {
245
- after(() => {
246
- listOrderingPage.steps.clickOnSaveQuestionButton();
247
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
248
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
249
- });
250
- };
251
-
252
- it('Question instructions should be visible', () => {
253
- listOrderingPage.steps.verifyQuestionInstructionsTextPreviewTab('Arrange the items in the correct order.');
254
- listOrderingPage.steps.verifyVisibityOfQuestionInstructionsText();
255
- });
256
-
257
- it('User should be able to attempt the question in student view, and correct/incorrect icons, "Your answer is correct/incorrect" label, and correct answer section should not be displayed in grading view', () => {
258
- listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
259
- listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
260
- listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
261
- listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
262
- if (view === 'Grading view') {
263
- studentViewPage.steps.submitResponse();
264
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
265
- studentViewPage.steps.clickOnGoToGradingViewButton();
266
- gradingViewPage.steps.verifyGradingViewScore('', 20);
267
- };
268
- if (view === 'Question preview' || view === 'Item preview') {
269
- listOrderingPage.steps.checkManuallyScoredScoringLabel();
270
- };
271
- listOrderingPage.steps.verifyCorrectIncorrectIconsNotExist();
272
- listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
273
- });
274
- });
275
- });
276
-
277
- views.forEach((view) => {
278
- describe(`${view}: List ordering (Reorder as a separate list) - Non scored`, { tags: 'smoke' }, () => {
279
- abortEarlySetup();
280
- before(() => {
281
- switch (view) {
282
- case 'Question preview':
283
- listOrderingPage.steps.navigateToCreateQuestion('list ordering');
284
- cy.barsPreLoaderWait();
285
- listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
286
- listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange the items in the correct order.');
287
- listOrderingPage.steps.expandScoringTypeDropdown();
288
- listOrderingPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
289
- listOrderingPage.steps.addInputToOptionsInputField(['seed', 'plant', 'sprout', 'flower']);
290
- listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
291
- listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
292
- listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
293
- listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
294
- listOrderingPage.steps.switchToPreviewTab();
295
- break;
296
- case 'Item preview':
297
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
298
- itemPreviewPage.steps.switchToPreviewTab();
299
- break;
300
- case 'Grading view':
301
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
302
- break;
303
- };
304
- });
305
-
306
- beforeEach(() => {
307
- switch (view) {
308
- case 'Question preview':
309
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
310
- listOrderingPage.steps.resetQuestionPreview();
311
- break;
312
- case 'Item preview':
313
- listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
314
- itemPreviewPage.steps.resetQuestionPreview();
315
- break;
316
- case 'Grading view':
317
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
318
- break;
319
- }
320
- });
321
-
322
- if (view === 'Question preview') {
323
- after(() => {
324
- listOrderingPage.steps.clickOnSaveQuestionButton();
325
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
326
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
327
- });
328
- };
329
-
330
- it('When the user selects "Grading" view without attempting the question, non-scoring label should be displayed, correct/incorrect status message should be displayed, correct answers section with a label "Correct answers" should be displayed with correct answers and correct/incorrect icons should be displayed', () => {
331
- /*Uncooment the code once https://weldnorthed.atlassian.net/browse/IEI-6055 ir resolved
332
- if (view === 'Grading view') {
333
- studentViewPage.steps.submitResponse();
334
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
335
- studentViewPage.steps.clickOnGoToGradingViewButton();
336
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
337
- };*/
338
- if (view === 'Question preview' || view === 'Item preview') {
339
- listOrderingPage.steps.checkNonScoredScoringLabel();
340
- listOrderingPage.steps.switchToGradingView();
341
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
342
- listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
343
- };
344
- });
345
-
346
- it('When the user attempts the question incorrectly, then non-scoring label should be displayed and on switching to "Grading" view, incorrect icons should be displayed beside all incorrect responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
347
- listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
348
- listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
349
- listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
350
- listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
351
- if (view === 'Grading view') {
352
- studentViewPage.steps.submitResponse();
353
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
354
- studentViewPage.steps.clickOnGoToGradingViewButton();
355
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
356
- };
357
- if (view === 'Question preview' || view === 'Item preview') {
358
- listOrderingPage.steps.checkNonScoredScoringLabel();
359
- listOrderingPage.steps.switchToGradingView();
360
- };
361
- listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
362
- listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
363
- listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
364
- listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
365
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
366
- listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
367
- });
368
-
369
- it('When the user attempts the question partially correct, then non-scoring label should be displayed and on switching to "Grading" view, correct icon should be displayed beside the correct responses, incorrect icon should be displayed beside the incorrect responses, a status message with text "Your answer is incorrect" and correct answer section with all correct answers should be displayed', () => {
370
- if (view === 'Grading view') {
371
- studentViewPage.steps.clearResponses();
372
- };
373
- listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
374
- listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
375
- listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
376
- listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
377
- if (view === 'Grading view') {
378
- studentViewPage.steps.submitResponse();
379
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
380
- studentViewPage.steps.clickOnGoToGradingViewButton();
381
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
382
- };
383
- if (view === 'Question preview' || view === 'Item preview') {
384
- listOrderingPage.steps.checkNonScoredScoringLabel();
385
- listOrderingPage.steps.switchToGradingView();
386
- };
387
- listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
388
- listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
389
- listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
390
- listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
391
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
392
- listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
393
- });
394
-
395
- it('When the user attempts the question correctly, and on switching to "Grading" view, non-scoring label should be displayed, correct icons should be displayed beside the correct responses, a status message with text "Your answer is correct" should be displayed and correct answer section should not be displayed', () => {
396
- if (view === 'Grading view') {
397
- studentViewPage.steps.clearResponses();
398
- };
399
- listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
400
- listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
401
- listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
402
- listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
403
- if (view === 'Grading view') {
404
- studentViewPage.steps.submitResponse();
405
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
406
- studentViewPage.steps.clickOnGoToGradingViewButton();
407
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
408
- };
409
- if (view === 'Question preview' || view === 'Item preview') {
410
- listOrderingPage.steps.checkNonScoredScoringLabel();
411
- listOrderingPage.steps.switchToGradingView();
412
- };
413
- listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
414
- listOrderingPage.steps.verifyCorrectOptionIconSeperateList('sprout');
415
- listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
416
- listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
417
- listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
418
- listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
419
- });
420
- });
421
- });
422
-
423
202
  if (!grepTags || !grepTags.includes('smoke')) {
424
203
  describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
425
204
  abortEarlySetup();
@@ -152,192 +152,6 @@ describe('Create item page - Short text response: All or nothing', () => {
152
152
  });
153
153
  });
154
154
 
155
- views.forEach((view) => {
156
- describe(`${view}: Short text response - Manually scored`, { tags: 'smoke' }, () => {
157
- abortEarlySetup();
158
- before(() => {
159
- switch (view) {
160
- case 'Question preview':
161
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
162
- cy.barsPreLoaderWait();
163
- shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('What is the primary cause of urbanization?');
164
- shortTextResponsePage.steps.expandScoringTypeDropdown();
165
- shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
166
- shortTextResponsePage.steps.allotPoints(20);
167
- shortTextResponsePage.steps.switchToPreviewTab();
168
- break;
169
- case 'Item preview':
170
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
171
- itemPreviewPage.steps.switchToPreviewTab();
172
- break;
173
- case 'Grading view':
174
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
175
- break;
176
- };
177
- });
178
-
179
- beforeEach(() => {
180
- switch (view) {
181
- case 'Question preview':
182
- shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
183
- shortTextResponsePage.steps.resetQuestionPreview();
184
- break;
185
- case 'Item preview':
186
- shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
187
- itemPreviewPage.steps.resetQuestionPreview();
188
- break;
189
- case 'Grading view':
190
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
191
- break;
192
- }
193
- });
194
-
195
- if (view === 'Question preview') {
196
- after(() => {
197
- shortTextResponsePage.steps.clickOnSaveQuestionButton();
198
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
199
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
200
- });
201
- };
202
-
203
- it('Question instructions should be visible', () => {
204
- shortTextResponsePage.steps.verifyQuestionInstructionsTextPreviewTab('What is the primary cause of urbanization?');
205
- shortTextResponsePage.steps.verifyVisibityOfQuestionInstructionsText();
206
- });
207
-
208
- it('User should be able to attempt the question in student view, and correct/incorrect icons, "Your answer is correct/incorrect" label, and correct answer section should not be displayed in grading view', () => {
209
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Urbanization');
210
- if (view === 'Grading view') {
211
- studentViewPage.steps.submitResponse();
212
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
213
- studentViewPage.steps.clickOnGoToGradingViewButton();
214
- gradingViewPage.steps.verifyGradingViewScore('', 20);
215
- };
216
- if (view === 'Question preview' || view === 'Item preview') {
217
- shortTextResponsePage.steps.checkManuallyScoredScoringLabel();
218
- shortTextResponsePage.steps.verifyCorrectIncorrectIconNotVisibleGradingView();
219
- shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
220
- };
221
- });
222
- });
223
- });
224
-
225
- views.forEach((view) => {
226
- describe(`${view}: Short text response - Non scored`, { tags: 'smoke' }, () => {
227
- abortEarlySetup();
228
- before(() => {
229
- switch (view) {
230
- case 'Question preview':
231
- shortTextResponsePage.steps.navigateToCreateQuestion('short text response');
232
- cy.barsPreLoaderWait();
233
- shortTextResponsePage.steps.addTextInQuestionInstructionsInputField('What is the primary cause of urbanization?');
234
- shortTextResponsePage.steps.expandScoringTypeDropdown();
235
- shortTextResponsePage.steps.selectOptionFromScoringTypeDropdown('Non scored');
236
- shortTextResponsePage.steps.enterTextInAnswerInputFieldSpecifyCorrectAnswerSection('Urbanization');
237
- shortTextResponsePage.steps.switchToPreviewTab();
238
- break;
239
- case 'Item preview':
240
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
241
- itemPreviewPage.steps.switchToPreviewTab();
242
- break;
243
- case 'Grading view':
244
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
245
- break;
246
- };
247
- });
248
-
249
- beforeEach(() => {
250
- switch (view) {
251
- case 'Question preview':
252
- shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
253
- shortTextResponsePage.steps.resetQuestionPreview();
254
- break;
255
- case 'Item preview':
256
- shortTextResponsePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
257
- itemPreviewPage.steps.resetQuestionPreview();
258
- break;
259
- case 'Grading view':
260
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
261
- break;
262
- }
263
- });
264
-
265
- if (view === 'Question preview') {
266
- after(() => {
267
- shortTextResponsePage.steps.clickOnSaveQuestionButton();
268
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
269
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
270
- });
271
- };
272
-
273
- it('When the user selects "Grading" view without attempting the question, non-scoring label should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label "Correct answers" should be displayed with correct answers and correct/incorrect icons should not be displayed', () => {
274
- if (view === 'Grading view') {
275
- studentViewPage.steps.submitResponse();
276
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
277
- studentViewPage.steps.clickOnGoToGradingViewButton();
278
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
279
- };
280
- if (view === 'Question preview' || view === 'Item preview') {
281
- shortTextResponsePage.steps.checkNonScoredScoringLabel();
282
- shortTextResponsePage.steps.switchToGradingView();
283
- };
284
- utilities.verifyInnerText(shortTextResponsePage.previewTabCorrectAnswerLabel(), 'Correct answer:');
285
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Urbanization');
286
- });
287
-
288
- it('When the user attempts the question incorrectly, then non-scoring label should be displayed and on switching to "Grading" view, incorrect icon should be displayed beside the incorrect response, and correct answer should be displayed in the question preview', () => {
289
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Incorrect Answer');
290
- if (view === 'Grading view') {
291
- studentViewPage.steps.submitResponse();
292
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
293
- studentViewPage.steps.clickOnGoToGradingViewButton();
294
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
295
- };
296
- if (view === 'Question preview' || view === 'Item preview') {
297
- shortTextResponsePage.steps.checkNonScoredScoringLabel();
298
- shortTextResponsePage.steps.switchToGradingView();
299
- };
300
- shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
301
- shortTextResponsePage.steps.verifyIncorrectIcon();
302
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Urbanization');
303
- });
304
-
305
- it('When the user attempts the question partially correct then non-scoring label should be displayed and on switching to "Grading" view, correct icon should be displayed beside the correct part of the response, incorrect icon should be displayed beside the incorrect part, and correct answer should be displayed in the question preview', () => {
306
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Urban');
307
- if (view === 'Grading view') {
308
- studentViewPage.steps.submitResponse();
309
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
310
- studentViewPage.steps.clickOnGoToGradingViewButton();
311
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
312
- };
313
- if (view === 'Question preview' || view === 'Item preview') {
314
- shortTextResponsePage.steps.checkNonScoredScoringLabel();
315
- shortTextResponsePage.steps.switchToGradingView();
316
- };
317
- shortTextResponsePage.steps.verifyIncorrectAttemptBorder();
318
- shortTextResponsePage.steps.verifyIncorrectIcon();
319
- shortTextResponsePage.steps.verifyCorrectAnswerResponseInCorrectAnswerWrapper('Urbanization');
320
- });
321
-
322
- it('When the user attempts the question correctly, and on switching to "Grading" view, non-scoring label should be displayed, correct icons should be displayed beside the correct responses, a status message with text "Your answer is correct" should be displayed and correct answer section should not be displayed', () => {
323
- shortTextResponsePage.steps.enterTextInAnswerInputFieldPreviewTab('Urbanization');
324
- if (view === 'Grading view') {
325
- studentViewPage.steps.submitResponse();
326
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
327
- studentViewPage.steps.clickOnGoToGradingViewButton();
328
- gradingViewPage.steps.verifyScoresNotVisibleForNonScoredQuestions();
329
- };
330
- if (view === 'Question preview' || view === 'Item preview') {
331
- shortTextResponsePage.steps.checkNonScoredScoringLabel();
332
- shortTextResponsePage.steps.switchToGradingView();
333
- };
334
- shortTextResponsePage.steps.verifyCorrectAttemptBorder();
335
- shortTextResponsePage.steps.verifyCorrectIcon();
336
- shortTextResponsePage.steps.verifyCorrectAnswerWrapperNotExist();
337
- });
338
- });
339
- });
340
-
341
155
  if (!grepTags || !grepTags.includes('smoke')) {
342
156
  describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
343
157
  abortEarlySetup();
@@ -6,6 +6,7 @@ const selectors = {
6
6
  ...dialogBoxBase,
7
7
  colorBlock: () => cy.get('.color-picker-block'),
8
8
  colorSaturationPalette: () => cy.get('.react-colorful__saturation'),
9
+ alphaPicker : () => cy.get('.react-colorful__alpha'),
9
10
  colorSaturationPicker: () => cy.get('.react-colorful__saturation-pointer .react-colorful__pointer-fill'),
10
11
  colorHuePalette: () => cy.get('.react-colorful__hue'),
11
12
  colorHuePicker: () => cy.get('.react-colorful__hue-pointer .react-colorful__pointer-fill'),
@@ -97,6 +98,11 @@ const steps = {
97
98
  .click();
98
99
  },
99
100
 
101
+ clickInAlphaPicker: () => {
102
+ colorPopupComponent.alphaPicker()
103
+ .click();
104
+ },
105
+
100
106
  clickInColorHuePalette: () => {
101
107
  colorPopupComponent.colorHuePalette()
102
108
  .click();
@@ -1349,6 +1349,21 @@ const steps = {
1349
1349
  });
1350
1350
  },
1351
1351
 
1352
+ /**
1353
+ * @param {number} index index of highlight region
1354
+ * @param {string} colorWithOpacity color to be checked in rgba format
1355
+ * @description this function verifiies the border color of highlight regions in specify correct answer section.
1356
+ */
1357
+ verifyEditedBorderOpacityInSpecifyCorrectAnswerSection: (index, colorWithOpacity) => {
1358
+ imageHighlightPage.specifyCorrectAnswerSectionHighlight()
1359
+ .eq(index)
1360
+ .within(() => {
1361
+ utilities.verifyCSS(imageHighlightPage.specifyCorrectAnswerSectionHighlightPolygon(), {
1362
+ 'stroke': colorWithOpacity
1363
+ });
1364
+ });
1365
+ },
1366
+
1352
1367
  /**
1353
1368
  * @param {number} index index of highlight region
1354
1369
  * @param {string} color color to be checked in rgb/rgba format
@@ -1366,6 +1381,23 @@ const steps = {
1366
1381
  });
1367
1382
  });
1368
1383
  },
1384
+ /**
1385
+ * @param {number} index index of highlight region
1386
+ * @param {string} colorWithOpacity color to be checked in rgba format
1387
+ * @description this function verifies the border color of highlight regions in preview tab.
1388
+ */
1389
+ verifyEditedBorderOpacityInPreviewtabSection: (index, colorWithOpacity) => {
1390
+ imageHighlightPage.previewTabQuestionWrapper()
1391
+ .within(() => {
1392
+ imageHighlightPage.previewSectionHighlight()
1393
+ .eq(index)
1394
+ .within(() => {
1395
+ utilities.verifyCSS(imageHighlightPage.specifyCorrectAnswerSectionHighlightPolygon(), {
1396
+ 'stroke': colorWithOpacity
1397
+ });
1398
+ });
1399
+ });
1400
+ },
1369
1401
 
1370
1402
  verifyBorderStyleButtonsVisible: () => {
1371
1403
  utilities.verifyElementVisibilityState(imageHighlightPage.popupBorderStyleButtons().eq(0), 'visible');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.364-IEI-6049-and-IEI-6066-manualAndNonScoredScript-b38e163.0",
3
+ "version": "1.0.364-IEI-5423-cypress-636f028.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {