itemengine-cypress-automation 1.0.68 → 1.0.69
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/fixtures/theme/ilc.json +2 -1
- package/cypress/pages/audioPlayerPage.js +2 -2
- package/cypress/pages/components/additionalSettingsPanel.js +46 -14
- package/cypress/pages/components/autoScoredAdditionalSettings.js +6 -6
- package/cypress/pages/components/autoScoredPreviewBase.js +6 -8
- package/cypress/pages/components/autoScoredScoringSection.js +22 -18
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +60 -9
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +7 -7
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/components/draggableOptionsContainer.js +2 -1
- package/cypress/pages/components/equationEditorFlyout.js +2 -1
- package/cypress/pages/components/essayResponseCommonComponents.js +10 -4
- package/cypress/pages/components/figOverImageCommonComponent.js +2 -1
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +34 -14
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +7 -7
- package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
- package/cypress/pages/components/mcqAdditionalSettingsBase.js +10 -0
- package/cypress/pages/components/mcqQuestionCommonComponents.js +1 -1
- package/cypress/pages/components/mcqScoringComponent.js +1 -1
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +20 -18
- package/cypress/pages/components/questionInstructionsComponent.js +1 -1
- package/cypress/pages/components/scoringSectionBase.js +30 -1
- package/cypress/pages/components/setPointsPopupBase.js +2 -1
- package/cypress/pages/components/uploadImageSectionComponent.js +8 -8
- package/cypress/pages/createItemPage.js +83 -1
- package/cypress/pages/dialogBoxBase.js +3 -7
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +5 -4
- package/cypress/pages/essayResponsePage.js +1 -0
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -0
- package/cypress/pages/fillInTheGapsScoring.js +215 -317
- package/cypress/pages/highlightImagePage.js +6 -4
- package/cypress/pages/highlightPage.js +1 -2
- package/cypress/pages/index.js +4 -0
- package/cypress/pages/listMatchingPage.js +5 -4
- package/cypress/pages/listMatchingScoring.js +274 -272
- package/cypress/pages/listOrderingPage.js +23 -14
- package/cypress/pages/listSortingPage.js +7 -9
- package/cypress/pages/multipleSelectionPage.js +2 -1
- package/cypress/pages/shortTextResponsePage.js +9 -0
- package/cypress/pages/singleSelectionPage.js +1 -0
- package/cypress/pages/uploadResponsePage.js +296 -15
- package/cypress/pages/videoResponsePage.js +5 -6
- package/package.json +1 -1
@@ -178,6 +178,19 @@ const steps = {
|
|
178
178
|
fillInTheGapsCommonComponents.previewTabCorrectAnswerResponseWrapper()
|
179
179
|
.should('have.length', correctAnswerArray.length);
|
180
180
|
},
|
181
|
+
|
182
|
+
setPlaceholderText: (placeholder) => {
|
183
|
+
fillInTheGapsCommonComponents.placeholderTextInputField()
|
184
|
+
.type(placeholder)
|
185
|
+
.should('have.value', placeholder);
|
186
|
+
},
|
187
|
+
|
188
|
+
setResponseContainerHeight: (height) => {
|
189
|
+
fillInTheGapsCommonComponents.heightInputField()
|
190
|
+
.type(height)
|
191
|
+
.should('have.value', height)
|
192
|
+
.blur();
|
193
|
+
}
|
181
194
|
}
|
182
195
|
|
183
196
|
const tests = {
|
@@ -246,17 +259,19 @@ const tests = {
|
|
246
259
|
autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
|
247
260
|
.should('have.value', '')
|
248
261
|
.and('be.visible');
|
262
|
+
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
263
|
+
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
249
264
|
scoringSectionBase.minimumScoreIfAttemptedLabel()
|
250
|
-
.verifyInnerText('Minimum
|
265
|
+
.verifyInnerText('Minimum points')
|
251
266
|
.and('be.visible');
|
252
267
|
scoringSectionBase.minimumScoreIfAttemptedInputField()
|
253
268
|
.should('have.value', '')
|
254
269
|
.and('be.visible');
|
255
270
|
autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
|
256
|
-
.verifyInnerText('
|
271
|
+
.verifyInnerText('Rounding')
|
257
272
|
.and('be.visible');
|
258
|
-
autoScoredScoringSectionMultipleResponsesType.
|
259
|
-
.
|
273
|
+
autoScoredScoringSectionMultipleResponsesType.roundingDropdown()
|
274
|
+
.verifyInnerText('None');
|
260
275
|
});
|
261
276
|
|
262
277
|
it('When user gives a score input to \'Points\' input field, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
|
@@ -299,13 +314,13 @@ const tests = {
|
|
299
314
|
scoringSectionBase.minimumScoreIfAttemptedLabel()
|
300
315
|
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
301
316
|
autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
|
302
|
-
.verifyCSS(css.color.
|
317
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
303
318
|
});
|
304
319
|
|
305
320
|
it('Accessibility of \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input field and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
|
306
321
|
cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField());
|
307
322
|
cy.checkAccessibility(scoringSectionBase.minimumScoreIfAttemptedInputField());
|
308
|
-
cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.
|
323
|
+
cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.roundingDropdown());
|
309
324
|
});
|
310
325
|
|
311
326
|
it('When the user switches to \'All or nothing\' scoring, the \'Points per response\' label and the points displayed for individual responses should not be displayed and the points displayed in \'Points\' input field should remain unchanged', () => {
|
@@ -355,17 +370,19 @@ const tests = {
|
|
355
370
|
autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
|
356
371
|
.should('have.value', '')
|
357
372
|
.and('be.visible');
|
373
|
+
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
374
|
+
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
358
375
|
scoringSectionBase.minimumScoreIfAttemptedLabel()
|
359
|
-
.verifyInnerText('Minimum
|
376
|
+
.verifyInnerText('Minimum points')
|
360
377
|
.and('be.visible');
|
361
378
|
scoringSectionBase.minimumScoreIfAttemptedInputField()
|
362
379
|
.should('have.value', '')
|
363
380
|
.and('be.visible');
|
364
381
|
autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
|
365
|
-
.verifyInnerText('
|
382
|
+
.verifyInnerText('Rounding')
|
366
383
|
.and('be.visible');
|
367
|
-
autoScoredScoringSectionMultipleResponsesType.
|
368
|
-
.
|
384
|
+
autoScoredScoringSectionMultipleResponsesType.roundingDropdown()
|
385
|
+
.verifyInnerText('None');
|
369
386
|
});
|
370
387
|
|
371
388
|
it('When the user has not set any answer in the response, then the \'Points per response\' input field should be disabled', () => {
|
@@ -399,13 +416,13 @@ const tests = {
|
|
399
416
|
scoringSectionBase.minimumScoreIfAttemptedLabel()
|
400
417
|
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
401
418
|
autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel()
|
402
|
-
.verifyCSS(css.color.
|
419
|
+
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
403
420
|
});
|
404
421
|
|
405
422
|
it('Accessibility of \'Points per response\', \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
|
406
423
|
cy.checkAccessibility(scoringSectionBase.pointsInputField());
|
407
424
|
cy.checkAccessibility(scoringSectionBase.minimumScoreIfAttemptedInputField());
|
408
|
-
cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.
|
425
|
+
cy.checkAccessibility(autoScoredScoringSectionMultipleResponsesType.roundingDropdown());
|
409
426
|
});
|
410
427
|
|
411
428
|
it('When the user switches to \'All or nothing\' scoring, the points added for individual responses in Partial - different weights scoring should get summed up in the All or nothing scoring Points input field', () => {
|
@@ -430,7 +447,7 @@ const tests = {
|
|
430
447
|
},
|
431
448
|
|
432
449
|
verifyManuallyScoredScoringContents: () => {
|
433
|
-
it('When the user has selected \'Manually Scored\' option from the Scoring Type dropdown then the \'Set Correct Answer\' section should not be displayed; \'All or Nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed; and inside Additional Settings accordion Check Answer section i.e. \'Allow
|
450
|
+
it('When the user has selected \'Manually Scored\' option from the Scoring Type dropdown then the \'Set Correct Answer\' section should not be displayed; \'All or Nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed; and inside Additional Settings accordion Check Answer section i.e. \'Allow student to check answer\' checkbox should not be displayed', () => {
|
434
451
|
autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel()
|
435
452
|
.should('not.exist');
|
436
453
|
autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox()
|
@@ -439,8 +456,11 @@ const tests = {
|
|
439
456
|
.should('not.exist');
|
440
457
|
autoScoredScoringSectionMultipleResponsesType.partialDifferentWeightsCheckbox()
|
441
458
|
.should('not.exist');
|
459
|
+
cy.log('Pre-step: Selecting minimum scoring from dropdown');
|
460
|
+
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
461
|
+
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
442
462
|
scoringSectionBase.minimumScoreIfAttemptedLabel()
|
443
|
-
.verifyInnerText('Minimum
|
463
|
+
.verifyInnerText('Minimum points')
|
444
464
|
.and('be.visible');
|
445
465
|
scoringSectionBase.minimumScoreIfAttemptedInputField()
|
446
466
|
.should('have.value', '')
|
@@ -468,7 +468,7 @@ const tests = {
|
|
468
468
|
},
|
469
469
|
|
470
470
|
verifyManualScoringEditTabFunctionality: () => {
|
471
|
-
it('When the user has selected \'Manually scored\' option from the \'Scoring type\' dropdown then the \'Set correct answer\' section should not be displayed; \'All or nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and inside additional settings accordion, Check answer section i.e. \'Allow
|
471
|
+
it('When the user has selected \'Manually scored\' option from the \'Scoring type\' dropdown then the \'Set correct answer\' section should not be displayed; \'All or nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and inside additional settings accordion, Check answer section i.e. \'Allow student to check answer\' checkbox should not be displayed', () => {
|
472
472
|
utilities.verifyElementVisibilityState(autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel(), 'notExist');
|
473
473
|
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox(), 'notExist');
|
474
474
|
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckbox(), 'notExist');
|
@@ -691,15 +691,15 @@ const steps = {
|
|
691
691
|
* @param {string[]} optionNumerationArray - An array of expected numeration strings to verify.
|
692
692
|
*/
|
693
693
|
verifyResponseFieldNumeration: (optionNumerationArray) => {
|
694
|
-
|
695
|
-
.
|
696
|
-
|
697
|
-
|
694
|
+
optionNumerationArray.forEach((optionNumeration, count) => {
|
695
|
+
fillInTheGapsTextCommonComponent.previewTabResponseWrapper()
|
696
|
+
.eq(count)
|
697
|
+
.should('be.visible')
|
698
|
+
.within(() => {
|
698
699
|
fillInTheGapsTextCommonComponent.responseNumeration()
|
699
|
-
.eq(count)
|
700
700
|
.should('have.text', `${optionNumeration}`);
|
701
701
|
});
|
702
|
-
|
702
|
+
});
|
703
703
|
}
|
704
704
|
}
|
705
705
|
|
@@ -856,7 +856,7 @@ const tests = {
|
|
856
856
|
},
|
857
857
|
|
858
858
|
verifyManualScoringEditTabFunctionality: () => {
|
859
|
-
it('When the user has selected \'Manually scored\' option from the \'Scoring type\' dropdown then the \'Set correct answer\' section should not be displayed; \'All or nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and inside additional settings accordion, Check answer section i.e. \'Allow
|
859
|
+
it('When the user has selected \'Manually scored\' option from the \'Scoring type\' dropdown then the \'Set correct answer\' section should not be displayed; \'All or nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and inside additional settings accordion, Check answer section i.e. \'Allow student to check answer\' checkbox should not be displayed', () => {
|
860
860
|
utilities.verifyElementVisibilityState(autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel(), 'notExist');
|
861
861
|
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox(), 'notExist');
|
862
862
|
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckbox(), 'notExist');
|
@@ -350,7 +350,7 @@ const tests = {
|
|
350
350
|
scoringSectionBase.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored')
|
351
351
|
});
|
352
352
|
|
353
|
-
it('When the user has selected \'Manually Scored\' option from the Scoring Type dropdown then the \'Set Correct Answer\' section should not be displayed; \'All or Nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed; and inside Additional Settings accordion Check Answer section i.e. \'Allow
|
353
|
+
it('When the user has selected \'Manually Scored\' option from the Scoring Type dropdown then the \'Set Correct Answer\' section should not be displayed; \'All or Nothing\', \'Partial - equal weights\' and \'Partial - different weights\' radio buttons should not be displayed; \'Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed; and inside Additional Settings accordion Check Answer section i.e. \'Allow student to check answer\' checkbox should not be displayed', () => {
|
354
354
|
utilities.verifyElementVisibilityState(autoScoredSetCorrectAnswerSection.setCorrectAnswerLabel(), 'notExist');
|
355
355
|
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.allOrNothingCheckbox(), 'notExist');
|
356
356
|
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.partialEqualWeightsCheckbox(), 'notExist');
|
@@ -39,6 +39,15 @@ const selectors = {
|
|
39
39
|
optionOrientationListOptions: (optionIndex) => cy.get('[aria-labelledby="Option-Orientation-dropdown-label Option-Orientation-placeholder"] li[role="option"]').eq(optionIndex)
|
40
40
|
}
|
41
41
|
|
42
|
+
const steps = {
|
43
|
+
selectNumberOfOptionColumnsFromDropdown: (optionNumber) => {
|
44
|
+
mcqAdditionalSettingsBase.numberOfOptionColumnsDropdown()
|
45
|
+
.click();
|
46
|
+
mcqAdditionalSettingsBase.numberOfOptionColumnsListOptions(optionNumber)
|
47
|
+
.click();
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
42
51
|
const tests = {
|
43
52
|
verifyNumberOfOptionsColumns: (orientation) => {
|
44
53
|
let option = [2, 3, 4, 5, 6];
|
@@ -386,5 +395,6 @@ const tests = {
|
|
386
395
|
|
387
396
|
export const mcqAdditionalSettingsBase = {
|
388
397
|
...selectors,
|
398
|
+
steps,
|
389
399
|
tests
|
390
400
|
}
|
@@ -159,7 +159,7 @@ const tests = {
|
|
159
159
|
|
160
160
|
verifyEditTabCorrectAnswerSectionAndPreviewTabFontSize: () => {
|
161
161
|
//TODO: Comment: we'll need to move to object loopings in case of 2 parameters please ask for more details
|
162
|
-
const fontsizes = ['
|
162
|
+
const fontsizes = ['Tiny', 'Small', 'Default', 'Normal', 'Big', 'Huge'];
|
163
163
|
const font = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
164
164
|
fontsizes.forEach((option, count) => {
|
165
165
|
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview (options, question instructions and check answer button) should be changed to ${option} in the \'Set Correct Answer\' section as well as in the \'Preview\' tab`, () => {
|
@@ -4,13 +4,18 @@ const css = Cypress.env('css');
|
|
4
4
|
const selectors = {
|
5
5
|
showCorrectAnswerCheckbox: () => cy.get('input[aria-label="Show correct answer"]'),
|
6
6
|
showCorrectAnswerCheckboxLabel: () => cy.get('.showAnswer-options-label').eq(1),
|
7
|
-
previewScoreText: () => cy.get('
|
7
|
+
previewScoreText: () => cy.get('[class*="PreviewTabstyles__ScoreWrapper"]'),
|
8
|
+
gradingViewRadioButton: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper input').eq(1),
|
9
|
+
studentViewRadioButton: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper input').eq(0),
|
10
|
+
studentViewRadioButtonLabel: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper label').eq(0),
|
11
|
+
gradingViewRadioButtonLabel: () => cy.get('.edit-question-preview-wrapper .ngie-radio-group-wrapper .radio-option-wrapper label').eq(1),
|
12
|
+
previewScoreLabel: () => cy.get('[class*="PreviewTabstyles__ScoreLabelWrapper"]')
|
8
13
|
}
|
9
14
|
|
10
15
|
const steps = {
|
11
16
|
//V3 - This function should be updated in all files
|
12
17
|
checkShowCorrectAnswerCheckbox: () => {
|
13
|
-
previewScoringAndShowCorrectAnswerComponent.
|
18
|
+
previewScoringAndShowCorrectAnswerComponent.gradingViewRadioButton()
|
14
19
|
.click()
|
15
20
|
.should('be.checked');
|
16
21
|
},
|
@@ -18,18 +23,15 @@ const steps = {
|
|
18
23
|
//V3 - This function should be updated in all files
|
19
24
|
uncheckShowCorrectAnswerCheckbox: () => {
|
20
25
|
cy.log('Deselect the show correct checkbox')
|
21
|
-
previewScoringAndShowCorrectAnswerComponent.
|
26
|
+
previewScoringAndShowCorrectAnswerComponent.studentViewRadioButton()
|
22
27
|
.click()
|
23
|
-
.should('
|
28
|
+
.should('be.checked');
|
24
29
|
},
|
25
30
|
|
26
31
|
//V3 - This function should be updated in all files
|
27
32
|
verifyDefaultShowCorrectAnswerCheckboxAndLabel: () => {
|
28
|
-
previewScoringAndShowCorrectAnswerComponent.
|
29
|
-
.verifyInnerText('
|
30
|
-
previewScoringAndShowCorrectAnswerComponent.showCorrectAnswerCheckbox()
|
31
|
-
.should('exist')
|
32
|
-
.and('not.be.checked');
|
33
|
+
previewScoringAndShowCorrectAnswerComponent.previewScoreLabel()
|
34
|
+
.verifyInnerText('Score:');
|
33
35
|
},
|
34
36
|
|
35
37
|
//V3 - This function should be updated in all files
|
@@ -45,24 +47,24 @@ const steps = {
|
|
45
47
|
}
|
46
48
|
|
47
49
|
const tests = {
|
48
|
-
verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab: () => {
|
50
|
+
verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab: (scoringType) => {
|
49
51
|
it('Show correct answer checkbox as well as points besides it should not be displayed', () => {
|
50
52
|
previewScoringAndShowCorrectAnswerComponent.showCorrectAnswerCheckbox()
|
51
53
|
.should('not.exist');
|
52
54
|
previewScoringAndShowCorrectAnswerComponent.previewScoreText()
|
53
|
-
.
|
55
|
+
.verifyInnerText(scoringType);
|
54
56
|
});
|
55
57
|
},
|
56
58
|
|
57
59
|
//V3 - This function should be updated in all files
|
58
60
|
verifyShowCorrectAnswerLabelAndCheckboxExistAndPreviewScoreNotExistInPreviewTab: () => {
|
59
61
|
it('Show correct answer checkbox should be displayed and it should be unchecked by default and points should not be displayed beside it ', () => {
|
60
|
-
previewScoringAndShowCorrectAnswerComponent.
|
62
|
+
previewScoringAndShowCorrectAnswerComponent.gradingViewRadioButton()
|
61
63
|
.should('not.be.checked');
|
62
|
-
previewScoringAndShowCorrectAnswerComponent.
|
63
|
-
.
|
64
|
+
previewScoringAndShowCorrectAnswerComponent.studentViewRadioButton()
|
65
|
+
.should('be.checked');
|
64
66
|
previewScoringAndShowCorrectAnswerComponent.previewScoreText()
|
65
|
-
.
|
67
|
+
.verifyInnerText('Non scored');
|
66
68
|
});
|
67
69
|
},
|
68
70
|
|
@@ -76,9 +78,9 @@ const tests = {
|
|
76
78
|
createQuestionBasePage.previewTab()
|
77
79
|
.verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.bold);
|
78
80
|
previewScoringAndShowCorrectAnswerComponent.previewScoreText()
|
79
|
-
.verifyCSS(css.color.
|
80
|
-
previewScoringAndShowCorrectAnswerComponent.
|
81
|
-
.verifyCSS(css.color.
|
81
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
82
|
+
previewScoringAndShowCorrectAnswerComponent.previewScoreLabel()
|
83
|
+
.verifyCSS(css.color.text, css.fontSize.normal, css.fontWeight.regular);
|
82
84
|
});
|
83
85
|
}
|
84
86
|
}
|
@@ -5,7 +5,7 @@ const css = Cypress.env('css');
|
|
5
5
|
const selectors = {
|
6
6
|
questionInstructionsLabelEditTab: () => cy.get('.edit-question-instruction-label'),
|
7
7
|
questionInstructionsInputField: () => cy.get('[title="Question Instructions"]'),
|
8
|
-
questionInstructionsText: () => cy.get('.question-instruction')
|
8
|
+
questionInstructionsText: () => cy.get('.question-instruction'),
|
9
9
|
}
|
10
10
|
|
11
11
|
const steps = {
|
@@ -14,6 +14,15 @@ const selectors = {
|
|
14
14
|
pointsInputField: () => cy.get('.points-input-field input[type="text"]'),
|
15
15
|
pleaseEnterPointsErrorMessage: () => cy.get('[class*="ErrorBlockstyles__ErrorText"]'),
|
16
16
|
pointsWrapper: () => cy.get('.set-correct-answer-points-wrapper'),
|
17
|
+
minimumScoringLabel: () => cy.get('#minimum-scoring-dropdown-label'),
|
18
|
+
minimumScoringDropdown: () => cy.get('#minimum-scoring-select'),
|
19
|
+
minimumScoringDropdownListOptions: (ariaLabel = null) => {
|
20
|
+
if (ariaLabel) {
|
21
|
+
return cy.get(`[aria-labelledby*="minimum-scoring-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
|
22
|
+
} else {
|
23
|
+
return cy.get('[aria-labelledby*="minimum-scoring-dropdown-label"] [role="option"]')
|
24
|
+
}
|
25
|
+
},
|
17
26
|
}
|
18
27
|
|
19
28
|
const steps = {
|
@@ -34,8 +43,11 @@ const steps = {
|
|
34
43
|
},
|
35
44
|
|
36
45
|
verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField: () => {
|
46
|
+
//Enhancement: Will need to update these steps when updating scripts
|
47
|
+
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
48
|
+
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
37
49
|
scoringSectionBase.minimumScoreIfAttemptedLabel()
|
38
|
-
.verifyInnerText('Minimum
|
50
|
+
.verifyInnerText('Minimum points');
|
39
51
|
scoringSectionBase.minimumScoreIfAttemptedInputField()
|
40
52
|
.should('have.value', '')
|
41
53
|
.and('be.visible');
|
@@ -115,6 +127,20 @@ const steps = {
|
|
115
127
|
.eq(index)
|
116
128
|
.focus()
|
117
129
|
.blur();
|
130
|
+
},
|
131
|
+
|
132
|
+
expandMinimumScoringDropdown: () => {
|
133
|
+
scoringSectionBase.minimumScoringDropdown()
|
134
|
+
.click();
|
135
|
+
},
|
136
|
+
|
137
|
+
/**
|
138
|
+
* @param {('No minimum score'| 'Award minimum score'|'Award minimum score only if attempted')} listOption
|
139
|
+
* @description this function selects an option from expanded minimum scoring dropdown
|
140
|
+
*/
|
141
|
+
selectMinimumScoringTypeListOption: (listOption) => {
|
142
|
+
scoringSectionBase.minimumScoringDropdownListOptions(listOption)
|
143
|
+
.click();
|
118
144
|
}
|
119
145
|
}
|
120
146
|
|
@@ -229,6 +255,9 @@ const tests = {
|
|
229
255
|
*/
|
230
256
|
verifyMinimumScoreIfAttemptedFieldErrorState: (allocatedPoints, minimumPoints, maxPoints) => {
|
231
257
|
it('When the user focuses in and out of the empty Minimum score awarded (if attempted) input field, any validation text should not be displayed', () => {
|
258
|
+
cy.log('Pre-step: Selecting minimum scoring');
|
259
|
+
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
260
|
+
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
232
261
|
scoringSectionBase.minimumScoreIfAttemptedInputField()
|
233
262
|
.click()
|
234
263
|
.blur();
|
@@ -4,6 +4,7 @@ import { scoringSectionBase } from "./scoringSectionBase";
|
|
4
4
|
|
5
5
|
const selector = {
|
6
6
|
...dialogBoxBase,
|
7
|
+
dialogBox: () => cy.get('[aria-labelledby="alert-dialog-title"][role="alertdialog"]'),
|
7
8
|
setPointsPopupOptions: () => cy.get('#alert-dialog-description .question-text-wrapper'),
|
8
9
|
setPointsPopupPointsLabel: () => cy.get('[class*="ListOrderingstyles__PointsLabel"]')
|
9
10
|
}
|
@@ -34,7 +35,7 @@ const steps = {
|
|
34
35
|
scoringSectionBase.pointsInputField()
|
35
36
|
.eq(index)
|
36
37
|
.clear()
|
37
|
-
.type(points)
|
38
|
+
.type(points, { delay: 500 })
|
38
39
|
.should('have.value', points);
|
39
40
|
});
|
40
41
|
});
|
@@ -17,15 +17,15 @@ const selector = {
|
|
17
17
|
deleteImageButton: () => cy.get('.edit-delete-btn-wrapper button').eq(1),
|
18
18
|
//Upload image popup
|
19
19
|
inputTypeFile: () => cy.get('input[type="file"]'),
|
20
|
-
uploadImagePopup: () => cy.get('
|
21
|
-
imagePopupTitle: () => cy.get('
|
20
|
+
uploadImagePopup: () => cy.get('.image-upload-popup'),
|
21
|
+
imagePopupTitle: () => cy.get('.dialog-title'),
|
22
22
|
imagePopupPreviewLabel: () => cy.get('.preview-label-wrapper'),
|
23
|
-
imagePopupWidthLabel: () => cy.get('
|
24
|
-
imagePopupWidthInputField: () => cy.get('
|
25
|
-
imagePopupHeightLabel: () => cy.get('
|
26
|
-
imagePopupHeightInputField: () => cy.get('
|
27
|
-
buttonAspectRatio: () => cy.get('
|
28
|
-
buttonResetDimensions: () => cy.get('
|
23
|
+
imagePopupWidthLabel: () => cy.get('.image-upload-popup .highlight-image-property-label.text-label').eq(0),
|
24
|
+
imagePopupWidthInputField: () => cy.get('.image-upload-popup .highlight-image-input-field input').eq(0),
|
25
|
+
imagePopupHeightLabel: () => cy.get('.image-upload-popup .highlight-image-property-label.text-label').eq(1),
|
26
|
+
imagePopupHeightInputField: () => cy.get('.image-upload-popup .highlight-image-input-field input').eq(1),
|
27
|
+
buttonAspectRatio: () => cy.get('.lock-unlock-reset-btn').eq(0),
|
28
|
+
buttonResetDimensions: () => cy.get('.lock-unlock-reset-btn').eq(1),
|
29
29
|
imagePopupButtonCancel: () => cy.get('.compact-popup-action-button-wrapper button').eq(0),
|
30
30
|
imagePopupButtonOk: () => cy.get('.compact-popup-action-button-wrapper button').eq(1),
|
31
31
|
imagePopupButtonReplace: () => cy.get('.preview-replace-button'),
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import utilities from "../support/helpers/utilities";
|
2
|
+
|
1
3
|
const css = Cypress.env('css');
|
2
4
|
|
3
5
|
const selectors = {
|
@@ -12,7 +14,14 @@ const selectors = {
|
|
12
14
|
referenceId: () => cy.get('.edit-item-reference-id'),
|
13
15
|
itemTitle: () => cy.get('.ItemLevel-Header'),
|
14
16
|
tagsButton: () => cy.get('.ngie-button').contains('Tags'),
|
15
|
-
tagsInputField: () => cy.get('.tags-chip-container')
|
17
|
+
tagsInputField: () => cy.get('.tags-chip-container'),
|
18
|
+
editItemPageWrapper: () => cy.get('.edit-wrapper'),
|
19
|
+
editItemReferenceId: () => cy.get('.edit-item-reference-id'),
|
20
|
+
applyChangesButton: () => cy.get('.ngie-btn-contained').contains('Apply changes'),
|
21
|
+
editTitleIcon: () => cy.get('.icon-pencil'),
|
22
|
+
titleInputField: () => cy.get('.edit-box-header-input-wrapper'),
|
23
|
+
submitButton: () => cy.get('[class*="StudentViewstyles__ButtonsWrapper"] button').eq(1),
|
24
|
+
studentViewReferenceId: () => cy.get('[class*="StudentViewstyles__ViewInfoWrapper"]')
|
16
25
|
}
|
17
26
|
|
18
27
|
const steps = {
|
@@ -30,6 +39,23 @@ const steps = {
|
|
30
39
|
cy.visit('/item-engine/demo/create-item');
|
31
40
|
},
|
32
41
|
|
42
|
+
/**
|
43
|
+
* @param {string} reference id of the question to be navigated
|
44
|
+
* @description this function navigates to the edit item page of the
|
45
|
+
*/
|
46
|
+
navigateToEditItemUsingReferenceID: (reference) => {
|
47
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(reference)}`);
|
48
|
+
},
|
49
|
+
|
50
|
+
navigateToEditItemPage: () => {
|
51
|
+
createItemPage.referenceId()
|
52
|
+
.invoke('text')
|
53
|
+
.then(text => {
|
54
|
+
const referenceId = text;
|
55
|
+
steps.navigateToEditItemUsingReferenceID(referenceId);
|
56
|
+
});
|
57
|
+
},
|
58
|
+
|
33
59
|
verifyCreateItemContainerIsVisible: () => {
|
34
60
|
createItemPage.createItemContainer()
|
35
61
|
.should('be.visible');
|
@@ -52,6 +78,62 @@ const steps = {
|
|
52
78
|
verifyTagsInInputField: (arrayOfTags) => {
|
53
79
|
createItemPage.tagsInputField()
|
54
80
|
.should('have.text', arrayOfTags.sort().join(''));
|
81
|
+
},
|
82
|
+
|
83
|
+
/**
|
84
|
+
* @param {string[]} arrayOfTags of text that need to enter in tags input field
|
85
|
+
* @description set tags for an item
|
86
|
+
*/
|
87
|
+
setTags: (arrayOfTags) => {
|
88
|
+
steps.clickOnTagsButton()
|
89
|
+
for (let index = 0; index < arrayOfTags.length; index++) {
|
90
|
+
createItemPage.tagsInputField()
|
91
|
+
.type(`${arrayOfTags[index]}{enter}`);
|
92
|
+
}
|
93
|
+
createItemPage.applyChangesButton()
|
94
|
+
.click();
|
95
|
+
},
|
96
|
+
|
97
|
+
/**
|
98
|
+
* @param {string[]} value of text that need to enter in title input field
|
99
|
+
* @description this function enters text in title input field
|
100
|
+
*/
|
101
|
+
enterTitle: (value) => {
|
102
|
+
createItemPage.titleInputField()
|
103
|
+
.type(value);
|
104
|
+
},
|
105
|
+
|
106
|
+
clickOnSubmitButton: () => {
|
107
|
+
createItemPage.submitButton()
|
108
|
+
.click();
|
109
|
+
},
|
110
|
+
|
111
|
+
|
112
|
+
navigateToStudentViewPage: () => {
|
113
|
+
createItemPage.referenceId()
|
114
|
+
.invoke('text')
|
115
|
+
.then(text => {
|
116
|
+
const referenceId = text;
|
117
|
+
steps.navigateToStudentViewUsingReferenceID(referenceId);
|
118
|
+
});
|
119
|
+
},
|
120
|
+
|
121
|
+
navigateToEditItemPageFromStudentView: () => {
|
122
|
+
createItemPage.studentViewReferenceId()
|
123
|
+
.invoke('text')
|
124
|
+
.then(text => {
|
125
|
+
let value = text;
|
126
|
+
let referenceId = value.split(':')[1].trim();
|
127
|
+
steps.navigateToEditItemUsingReferenceID(referenceId);
|
128
|
+
});
|
129
|
+
},
|
130
|
+
|
131
|
+
/**
|
132
|
+
* @param {string} reference id of the question to be navigated
|
133
|
+
* @description this function navigates to the student view page
|
134
|
+
*/
|
135
|
+
navigateToStudentViewUsingReferenceID: (reference) => {
|
136
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(reference)}`);
|
55
137
|
}
|
56
138
|
}
|
57
139
|
|
@@ -3,11 +3,11 @@ import { createQuestionBasePage } from "./components";
|
|
3
3
|
const css = Cypress.env('css');
|
4
4
|
|
5
5
|
const selectors = {
|
6
|
-
dialogBox: () => cy.get('[
|
6
|
+
dialogBox: () => cy.get('[aria-labelledby="alert-dialog-title"]'),
|
7
7
|
dialogBoxTitle: () => cy.get('.dialog-title'),
|
8
8
|
dialogBoxContent: () => cy.get('div[id="alert-dialog-description"]'),
|
9
|
-
buttonReject: () => cy.get('
|
10
|
-
buttonAccept: () => cy.get('
|
9
|
+
buttonReject: () => cy.get('[class*="action"][class*="wrapper"] button').eq(0),
|
10
|
+
buttonAccept: () => cy.get('[class*="action"][class*="wrapper"] button').eq(1),
|
11
11
|
buttonClose: () => cy.get('[aria-label="CLOSE"]')
|
12
12
|
}
|
13
13
|
|
@@ -33,15 +33,11 @@ const steps = {
|
|
33
33
|
clickOnAcceptButtonInDialogBox: () => {
|
34
34
|
dialogBoxBase.buttonAccept()
|
35
35
|
.click();
|
36
|
-
dialogBoxBase.dialogBox()
|
37
|
-
.should('not.exist');
|
38
36
|
},
|
39
37
|
|
40
38
|
clickOnRejectButtonInDialogBox: () => {
|
41
39
|
dialogBoxBase.buttonReject()
|
42
40
|
.click();
|
43
|
-
dialogBoxBase.dialogBox()
|
44
|
-
.should('not.exist');
|
45
41
|
}
|
46
42
|
}
|
47
43
|
|
@@ -746,9 +746,7 @@ const steps = {
|
|
746
746
|
|
747
747
|
verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked: () => {
|
748
748
|
cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state');
|
749
|
-
previewScoringAndShowCorrectAnswerComponent.
|
750
|
-
.click()
|
751
|
-
.should('not.be.checked');
|
749
|
+
previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
|
752
750
|
autoScoredPreviewBase.correctIcon()
|
753
751
|
.should('not.exist');
|
754
752
|
autoScoredPreviewBase.incorrectIcon()
|
@@ -1362,6 +1360,8 @@ const tests = {
|
|
1362
1360
|
it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be provided for the question', () => {
|
1363
1361
|
cy.log('Switch to edit tab and set minimum score if attempted points')
|
1364
1362
|
createQuestionBasePage.steps.switchToEditTab();
|
1363
|
+
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
1364
|
+
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
1365
1365
|
scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(1)
|
1366
1366
|
createQuestionBasePage.steps.switchToPreviewTab()
|
1367
1367
|
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 2);
|
@@ -1496,7 +1496,8 @@ const tests = {
|
|
1496
1496
|
it('When the \'Round down score\' checkbox is not selected, then in preview tab when user selects partially or fully correct answers the points should be displayed in decimal points if applicable as per the options selected by the user', () => {
|
1497
1497
|
cy.log('Switching to Edit tab')
|
1498
1498
|
dragAndDropIntoCategoriesPage.steps.switchToEditTab();
|
1499
|
-
dragAndDropIntoCategoriesPage.steps.
|
1499
|
+
dragAndDropIntoCategoriesPage.steps.expandRoundingDropdown();
|
1500
|
+
dragAndDropIntoCategoriesPage.steps.selectOptionFromRoundingDropdownOption('none');
|
1500
1501
|
cy.log('Switching to Preview tab')
|
1501
1502
|
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
1502
1503
|
dragAndDropIntoCategoriesPage.steps.clickAndDropDraggableOptionInCategoryCellOfPreviewTab('Bat', 0);
|
@@ -14,6 +14,7 @@ const selectors = {
|
|
14
14
|
...additionalSettingsPanel,
|
15
15
|
...questionInstructionsComponent,
|
16
16
|
...essayResponseCommonComponents,
|
17
|
+
...commonComponents,
|
17
18
|
//Basic section
|
18
19
|
setWordLimitLabel: () => cy.get('[class*="EssayResponseComponentstyles__PropertyLabel"]'),
|
19
20
|
setWordLimitInputField: () => cy.get('.essay-response-question-word-limit-setting-wrapper input[type="text"]'),
|
@@ -350,6 +350,7 @@ const tests = {
|
|
350
350
|
});
|
351
351
|
});
|
352
352
|
|
353
|
+
//Failing due to https://redmine.zeuslearning.com/issues/547859
|
353
354
|
it('CSS of inactive state of draggable options and response areas', { tags: 'css' }, () => {
|
354
355
|
fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
|
355
356
|
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
|