itemengine-cypress-automation 1.0.113 → 1.0.114
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
- package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
- package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
- package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
- package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
- package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
- package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
- package/cypress/pages/audioResponsePage.js +523 -66
- package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
- package/cypress/pages/components/equationEditorFlyout.js +11 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
- package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
- package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
- package/cypress/pages/components/questionInputFieldComponent.js +0 -7
- package/cypress/pages/essayResponseBasicPage.js +1 -26
- package/cypress/pages/essayResponsePage.js +21 -284
- package/cypress/pages/shortTextResponsePage.js +142 -103
- package/cypress/pages/textEntryMathPage.js +58 -7
- package/package.json +1 -1
@@ -127,9 +127,7 @@ const steps = {
|
|
127
127
|
},
|
128
128
|
|
129
129
|
verifySpecifyCorrectAnswerErrorMessage: () => {
|
130
|
-
commonComponents.errorMessage()
|
131
|
-
.last()
|
132
|
-
.verifyInnerText('Error: Please set a correct answer.');
|
130
|
+
utilities.verifyInnerText(commonComponents.errorMessage().last(), 'Error: Please set a correct answer.');
|
133
131
|
}
|
134
132
|
}
|
135
133
|
|
@@ -155,7 +153,7 @@ const tests = {
|
|
155
153
|
helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s).';
|
156
154
|
break;
|
157
155
|
case 'short text response':
|
158
|
-
helpText = 'You can set the correct answer by entering the correct answer in the
|
156
|
+
helpText = 'You can set the correct answer by entering the correct answer(s) in the response area(s).';
|
159
157
|
break;
|
160
158
|
case 'fill in the gaps - dropdown':
|
161
159
|
helpText = 'You can set the correct answer by selecting the correct answer(s) in the response area(s).';
|
@@ -347,9 +345,12 @@ const tests = {
|
|
347
345
|
});
|
348
346
|
utilities.verifyInnerText(utilities.getNthElement(scoringSectionBase.pleaseEnterPointsErrorMessage(), 0), 'Error: Please enter points.');
|
349
347
|
utilities.verifyElementVisibilityState(scoringSectionBase.pleaseEnterPointsErrorMessage(), 'visible');
|
350
|
-
if (questionType != 'list ordering') {
|
348
|
+
if (questionType != 'list ordering' && questionType != 'short text response') {
|
351
349
|
steps.verifySpecifyCorrectAnswerErrorMessage();
|
352
350
|
}
|
351
|
+
else if (questionType === 'short text response') {
|
352
|
+
utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), -1), 'Error: Answer is required.');
|
353
|
+
}
|
353
354
|
if (questionType === 'fill in the gaps over image text' || questionType === 'text entry math') {
|
354
355
|
utilities.verifyInnerText(commonComponents.errorMessage().last(), 'Error: Please enter points.');
|
355
356
|
utilities.verifyElementVisibilityState(commonComponents.errorMessage().last(), 'visible');
|
@@ -325,6 +325,17 @@ const steps = {
|
|
325
325
|
focusInPreviewInputField: () => {
|
326
326
|
equationEditorFlyout.previewInputField()
|
327
327
|
.click();
|
328
|
+
},
|
329
|
+
|
330
|
+
|
331
|
+
enterQuadraticEquation: () => {
|
332
|
+
equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['two'] }, { categoryName: 'basic', symbolName: ['x', 'square', 'y', 'square', 'add'] }, { categoryName: 'keypad', symbolName: ['four'] }, { categoryName: 'basic', symbolName: ['x', 'y', 'add'] }, { categoryName: 'keypad', symbolName: ['four'] }]);
|
333
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
334
|
+
},
|
335
|
+
|
336
|
+
enterEquationUsingPiSymbol: () => {
|
337
|
+
equationEditorFlyout.steps.enterEquation([{ categoryName: 'keypad', symbolName: ['six', 'multiply'] }, { categoryName: 'greek', symbolName: ['pi'] }]);
|
338
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
328
339
|
}
|
329
340
|
}
|
330
341
|
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import utilities from "../../support/helpers/utilities";
|
2
2
|
import { commonComponents } from "./commonComponents";
|
3
3
|
|
4
|
+
let originalText;
|
5
|
+
let formattedText;
|
6
|
+
|
4
7
|
const selectors = {
|
5
8
|
//Basic section
|
6
9
|
setLimitLabel: () => cy.get('[class*="SetLimitWrapper"] .essay-response-word-limit-label'),
|
@@ -27,7 +30,33 @@ const selectors = {
|
|
27
30
|
return cy.get('.essay-preview-wrapper a[role="button"]')
|
28
31
|
}
|
29
32
|
},
|
30
|
-
|
33
|
+
|
34
|
+
//Customize Formatting options section
|
35
|
+
customizeFormattingOptionsAccordionLabel: () => cy.get('.customize-formatting-options-label'),
|
36
|
+
customizeFormattingOptionsSectionExpandIcon: () => cy.get('.customize-formatting-option-wrapper [class*="expandIconWrapper"]'),
|
37
|
+
customizeFormattingOptionsTiles: (formattingOption = null) => {
|
38
|
+
if (formattingOption) {
|
39
|
+
return cy.get(`.toolbar-options-wrapper .icon-button-custom-format[title="${formattingOption}"]`)
|
40
|
+
} else {
|
41
|
+
return cy.get('.toolbar-options-wrapper .icon-button-custom-format')
|
42
|
+
}
|
43
|
+
},
|
44
|
+
tickIcon: () => cy.get('[class*="TickIconWrapper"] svg'),
|
45
|
+
customizeFormattingOptionsLabel: () => cy.get('.icon-button-custom-format .drag-item-flex-wrapper svg'),
|
46
|
+
customizeFormattingOptionsWrapper: () => cy.get('.customize-formatting-option-wrapper'),
|
47
|
+
customizeFormattingOptionsAccordion: () => cy.get('.customize-formatting-option-wrapper .ngie-accordion-summary'),
|
48
|
+
customizeFormattingOptionsDragHandleButton: () => cy.get('.toolbar-options-wrapper [data-testid="drag-icon-wrapper"]'),
|
49
|
+
|
50
|
+
//wordCount
|
51
|
+
displayWordCountCheckbox: () => cy.get('[data-ngie-testid="display-word-count-checkbox"] input'),
|
52
|
+
wordCountWrapper: () => cy.get('[class*="indexstyle__WordCharCountWrapper"]'),
|
53
|
+
|
54
|
+
//Preview tab
|
55
|
+
responseField: () => cy.get('[title="Enter your response to the question here."]'),
|
56
|
+
responseFieldWordCount: () => cy.get('[class*="InputLimitLabelWrapper"]'),
|
57
|
+
responseFieldEquation: () => cy.get('.cke_widget_element'),
|
58
|
+
|
59
|
+
//Additional settings, These are old selectors. Need to update them along with additional settings file revamp
|
31
60
|
studentResponseAndLayoutLabel: () => cy.get('.layout-text'),
|
32
61
|
predefinedTextLabel: () => cy.get('[class*="EssayResponsestyles__PropertyLabel"]'),
|
33
62
|
predefinedTextInputField: () => cy.get('[title="Predefined Text"]'),
|
@@ -44,11 +73,7 @@ const selectors = {
|
|
44
73
|
customSpecialCharacterLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]').eq(1),
|
45
74
|
customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
|
46
75
|
limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
47
|
-
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]')
|
48
|
-
//Preview tab
|
49
|
-
responseField: () => cy.get('[title="Enter your response to the question here."]'),
|
50
|
-
responseFieldWordCount: () => cy.get('[class*="InputLimitLabelWrapper"]'),
|
51
|
-
responseFieldEquation: () => cy.get('.cke_widget_element'),
|
76
|
+
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]')
|
52
77
|
}
|
53
78
|
|
54
79
|
const steps = {
|
@@ -62,7 +87,6 @@ const steps = {
|
|
62
87
|
.type(maxLimit)
|
63
88
|
.blur()
|
64
89
|
.should('have.value', maxLimit);
|
65
|
-
|
66
90
|
},
|
67
91
|
|
68
92
|
/**
|
@@ -98,7 +122,6 @@ const steps = {
|
|
98
122
|
.should('have.value', maxLimit)
|
99
123
|
},
|
100
124
|
|
101
|
-
|
102
125
|
verifyMaximumLimitErrorMessage: () => {
|
103
126
|
utilities.verifyInnerText(commonComponents.errorMessage().eq(1), 'Error: Maximum limit must be greater than or equal to Minimum limit.');
|
104
127
|
utilities.verifyElementVisibilityState(commonComponents.errorMessage().eq(1), 'visible');
|
@@ -156,6 +179,12 @@ const steps = {
|
|
156
179
|
.should('be.checked');
|
157
180
|
},
|
158
181
|
|
182
|
+
verifyListItemLengthInResponseField: (length) => {
|
183
|
+
essayResponseCommonComponents.responseField()
|
184
|
+
.find('li')
|
185
|
+
.should('have.length', length);
|
186
|
+
},
|
187
|
+
|
159
188
|
/**
|
160
189
|
* verify response field equation text content
|
161
190
|
* @param {number} equationIndex index of equation
|
@@ -181,15 +210,6 @@ const steps = {
|
|
181
210
|
});
|
182
211
|
},
|
183
212
|
|
184
|
-
//TODO: need to improve this, we are passing two parameters here, only one should suffice
|
185
|
-
openAndSelectOptionFromDisplayWordLimitDropdown: (optionIndex, optionName) => {
|
186
|
-
essayResponseCommonComponents.displayWordLimitDropdown()
|
187
|
-
.click();
|
188
|
-
essayResponseCommonComponents.displayWordLimitDropdownListOptions(optionIndex)
|
189
|
-
.click();
|
190
|
-
essayResponseCommonComponents.displayWordLimitDropdown()
|
191
|
-
.should('have.text', optionName);
|
192
|
-
},
|
193
213
|
|
194
214
|
enterTextInResponseField: (textContent) => {
|
195
215
|
essayResponseCommonComponents.steps.enterInputInResponseField(textContent);
|
@@ -206,6 +226,11 @@ const steps = {
|
|
206
226
|
.clear();
|
207
227
|
},
|
208
228
|
|
229
|
+
focusInResponseField: () => {
|
230
|
+
essayResponseCommonComponents.responseField()
|
231
|
+
.click();
|
232
|
+
},
|
233
|
+
|
209
234
|
focusOutOfResponseField: () => {
|
210
235
|
essayResponseCommonComponents.responseField()
|
211
236
|
.blur();
|
@@ -254,7 +279,7 @@ const steps = {
|
|
254
279
|
},
|
255
280
|
|
256
281
|
resetPreviewTabResponseField: () => {
|
257
|
-
cy.log('
|
282
|
+
cy.log('Clearing and resetting the response field');
|
258
283
|
essayResponseCommonComponents.responseField()
|
259
284
|
.clear()
|
260
285
|
.blur();
|
@@ -315,10 +340,256 @@ const steps = {
|
|
315
340
|
verifyLimitReachedWarningMessage: (warningText) => {
|
316
341
|
utilities.verifyElementVisibilityState(essayResponseCommonComponents.limitReachedWarningMessage(), 'visible');
|
317
342
|
utilities.verifyInnerText(essayResponseCommonComponents.limitReachedWarningMessage(), warningText);
|
343
|
+
},
|
344
|
+
|
345
|
+
expandCustomizeFormattingOptionsAccordion: () => {
|
346
|
+
essayResponseCommonComponents.customizeFormattingOptionsAccordion()
|
347
|
+
.click()
|
348
|
+
.should('have.attr', 'aria-expanded', 'true');
|
349
|
+
},
|
350
|
+
|
351
|
+
collapseCustomizeFormattingOptionsAccordion: () => {
|
352
|
+
essayResponseCommonComponents.customizeFormattingOptionsAccordion()
|
353
|
+
.click()
|
354
|
+
.should('have.attr', 'aria-expanded', 'false');
|
355
|
+
},
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Verifies the customization options tiles and their selected state.
|
359
|
+
* @param {string[]} customizeOptions - An array of customization options to be verified.
|
360
|
+
* @param {string[]} stateOfFormattingOption - An array representing the expected state ('true' or 'false') for each customization option.
|
361
|
+
*/
|
362
|
+
verifyCustomizeFormattingOptionsAndSelectedState: (customizeOptions, stateOfFormattingOption) => {
|
363
|
+
essayResponseCommonComponents.customizeFormattingOptionsTiles()
|
364
|
+
.each(($button, count) => {
|
365
|
+
cy.wrap($button)
|
366
|
+
.should('have.attr', 'title', customizeOptions[count])
|
367
|
+
.and('have.attr', 'data-aria-pressed', stateOfFormattingOption[count])
|
368
|
+
});
|
369
|
+
},
|
370
|
+
|
371
|
+
/**
|
372
|
+
* Verifies the visibility of preview tab toolbar options.
|
373
|
+
* @param {string[]} customizeOptions - An array of option names to be verified for visibility.
|
374
|
+
* @returns {void}
|
375
|
+
*/
|
376
|
+
verifyPreviewTabToolbarOptions: (customizeOptions) => {
|
377
|
+
customizeOptions.forEach((optionName) => {
|
378
|
+
essayResponseCommonComponents.previewTabToolbarOption(optionName)
|
379
|
+
.and('be.visible');
|
380
|
+
});
|
381
|
+
},
|
382
|
+
|
383
|
+
/**
|
384
|
+
* Deselects a preview tab toolbar option and verifies its state.
|
385
|
+
* @param {string} toolbarOption - The name of the toolbar option to be deselected.
|
386
|
+
* @returns {void}
|
387
|
+
*/
|
388
|
+
deselectPreviewTabToolbarOption: (toolbarOption) => {
|
389
|
+
essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
|
390
|
+
.click()
|
391
|
+
.should('have.attr', 'aria-pressed', 'false');
|
392
|
+
},
|
393
|
+
|
394
|
+
/**
|
395
|
+
* This function verifies the formatting option is in selected state
|
396
|
+
* @param {string} formattingOption name of the formatting option
|
397
|
+
*/
|
398
|
+
verifyPreviewTabToolbarOptionDisabled: (formattingOption) => {
|
399
|
+
essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
|
400
|
+
.should('have.attr', 'aria-disabled', 'true');
|
401
|
+
},
|
402
|
+
|
403
|
+
/**
|
404
|
+
* This function verifies the formatting option is in selected state
|
405
|
+
* @param {string} formattingOption name of the formatting option
|
406
|
+
*/
|
407
|
+
verifyPreviewTabToolbarOptionNotDisabled: (formattingOption) => {
|
408
|
+
essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
|
409
|
+
.should('have.attr', 'aria-disabled', 'false');
|
410
|
+
},
|
411
|
+
|
412
|
+
/**
|
413
|
+
* This function verifies the formatting option is in selected state
|
414
|
+
* @param {string} formattingOption name of the formatting option
|
415
|
+
*/
|
416
|
+
verifyPreviewTabToolbarOptionNotSelected: (formattingOption) => {
|
417
|
+
essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
|
418
|
+
.should('have.attr', 'aria-pressed', 'false');
|
419
|
+
},
|
420
|
+
|
421
|
+
/**
|
422
|
+
* This function verifies the formatting option is in selected state
|
423
|
+
* @param {string} formattingOption name of the formatting option
|
424
|
+
*/
|
425
|
+
verifyPreviewTabToolbarOptionSelected: (formattingOption) => {
|
426
|
+
essayResponseCommonComponents.previewTabToolbarOption(formattingOption)
|
427
|
+
.should('have.attr', 'aria-pressed', 'true');
|
428
|
+
},
|
429
|
+
|
430
|
+
/**
|
431
|
+
* This function verifies the formatting option is in selected state
|
432
|
+
* @param {string} formattingOption name of the formatting option
|
433
|
+
*/
|
434
|
+
verifyCustomizeFormattingOptionIsSelected: (formattingOption) => {
|
435
|
+
essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
|
436
|
+
.should('have.attr', 'data-aria-pressed', 'true');
|
437
|
+
},
|
438
|
+
|
439
|
+
/**
|
440
|
+
* This function verifies the formatting option is not selected
|
441
|
+
* @param {string} formattingOption name of the formatting option
|
442
|
+
*/
|
443
|
+
verifyCustomizeFormattingOptionNotSelected: (formattingOption) => {
|
444
|
+
essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
|
445
|
+
.should('have.attr', 'data-aria-pressed', 'false');
|
446
|
+
},
|
447
|
+
|
448
|
+
/**
|
449
|
+
* Selects customized formatting options and verifies their selected state.
|
450
|
+
* @param {string[]} formattingOptionArray - An array of formatting options to be selected.
|
451
|
+
* @returns {void}
|
452
|
+
*/
|
453
|
+
selectCustomizedFormattingOption: (formattingOptionArray) => {
|
454
|
+
formattingOptionArray.forEach((formattingOption) => {
|
455
|
+
essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
|
456
|
+
.click();
|
457
|
+
essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
|
458
|
+
.should('have.attr', 'data-aria-pressed', 'true');
|
459
|
+
});
|
460
|
+
},
|
461
|
+
|
462
|
+
/**
|
463
|
+
* Deselects customized formatting options and verifies their deselected state.
|
464
|
+
* @param {string[]} formattingOptionArray - An array of formatting options to be deselected.
|
465
|
+
* @returns {void}
|
466
|
+
*/
|
467
|
+
deselectCustomizedFormattingOption: (formattingOptionArray) => {
|
468
|
+
formattingOptionArray.forEach((formattingOption) => {
|
469
|
+
essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
|
470
|
+
.click();
|
471
|
+
essayResponseCommonComponents.customizeFormattingOptionsTiles(formattingOption)
|
472
|
+
.should('have.attr', 'data-aria-pressed', 'false');
|
473
|
+
});
|
474
|
+
},
|
475
|
+
|
476
|
+
checkDisplayWordCountCheckbox: () => {
|
477
|
+
essayResponseCommonComponents.displayWordCountCheckbox()
|
478
|
+
.click()
|
479
|
+
.should('be.checked');
|
480
|
+
},
|
481
|
+
|
482
|
+
/**
|
483
|
+
* verify word count in preview tab
|
484
|
+
* @param {number} wordCount
|
485
|
+
*/
|
486
|
+
verifyWordCount: (wordCount) => {
|
487
|
+
utilities.verifyInnerText(essayResponseCommonComponents.wordCountWrapper(), `Words: ${wordCount}`)
|
488
|
+
},
|
489
|
+
|
490
|
+
verifyCustomizeToolbarOptions: (customizeFormattingOptions) => {
|
491
|
+
customizeFormattingOptions.forEach((optionName) => {
|
492
|
+
utilities.verifyElementVisibilityState(essayResponseCommonComponents.customizeFormattingOptionsTiles(optionName), 'visible');
|
493
|
+
});
|
494
|
+
},
|
495
|
+
|
496
|
+
/**
|
497
|
+
* Verifies the HTML content of the essay response field.
|
498
|
+
* @param {string} HTMLText - The expected HTML content to be verified.
|
499
|
+
*/
|
500
|
+
verifyResponseFieldHTML: (HTMLText) => {
|
501
|
+
essayResponseCommonComponents.responseField()
|
502
|
+
.verifyInnerHTML(HTMLText);
|
503
|
+
},
|
504
|
+
|
505
|
+
/**
|
506
|
+
* Verifies the HTML content of code blocks within the essay response field.
|
507
|
+
* @param {string} HTMLText - The expected HTML content of code blocks to be verified.
|
508
|
+
*/
|
509
|
+
verifyResponseFieldCodeblockHTML: (HTMLText) => {
|
510
|
+
essayResponseCommonComponents.responseField()
|
511
|
+
.find('.codeblock')
|
512
|
+
.verifyInnerHTML(HTMLText);
|
513
|
+
},
|
514
|
+
|
515
|
+
/**
|
516
|
+
* Verifies the number of code blocks in the essay response field.
|
517
|
+
* @param {number} length - The expected number of code blocks.
|
518
|
+
*/
|
519
|
+
verifyCodeLength: (length) => {
|
520
|
+
essayResponseCommonComponents.responseField()
|
521
|
+
.find('pre')
|
522
|
+
.should('have.length', length);
|
523
|
+
},
|
524
|
+
|
525
|
+
/**
|
526
|
+
* Verifies the Undo and Redo functionality in the essay response field.
|
527
|
+
* @param {string} toolbarOption - The toolbar option that was manipulated.
|
528
|
+
* @param {string} originalText - The original HTML content before the manipulation.
|
529
|
+
* @param {string} formattedText - The expected HTML content after Undo and Redo operations.
|
530
|
+
*/
|
531
|
+
verifyUndoAndRedoFunctionality: (toolbarOption, originalText, formattedText) => {
|
532
|
+
essayResponseCommonComponents.previewTabToolbarOption('Undo (Ctrl+Z)')
|
533
|
+
.click();
|
534
|
+
if (toolbarOption == 'Background Color' || toolbarOption == 'Text Color') {
|
535
|
+
essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
|
536
|
+
.should('have.attr', 'aria-expanded', 'false');
|
537
|
+
} else {
|
538
|
+
essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
|
539
|
+
.should('have.attr', 'aria-pressed', 'false');
|
540
|
+
};
|
541
|
+
essayResponseCommonComponents.responseField()
|
542
|
+
.verifyInnerHTML(originalText);
|
543
|
+
essayResponseCommonComponents.previewTabToolbarOption('Redo (Ctrl+Y)')
|
544
|
+
.click();
|
545
|
+
if (toolbarOption == 'Background Color' || toolbarOption == 'Text Color') {
|
546
|
+
essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
|
547
|
+
.should('have.attr', 'aria-expanded', 'true');
|
548
|
+
} else if (toolbarOption == 'Insert Horizontal Line' || toolbarOption == 'Code Editor' || toolbarOption == 'Increase Indent' || toolbarOption == 'Decrease Indent' || toolbarOption == 'Remove Format') {
|
549
|
+
essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
|
550
|
+
.should('have.attr', 'aria-pressed', 'false');
|
551
|
+
} else {
|
552
|
+
essayResponseCommonComponents.previewTabToolbarOption(toolbarOption)
|
553
|
+
.should('have.attr', 'aria-pressed', 'true');
|
554
|
+
};
|
555
|
+
essayResponseCommonComponents.responseField()
|
556
|
+
.verifyInnerHTML(formattedText);
|
318
557
|
}
|
319
558
|
}
|
320
559
|
|
560
|
+
const tests = {
|
561
|
+
/**
|
562
|
+
* This function verifies undo and redo functionality
|
563
|
+
* @param {string} toolbarOption toolbar option
|
564
|
+
*/
|
565
|
+
verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption: (toolbarOption) => {
|
566
|
+
it(`When the user enters text in the response field, selects the text and selects the ${toolbarOption} toolbar option and clicks on the \'Undo\' toolbar option, then it should undo the latest action and when the user clicks on the \'Redo\' toolbar option, then it should redo the latest action`, () => {
|
567
|
+
essayResponseCommonComponents.steps.resetPreviewTabResponseField();
|
568
|
+
essayResponseCommonComponents.steps.enterInputInResponseField('Lorem Ipsum');
|
569
|
+
if (toolbarOption == 'Decrease Indent') {
|
570
|
+
essayResponseCommonComponents.previewTabToolbarOption('Increase Indent')
|
571
|
+
.click();
|
572
|
+
} else if (toolbarOption == 'Remove Format') {
|
573
|
+
essayResponseCommonComponents.steps.enterInputInResponseField('{selectAll}');
|
574
|
+
essayResponseCommonComponents.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
|
575
|
+
};
|
576
|
+
essayResponseCommonComponents.responseField()
|
577
|
+
.then(($originalText) => {
|
578
|
+
originalText = $originalText[0].innerHTML
|
579
|
+
essayResponseCommonComponents.steps.enterInputInResponseField('{selectAll}');
|
580
|
+
essayResponseCommonComponents.steps.selectPreviewTabToolbarOption(toolbarOption);
|
581
|
+
essayResponseCommonComponents.responseField()
|
582
|
+
.then(($formattedText) => {
|
583
|
+
formattedText = $formattedText[0].innerHTML
|
584
|
+
essayResponseCommonComponents.steps.verifyUndoAndRedoFunctionality(toolbarOption, originalText, formattedText);
|
585
|
+
});
|
586
|
+
});
|
587
|
+
});
|
588
|
+
},
|
589
|
+
}
|
590
|
+
|
321
591
|
export const essayResponseCommonComponents = {
|
322
592
|
...selectors,
|
323
|
-
steps
|
593
|
+
steps,
|
594
|
+
tests
|
324
595
|
}
|
@@ -4,8 +4,10 @@ const css = Cypress.env('css');
|
|
4
4
|
|
5
5
|
const selectors = {
|
6
6
|
maximumRecorderLengthInputField: () => cy.get('input[aria-label="Maximum recorder length"]'),
|
7
|
-
maximumRecorderLengthLabel: () => cy.get('.max-
|
7
|
+
maximumRecorderLengthLabel: () => cy.get('.max-record-length-label'),
|
8
8
|
maximumRecorderLengthInputFieldSecsSuffix: () => cy.get('[class*="max-recording"][class*="suffix"]'),
|
9
|
+
maximumRecorderLengthSecsToggleButton: () => cy.get('.max-recording-length-input [data-ngie-testid="secs-toggle-button"]'),
|
10
|
+
maximumRecorderLengthMinsToggleButton: () => cy.get('.max-recording-length-input [data-ngie-testid="mins-toggle-button"]'),
|
9
11
|
}
|
10
12
|
|
11
13
|
const steps = {
|
@@ -38,35 +40,50 @@ const steps = {
|
|
38
40
|
}
|
39
41
|
|
40
42
|
const tests = {
|
41
|
-
|
43
|
+
verifyMaximumRecorderLengthLabelAndInputField: () => {
|
44
|
+
it('\'Maximum recorder length\' label, input field, "Secs" and "Mins" toggle buttons should be displayed. By default "Secs" toggle button should be in selected state. "900" should be displayed in \'Maximum recorder length\' field', () => {
|
45
|
+
utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'Maximum recorder length');
|
46
|
+
utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), 'visible');
|
47
|
+
utilities.verifyElementVisibilityState(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), 'visible');
|
48
|
+
maximumRecorderLengthComponent.maximumRecorderLengthSecsToggleButton()
|
49
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
50
|
+
maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength(900);
|
51
|
+
utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthSecsToggleButton(), 'Secs');
|
52
|
+
utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthMinsToggleButton(), 'Mins');
|
53
|
+
});
|
54
|
+
|
42
55
|
it('CSS of \'Maximum recorder length\' section', { tags: 'css' }, () => {
|
43
56
|
utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthLabel(), {
|
44
57
|
'color': css.color.labels,
|
45
58
|
'font-size': css.fontSize.normal,
|
46
59
|
'font-weight': css.fontWeight.semibold
|
47
60
|
});
|
48
|
-
utilities.verifyCSS(maximumRecorderLengthComponent.
|
49
|
-
'color': css.color.
|
61
|
+
utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthSecsToggleButton(), {
|
62
|
+
'color': css.color.defaultBackground,
|
63
|
+
'background-color': css.color.activeButtons,
|
64
|
+
'font-size': css.fontSize.default,
|
65
|
+
'font-weight': css.fontWeight.regular
|
66
|
+
});
|
67
|
+
utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthMinsToggleButton(), {
|
68
|
+
'color': css.color.secondaryBtn,
|
69
|
+
'background-color': css.color.secondaryBtnBg,
|
50
70
|
'font-size': css.fontSize.default,
|
51
71
|
'font-weight': css.fontWeight.regular
|
52
72
|
});
|
53
|
-
utilities.verifyCSS(maximumRecorderLengthComponent.
|
73
|
+
utilities.verifyCSS(maximumRecorderLengthComponent.maximumRecorderLengthInputField(), {
|
54
74
|
'color': css.color.text,
|
55
75
|
'font-size': css.fontSize.default,
|
56
76
|
'font-weight': css.fontWeight.regular
|
57
77
|
});
|
58
78
|
});
|
59
|
-
},
|
60
79
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
//https://redmine.zeuslearning.com/issues/540899
|
69
|
-
utilities.verifyInnerText(maximumRecorderLengthComponent.maximumRecorderLengthInputFieldSecsSuffix(), 'Secs');
|
80
|
+
//Note: a11y is covered for Maximum recorder length section in HeaderSection file using verifyCreateItemWrapperContentsA11y
|
81
|
+
|
82
|
+
it('When the user toggles to "Mins", "15" should be displayed in \'Maximum recorder length\' field', () => {
|
83
|
+
maximumRecorderLengthComponent.maximumRecorderLengthMinsToggleButton()
|
84
|
+
.click()
|
85
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
86
|
+
maximumRecorderLengthComponent.steps.verifyMaximumRecorderLength(15);
|
70
87
|
});
|
71
88
|
},
|
72
89
|
|
@@ -7,7 +7,7 @@ const selectors = {
|
|
7
7
|
volumeControlSlider: () => cy.get('.audio-volume-control-slider'),
|
8
8
|
muteVolumeIcon: () => cy.get('.audio-mute-icon-wr'),
|
9
9
|
unmutedVolumeIcon: () => cy.get('.audio-volume-icon-wr'),
|
10
|
-
progressBar: () => cy.get('[class*="
|
10
|
+
progressBar: () => cy.get('[class*="ProgressBarstyle__SliderWrapper"]'),
|
11
11
|
progressBarSlider: () => cy.get('input[aria-label="Slider bar"]'),
|
12
12
|
playbackPlayButton: () => cy.get('button[aria-label="Play"]'),
|
13
13
|
playbackPauseButton: () => cy.get('button[aria-label="Pause"]'),
|
@@ -195,6 +195,14 @@ const steps = {
|
|
195
195
|
playbackControlsBaseComponent.playbackSpeedOption(playbackSpeed)
|
196
196
|
.click();
|
197
197
|
},
|
198
|
+
|
199
|
+
verifyVolumeButtonEnabledState: () => {
|
200
|
+
utilities.verifyElementNotDisabled(playbackControlsBaseComponent.volumeControlButton());
|
201
|
+
},
|
202
|
+
|
203
|
+
verifyPlaybackSpeedButtonEnabledState: () => {
|
204
|
+
utilities.verifyElementNotDisabled(playbackControlsBaseComponent.playbackSpeedButton());
|
205
|
+
}
|
198
206
|
}
|
199
207
|
|
200
208
|
const tests = {
|
@@ -12,13 +12,6 @@ const selectors = {
|
|
12
12
|
}
|
13
13
|
|
14
14
|
const steps = {
|
15
|
-
addResponseTokenInQuestionField: () => {
|
16
|
-
questionInputFieldComponent.questionInputField()
|
17
|
-
.click();
|
18
|
-
questionInputFieldComponent.ckEditorAddResponseButton()
|
19
|
-
.click();
|
20
|
-
},
|
21
|
-
|
22
15
|
/**
|
23
16
|
* @description Delete a response token by clicking on its close button
|
24
17
|
* @param {number} responseTokenIndex response token index
|
@@ -7,15 +7,6 @@ const selectors = {
|
|
7
7
|
...additionalSettingsPanel,
|
8
8
|
...scoringSectionBase,
|
9
9
|
...essayResponseCommonComponents,
|
10
|
-
//Customize Formatting options section
|
11
|
-
customizeFormattingOptionsSectionLabel: () => cy.get('.customize-essay-formatting-options .ngie-toggle-button-title'),
|
12
|
-
cutCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="cut-toggle-button"]`),
|
13
|
-
copyCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="copy-toggle-button"]`),
|
14
|
-
pasteCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="paste-toggle-button"]`),
|
15
|
-
specialCharacterCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="special-characters-toggle-button"]`),
|
16
|
-
customizeFormattingOptionsLabel: () => cy.get('.ngie-toggle-button-label'),
|
17
|
-
customizeFormattingOptionsIcon: () => cy.get('.ngie-toggle-button-icon svg'),
|
18
|
-
customizeFormattingOptionsWrapper: () => cy.get('.customize-essay-formatting-options'),
|
19
10
|
};
|
20
11
|
|
21
12
|
const steps = {
|
@@ -23,23 +14,7 @@ const steps = {
|
|
23
14
|
...questionInstructionsComponent.steps,
|
24
15
|
...additionalSettingsPanel.steps,
|
25
16
|
...scoringSectionBase.steps,
|
26
|
-
...essayResponseCommonComponents.steps
|
27
|
-
|
28
|
-
cutTextFromResponseField: () => {
|
29
|
-
essayResponseBasicPage.responseField()
|
30
|
-
.type('{selectAll}');
|
31
|
-
essayResponseBasicPage.previewTabToolbarOption('Cut')
|
32
|
-
.click();
|
33
|
-
},
|
34
|
-
|
35
|
-
copyTextFromResponseField: () => {
|
36
|
-
essayResponseBasicPage.responseField()
|
37
|
-
.type('{selectAll}');
|
38
|
-
essayResponseBasicPage.previewTabToolbarOption('Copy')
|
39
|
-
.click();
|
40
|
-
essayResponseBasicPage.responseField()
|
41
|
-
.click();
|
42
|
-
},
|
17
|
+
...essayResponseCommonComponents.steps
|
43
18
|
};
|
44
19
|
|
45
20
|
const tests = {
|