itemengine-cypress-automation 1.0.104 → 1.0.106

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
  6. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
  7. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
  9. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
  10. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
  14. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
  15. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
  16. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
  17. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
  37. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
  38. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
  39. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
  40. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
  41. package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
  42. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
  43. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
  44. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
  45. package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
  46. package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
  47. package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
  48. package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
  49. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
  51. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
  52. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
  53. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
  54. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
  55. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
  56. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +45 -0
  57. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
  58. package/cypress/fixtures/specialAndMathCharacters.js +2 -0
  59. package/cypress/fixtures/theme/ilc.json +4 -2
  60. package/cypress/pages/audioResponsePage.js +326 -165
  61. package/cypress/pages/components/additionalSettingsPanel.js +1 -1
  62. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
  63. package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
  64. package/cypress/pages/components/colorPopupComponent.js +115 -26
  65. package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
  66. package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
  67. package/cypress/pages/components/editCategoryFlyout.js +164 -2
  68. package/cypress/pages/components/equationEditorFlyout.js +36 -1
  69. package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
  70. package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
  71. package/cypress/pages/components/index.js +2 -1
  72. package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
  73. package/cypress/pages/correctAnswerViewPage.js +12 -1
  74. package/cypress/pages/drawingResponsePage.js +26 -151
  75. package/cypress/pages/essayResponseMathPage.js +28 -16
  76. package/cypress/pages/essayResponsePage.js +187 -7
  77. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
  78. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
  79. package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
  80. package/cypress/pages/multipleSelectionPage.js +1 -1
  81. package/cypress/pages/readingRulerPage.js +219 -104
  82. package/cypress/pages/singleSelectionPage.js +1 -0
  83. package/cypress/pages/textEntryMathPage.js +17 -6
  84. package/cypress/pages/videoResponsePage.js +0 -8
  85. package/deploy/smoke/run.sh +1 -1
  86. package/package.json +1 -1
  87. package/scripts/sorry-cypress.mjs +1 -1
@@ -1,11 +1,16 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { createQuestionBasePage, additionalSettingsPanel } from "./components";
2
+ import { createQuestionBasePage, additionalSettingsPanel, colorPopupComponent } from "./components";
3
3
  import { dialogBoxBase } from "./dialogBoxBase";
4
4
  import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
5
5
  const css = Cypress.env('css');
6
6
 
7
+ const resizeButtons = ['resizeButton', 'topResizeButton', 'bottomResizeButton'];
8
+
7
9
  const selectors = {
8
10
  ...additionalSettingsPanel,
11
+ ...colorPopupComponent,
12
+ ...selectQuestionResourceToolPage,
13
+
9
14
  //TODO: Need to update selectors https://redmine.zeuslearning.com/issues/518498
10
15
  displayButtonToStudentLabel: () => cy.get('[data-ngie-testid="display-button-to-student-checkbox"] .MuiFormControlLabel-label'),
11
16
  allowStudentToResizeLabel: () => cy.get('[data-ngie-testid="allow-student-to-resize-checkbox"] .MuiFormControlLabel-label'),
@@ -17,15 +22,22 @@ const selectors = {
17
22
  opacityLabel: () => cy.get('#input-slider'),
18
23
  opacityInputField: () => cy.get('.line-reader-opacity input'),
19
24
  opacitySlider: () => cy.get('.MuiSlider-root'),
20
- colorLabel: () => cy.get('[class*="LineReaderstyles__PropertyLabel"]').eq(2),
21
- colorBlock: () => cy.get('.MuiFormControlLabel-labelPlacementBottom .MuiRadio-root'),
22
- colorBlockLabel: () => cy.get('[aria-label="color"] .MuiFormControlLabel-label'),
23
- defaultNumberOfLinesLabel: () => cy.get('[class*="LineReaderstyles__PropertyLabel"]').eq(3),
25
+ colorLabel: () => cy.get('[class*="ColorPalleteLabel"]'),
26
+ colorBlock: () => cy.get('[class*="ColorPalletestyles__ButtonWrapper"] button'),
27
+ colorBlockLabel: () => cy.get('[class*="ColorPalletestyles__LabelText"]'),
28
+ customColorWrapper: () => cy.get('[class*="ColorSelectionWrapper"]'),
29
+ customLabel: () => cy.get('[class*="CustomLabelWrapper"]'),
30
+ customColorEditIcon: () => cy.get('.icon-pencil'),
31
+ defaultNumberOfLinesLabel: () => cy.get('[class*="LineReaderstyles__PropertyLabel"]').eq(2),
24
32
  defaultNumberOfLinesInputField: () => cy.get('input[aria-label="Default number of lines"]'),
25
- rulerStyleButton: () => cy.get('[class*="LineReaderstyles__RulerStyleButton"]'),
33
+ rulerStyleLabel: () => cy.get('[class*="RulerStyle"] [class*="PropertyLabel"]'),
34
+ rulerStyleButton: () => cy.get('[class*="RulerStyleButton"][role="button"]'),
26
35
  rulerStyleButtonLabel: () => cy.get('[class*="LineReaderstyles__ButtonLabel"]'),
36
+ rulerStyleButtonIcon: () => cy.get('[class*="RulerStyleIconLabelWrapper"] svg'),
27
37
  //Preview Tab
28
- readingRulerButton: () => cy.get('.LineReaderButton'),
38
+ readingRulerButton: () => cy.get('.line-reader-preview-wrapper .ngie-button'),
39
+ readingRulerVisibleImagePreviewTab: () => cy.get('.line-reader-preview-wrapper g'),
40
+ readingRulerHideImagePreviewTab: () => cy.get('.line-reader-preview-wrapper #Hide_cell'),
29
41
  readingRuler: () => cy.get('.resizable'),
30
42
  closeButton: () => cy.get('.LineReaderCloseButton'),
31
43
  dragButton: () => cy.get('.LineReaderMoveButton'),
@@ -40,6 +52,9 @@ const selectors = {
40
52
  const steps = {
41
53
  ...createQuestionBasePage.steps,
42
54
  ...additionalSettingsPanel.steps,
55
+ ...dialogBoxBase.steps,
56
+ ...selectQuestionResourceToolPage.steps,
57
+ ...colorPopupComponent.steps,
43
58
 
44
59
  verifyDisplayButtonToStudentCheckboxIsChecked: () => {
45
60
  readingRulerPage.displayButtonToStudentCheckbox()
@@ -56,35 +71,76 @@ const steps = {
56
71
  * @description function selects ruler style
57
72
  */
58
73
  selectRulerStyle: (styleName) => {
59
- let style;
74
+ let index;
60
75
  switch (styleName) {
61
76
  case 'Line focus':
62
- style = '.line-focus';
77
+ index = 0;
63
78
  break;
64
79
  case 'Overlay mask':
65
- style = '.overlay-mask';
80
+ index = 1;
66
81
  break;
67
- case 'Darg handle':
68
- style = '.drag-handle';
82
+ case 'Drag handle':
83
+ index = 2;
69
84
  break;
70
85
  default:
71
86
  throw new Error(`Unknown ruler style: ${styleName}`);
72
87
  }
73
-
74
- readingRulerPage.rulerStyleButton()
75
- .find(style)
88
+
89
+ utilities.getNthElement(readingRulerPage.rulerStyleButton(), index)
90
+ .should('have.attr', 'aria-label', styleName)
76
91
  .click()
77
- .find('.MuiIconButton-label svg')
92
+ .find('svg')
93
+ .eq(1)
78
94
  .should('exist');
79
95
  },
80
96
 
81
97
  /**
82
- * @param {number} index index of ruler style
83
98
  * @param {("Line focus"|"Overlay mask"|"Drag handle")} styleName name of ruler style
84
- * @description function verifies ruler style button label
99
+ * @description function verifies ruler style selected style
100
+ */
101
+ verifyRulerStyleSelectedState: (styleName) => {
102
+ let index;
103
+ switch (styleName) {
104
+ case 'Line focus':
105
+ index = 0;
106
+ break;
107
+ case 'Overlay mask':
108
+ index = 1;
109
+ break;
110
+ case 'Drag handle':
111
+ index = 2;
112
+ break;
113
+ default:
114
+ throw new Error(`Unknown ruler style: ${styleName}`);
115
+ }
116
+
117
+ utilities.getNthElement(readingRulerPage.rulerStyleButton(), index)
118
+ .should('have.attr', 'aria-label', styleName)
119
+ .find('svg')
120
+ .eq(1)
121
+ .should('exist');
122
+ },
123
+
124
+ clickOnCustomColorBlock: () => {
125
+ readingRulerPage.customColorWrapper()
126
+ .click();
127
+ },
128
+
129
+ clickOnCustomBlockEditIcon: () => {
130
+ readingRulerPage.customColorEditIcon()
131
+ .click();
132
+ },
133
+
134
+ /**
135
+ * @param {number} styleIndex index of the ruler style button
136
+ * @param {string} styleName name of the ruler style button
137
+ * @description function verifies content and visibility of the ruler style button
85
138
  */
86
- verifyRulerStyleButtonLabel: (index, styleName) => {
87
- utilities.verifyInnerText(utilities.getNthElement(readingRulerPage.rulerStyleButtonLabel(), index), styleName);
139
+ verifyRulerStyleButton: (styleName, styleIndex) => {
140
+ utilities.verifyElementVisibilityState(utilities.getNthElement(readingRulerPage.rulerStyleButton(), styleIndex), 'visible');
141
+ utilities.verifyElementVisibilityState(utilities.getNthElement(readingRulerPage.rulerStyleButtonIcon(), styleIndex), 'visible');
142
+ utilities.verifyInnerText(utilities.getNthElement(readingRulerPage.rulerStyleButtonLabel(), styleIndex), styleName);
143
+ utilities.verifyElementVisibilityState(utilities.getNthElement(readingRulerPage.rulerStyleButtonLabel(), styleIndex), 'visible');
88
144
  },
89
145
 
90
146
  verifyVisibleOnLandingCheckboxIsUnchecked: () => {
@@ -133,7 +189,14 @@ const steps = {
133
189
  readingRulerPage.colorBlock()
134
190
  .eq(blockIndex)
135
191
  .find('svg')
136
- .should('not.exist');
192
+ .should('not.visible');
193
+ },
194
+
195
+ verifyCustomColor: (colorCodeHex, colorCode) => {
196
+ utilities.verifyInnerText(utilities.getNthElement(readingRulerPage.colorBlockLabel(), 5), colorCodeHex);
197
+ utilities.verifyCSS(utilities.getNthElement(readingRulerPage.colorBlock(), 5), {
198
+ 'background-color': colorCode
199
+ });
137
200
  },
138
201
 
139
202
  selectColorBlock: (blockIndex) => {
@@ -196,60 +259,91 @@ const steps = {
196
259
  .should('not.be.checked');
197
260
  },
198
261
 
199
- verifySelectedStateOfReadingRulerButton: () => {
200
- readingRulerPage.readingRulerButton()
201
- .should('have.class', 'active');
202
- },
203
-
204
- verifyUnselectedStateOfReadingRulerButton: () => {
205
- readingRulerPage.readingRulerButton()
206
- .should('not.have.class', 'active');
262
+ verifyVisibleOnLandingCheckboxChecked: () => {
263
+ readingRulerPage.visibleOnLandingCheckbox()
264
+ .should('be.checked');
207
265
  },
208
266
 
209
- clickOnReadingRulerButton: () => {
210
- readingRulerPage.readingRulerButton()
211
- .click({ force: true });
267
+ /**
268
+ * @param {("Show"|"Hide")} visibility
269
+ */
270
+ verifyReadingRulerVisibilityButtonLabelPreviewTab: (visibility) => {
271
+ utilities.verifyInnerText(readingRulerPage.readingRulerButton(), `${visibility} reading ruler`);
272
+ if (visibility == 'Hide') {
273
+ utilities.verifyElementVisibilityState(readingRulerPage.readingRulerHideImagePreviewTab(), 'visible');
274
+ steps.verifyReadingRulerExistInPreviewTab();
275
+ } else {
276
+ utilities.verifyElementVisibilityState(readingRulerPage.readingRulerVisibleImagePreviewTab(), 'visible');
277
+ steps.verifyReadingRulerNotExistInPreviewTab();
278
+ }
212
279
  },
213
280
 
214
- verifyResizeButtonsEnabled: () => {
215
- readingRulerPage.resizeButton()
216
- .should('be.enabled');
217
- readingRulerPage.topResizeButton()
218
- .should('be.enabled');
219
- readingRulerPage.bottomResizeButton()
220
- .should('be.enabled');
281
+ verifyReadingRulerButtonNotExistInPreviewTab: () => {
282
+ utilities.verifyElementVisibilityState(readingRulerPage.readingRulerButton(), 'notExist');
221
283
  },
222
284
 
223
- verifyCloseButtonEnabled: () => {
224
- readingRulerPage.closeButton()
225
- .should('be.enabled');
285
+ clickOnReadingRulerButtonInPreviewTab: () => {
286
+ readingRulerPage.readingRulerButton()
287
+ .click({ force: true });
226
288
  },
227
289
 
228
- verifyDragButtonEnabled: () => {
229
- readingRulerPage.dragButton()
230
- .should('be.enabled');
290
+ /**
291
+ * Verifies the resize buttons in the preview tab based on the specified ruler style.
292
+ * @param {'Line focus'| 'Overlay mask'| 'Drag handle'} style - The style of the ruler
293
+ */
294
+ verifyRulerButtonsInPreviewTab: (style) => {
295
+ switch (style) {
296
+ case 'Line focus':
297
+ case 'Drag handle':
298
+ readingRulerPage.topResizeButton()
299
+ .should('be.visible')
300
+ .should('be.enabled');
301
+ readingRulerPage.bottomResizeButton()
302
+ .should('be.visible')
303
+ .should('be.enabled');
304
+ if (style === 'Drag handle') {
305
+ readingRulerPage.resizeButton()
306
+ .should('be.visible')
307
+ .should('be.enabled');
308
+ }
309
+ readingRulerPage.closeButton()
310
+ .should('be.visible')
311
+ .should('be.enabled');
312
+ break;
313
+ case 'Overlay mask':
314
+ resizeButtons.forEach(button => {
315
+ readingRulerPage[button]()
316
+ .should('not.exist');
317
+ });
318
+ readingRulerPage.closeButton()
319
+ .should('be.visible')
320
+ .should('be.enabled');
321
+ break;
322
+ default:
323
+ throw new Error('Invalid ruler style');
324
+ }
231
325
  },
232
326
 
233
- verifyResizeButtonDisabled: () => {
327
+ verifyResizeButtonNotExistInPreviewTab: () => {
234
328
  readingRulerPage.resizeButton()
235
- .should('be.disabled');
329
+ .should('not.exist');
236
330
  readingRulerPage.topResizeButton()
237
- .should('be.disabled');
331
+ .should('not.exist');
238
332
  readingRulerPage.bottomResizeButton()
239
- .should('be.disabled');
333
+ .should('not.exist');
240
334
  },
241
335
 
242
- hoverOnReadingRulerButton: () => {
336
+ hoverOnReadingRulerButtonInPreviewTab: () => {
243
337
  readingRulerPage.readingRulerButton()
244
338
  .realHover()
245
339
  },
246
340
 
247
- hoverAwayFromReadingRulerButton: () => {
341
+ hoverAwayFromReadingRulerButtonInPreviewTab: () => {
248
342
  readingRulerPage.readingRulerButton()
249
343
  .realHover({ position: 'topLeft' })
250
344
  },
251
345
 
252
- clickOnCloseButtonInReadingRuler: () => {
346
+ clickOnCloseButtonInReadingRulerInPreviewTab: () => {
253
347
  readingRulerPage.closeButton()
254
348
  .click()
255
349
  },
@@ -264,11 +358,12 @@ const steps = {
264
358
  },
265
359
 
266
360
  /**
267
- * @param {string} colorValue color of the ruler
268
- * @description this function verifies color of the ruler displayed in the preview tab
269
- */
270
- verifyReadingRulerColorInPreviewTab: (colorValue) => {
271
- const fillColor = () => {
361
+ * @param {number} colorValue The index representing the color of the ruler
362
+ * @param {string} [colorCode=null] The expected color code (optional, only used when colorValue is 5)
363
+ * @description Verifies the color of the ruler displayed in the preview tab
364
+ */
365
+ verifyReadingRulerColorInPreviewTab: (colorValue, colorCode = null) => {
366
+ const getColorCode = () => {
272
367
  switch (colorValue) {
273
368
  case 0:
274
369
  return '#707070';
@@ -281,22 +376,49 @@ const steps = {
281
376
  case 4:
282
377
  return '#991D00';
283
378
  default:
284
- return 'incorrect colorIndex';
379
+ throw new Error('Incorrect color index');
285
380
  }
286
381
  };
287
- readingRulerPage.rulerColor()
288
- .should('have.attr', 'color', fillColor());
382
+
383
+ if (colorValue === 5) {
384
+ if (!colorCode) {
385
+ throw new Error('Color code is required when color value is 5');
386
+ }
387
+ readingRulerPage.rulerColor()
388
+ .should('have.attr', 'color', colorCode);
389
+ } else {
390
+ readingRulerPage.rulerColor()
391
+ .should('have.attr', 'color', getColorCode());
392
+ }
289
393
  },
290
394
 
291
395
  /**
292
- * @param {number} heightValue height of the ruler
293
- * @param {number} sizeValue size of the ruler
294
- * @description this function verifies height and size of ruler displayed in the preview tab
295
- */
296
- verifyHeightAndSizeOfReadingRuler: (heightValue, sizeValue) => {
396
+ * @param {("Line focus"|"Overlay mask"|"Drag handle")} rulerStyle name of ruler style
397
+ * @param {number} defaultNumberOfLinesValue number of default lines
398
+ * @description this function verifies height and size of ruler displayed in the preview tab
399
+ */
400
+ verifySizeOfReadingRulerInPreviewTab: (rulerStyle, defaultNumberOfLinesValue) => {
401
+ let height, size;
402
+ switch (rulerStyle) {
403
+ case 'Line focus':
404
+ height = 422;
405
+ size = 42;
406
+ break;
407
+ case 'Overlay mask':
408
+ height = 22;
409
+ size = 42;
410
+ break;
411
+ case 'Drag handle':
412
+ height = 142;
413
+ size = 42;
414
+ break;
415
+ default:
416
+ throw new Error(`Unknown ruler style: ${rulerStyle}`);
417
+ }
297
418
  readingRulerPage.readingRuler()
298
- .should('have.attr', 'height', heightValue)
299
- .should('have.attr', 'size', sizeValue)
419
+ .should('have.attr', 'height', `${(defaultNumberOfLinesValue - 1) * 22 + height}`)
420
+ .and('have.attr', 'size', `${(defaultNumberOfLinesValue - 1) * 22 + size}`)
421
+ .and('have.attr', 'width', 548);
300
422
  },
301
423
 
302
424
  verifyReadingRulerExistInPreviewTab: () => {
@@ -304,6 +426,34 @@ const steps = {
304
426
  .should('be.visible');
305
427
  },
306
428
 
429
+ verifyReadingRulerNotExistInPreviewTab: () => {
430
+ readingRulerPage.readingRuler()
431
+ .should('not.exist');
432
+ },
433
+
434
+ /**
435
+ * @param {("Line focus"|"Overlay mask"|"Drag handle")} rulerStyle name of ruler style
436
+ * @description function verifies ruler style in preview tab
437
+ */
438
+ verifyRulerStyleInPreviewTab: (rulerStyle) => {
439
+ switch (rulerStyle) {
440
+ case 'Line focus':
441
+ readingRulerPage.readingRuler()
442
+ .should('have.class', 'line-focus-line-reader-overlay');
443
+ break;
444
+ case 'Overlay mask':
445
+ readingRulerPage.readingRuler()
446
+ .should('have.class', 'overlay-mask-line-reader-overlay');
447
+ break;
448
+ case 'Drag handle':
449
+ readingRulerPage.readingRuler()
450
+ .should('have.class', 'drag-handle-line-reader-overlay');
451
+ break;
452
+ default:
453
+ throw new Error(`Unknown ruler style: ${rulerStyle}`);
454
+ }
455
+ },
456
+
307
457
  //additional settings
308
458
  addTextToTeacherGuidelinesInputField: () => {
309
459
  readingRulerPage.additionalSettingsTeacherGuidelinesInputField()
@@ -315,43 +465,8 @@ const steps = {
315
465
  const tests = {
316
466
  ...createQuestionBasePage.tests,
317
467
  ...additionalSettingsPanel.tests,
318
- //Header section
319
- verifyCancelButton: () => {
320
- it('When user has made no edits and clicks on Cancel button, the user should be directed back to the \'Select a Question\' page', () => {
321
- createQuestionBasePage.cancelButton()
322
- .click();
323
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.selectAQuestionHeaderText(), 'visible');
324
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.questionTypeOptionTitle(), 'visible');
325
- });
326
-
327
- it('When user has made some edits/changes and clicks on Cancel button, a popup should be displayed', () => {
328
- selectQuestionResourceToolPage.steps.selectResourceType('reading ruler');
329
- utilities.verifyElementVisibilityState(readingRulerPage.opacityInputField(), 'visible');
330
- readingRulerPage.steps.addInputToOpacityInputField('30');
331
- createQuestionBasePage.cancelButton()
332
- .click();
333
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible')
334
- });
335
-
336
- dialogBoxBase.tests.verifyContentsOfLeavePagePopupWithCSSAnda11y();
337
-
338
- it(`Clicking on \'No, I'd like to go back\' button should close the popup and user should remain on the edit interface of the question`, () => {
339
- dialogBoxBase.buttonReject()
340
- .click();
341
- createQuestionBasePage.editTab()
342
- .should('have.attr', 'aria-selected', 'true')
343
- readingRulerPage.steps.verifyOpacityInputFieldValue('30');
344
- });
345
-
346
- it(`Clicking on \'Yes, I want to leave this page\' button should discard all changes and direct the user to the \'Select a question\' page.`, () => {
347
- createQuestionBasePage.cancelButton()
348
- .click();
349
- dialogBoxBase.buttonAccept()
350
- .click();
351
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.selectAQuestionHeaderText(), 'visible');
352
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.questionTypeOptionTitle(), 'visible');
353
- });
354
- },
468
+ ...colorPopupComponent.tests,
469
+ ...dialogBoxBase.tests,
355
470
  }
356
471
 
357
472
  export const readingRulerPage = {
@@ -455,6 +455,7 @@ const tests = {
455
455
  ...autoScoredScoringSection.tests,
456
456
  ...autoScoredScoringPreviewTab.tests,
457
457
  ...optionsWrapperComponent.tests,
458
+ ...commonComponents.tests,
458
459
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
459
460
  it('In the \'Correct\' accordion, all options with checkboxes should be displayed', () => {
460
461
  utilities.verifyElementCount(singleSelectionPage.optionWrapperSpecifyCorrectAnswerSection(), 4);
@@ -68,8 +68,13 @@ const selectors = {
68
68
  typeOfExpressionDropdownOption: () => cy.get('[aria-labelledby*="Type-dropdown-label"] li'),
69
69
  syntaxLabel: () => cy.get('#Syntax-dropdown-label'),
70
70
  syntaxDropdown: () => cy.get('#Syntax-select'),
71
- syntaxDropdownOption: () => cy.get('[aria-labelledby*="Syntax-dropdown-label"] li'),
72
-
71
+ syntaxDropdownOption: (ariaLabel) => {
72
+ if (ariaLabel) {
73
+ return cy.get(`[aria-labelledby*="Syntax-dropdown-label"] li[aria-label*="${ariaLabel}"]`).eq(0)
74
+ } else {
75
+ return cy.get('[aria-labelledby*="Syntax-dropdown-label"] li')
76
+ }
77
+ },
73
78
  //Additional settings
74
79
  textContainersAriaLabelInputField: () => cy.get('[class*="ClozeMathstyle__SingleAriaLabelContainer"]'),
75
80
  textContainersAriaLabelInputFieldNumeration: () => cy.get('[class*="ClozeMathstyle__Numeration"]'),
@@ -590,10 +595,10 @@ const steps = {
590
595
 
591
596
  /**
592
597
  * select syntax dropdown option
593
- * @param {number} optionIndex index of syntax dropdown option
598
+ * @param {number} ariaLabel ariaLabel of syntax dropdown option
594
599
  */
595
- selectSyntaxDropdownListOption: (optionIndex) => {
596
- utilities.getNthElement(textEntryMathPage.syntaxDropdownOption(), optionIndex)
600
+ selectSyntaxDropdownListOption: (ariaLabel) => {
601
+ textEntryMathPage.syntaxDropdownOption(ariaLabel)
597
602
  .click();
598
603
  },
599
604
 
@@ -756,7 +761,13 @@ const tests = {
756
761
  },
757
762
 
758
763
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
759
- it('By default, for the two response token in question input field, two response accordions \'Response 1\' and \'Response 2\' should be present in collapsed state in the \'Specify correct answer section\'', () => {
764
+ it('When question input field in empty, then by default no response accordion should be displayed in the specify correct answer section', () => {
765
+ utilities.verifyElementVisibilityState(textEntryMathPage.responseAccordion(), 'notExist');
766
+ });
767
+
768
+ it('When user adds response tokens in question input field, then response accordions should be displayed in collapsed state in the \'Specify correct answer section\' with appropriate numeration', () => {
769
+ textEntryMathPage.steps.addResponseToken();
770
+ textEntryMathPage.steps.addResponseToken();
760
771
  utilities.verifyElementCount(textEntryMathPage.responseAccordion(), 2);
761
772
  textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(0);
762
773
  textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(1);
@@ -30,14 +30,6 @@ const selectors = {
30
30
  fullScreenButton: () => cy.get('button[aria-label="Full Screen"]'),
31
31
  savedResponseText: () => cy.get('[class*="VideoRecorderstyle__ResponseTextWrapper"]'),
32
32
  maxRecorderLengthInputField: () => cy.get('input[aria-label="Maximum recorder length"]'),
33
- playbackSpeedOptionsList: () => cy.get('[class*="VideoRecorderstyle__PlaybackSpeedOptions"]'),
34
- playbackSpeedOption: (ariaLabel = null) => {
35
- if (ariaLabel) {
36
- return cy.get(`.speed-option[aria-label="${ariaLabel}"]`)
37
- } else {
38
- return cy.get('.speed-option')
39
- }
40
- },
41
33
  confirmRetakeButton: () => cy.get('.delete-action-btn-wrapper button').eq(1),
42
34
  cancelRetakeButton: () => cy.get('.delete-action-btn-wrapper button').eq(0),
43
35
  retakePopupContent: () => cy.get('.retake-popup-content'),
@@ -3,4 +3,4 @@ env=$STAGE
3
3
  echo Environment to test: $env
4
4
  echo START_TIME: $START_TIME
5
5
 
6
- npm run spinnaker:migration
6
+ npm run spinnaker:smoke
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.104",
3
+ "version": "1.0.106",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -84,7 +84,7 @@ export function runSorryCypressSpinnaker() {
84
84
  startTime = process.env.START_TIME;
85
85
  ciBuildId = setCiBuildId("spinnaker", startTime);
86
86
  const envArgs = setCommandLineEnvArgs()
87
- let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs},grepTags=-css+-a11y --spec "cypress/e2e/ILC/**/*.js"`;
87
+ let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs},grepTags=-css+-a11y --spec "cypress/e2e/ILC/**/*.smoke.js"`;
88
88
  execSync(command, { stdio: "inherit" });
89
89
  }
90
90