itemengine-cypress-automation 1.0.129 → 1.0.131-smokeTestFixes6March-aa053ff.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +2 -4
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +2 -4
  3. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +3 -7
  4. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
  5. package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
  6. package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
  7. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
  8. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
  9. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
  10. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
  22. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
  23. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
  24. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
  25. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
  26. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
  28. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
  29. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
  30. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
  32. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
  33. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
  34. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
  35. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
  36. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
  37. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
  38. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
  43. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
  44. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
  45. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
  46. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
  47. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
  48. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
  49. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
  50. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
  51. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  52. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
  53. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
  54. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
  59. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
  60. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
  61. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  62. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
  63. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
  64. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
  65. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  66. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
  67. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
  68. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
  69. package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  70. package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
  71. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
  72. package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
  73. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
  74. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
  75. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
  76. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
  77. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
  78. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
  79. package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
  80. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
  81. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
  82. package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
  83. package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
  84. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
  85. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
  86. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
  87. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  88. package/cypress/fixtures/theme/ilc.json +6 -1
  89. package/cypress/fixtures/uploadResponseFileType.js +5 -0
  90. package/cypress/pages/audioResponsePage.js +1 -1
  91. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
  92. package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
  93. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  94. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
  95. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
  96. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
  97. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  98. package/cypress/pages/components/questionInstructionsComponent.js +2 -1
  99. package/cypress/pages/contentBlocksPage.js +515 -0
  100. package/cypress/pages/drawingResponsePage.js +2 -2
  101. package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
  102. package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
  103. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
  104. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
  105. package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
  106. package/cypress/pages/fillInTheGapsTextPage.js +9 -2
  107. package/cypress/pages/graphingPage.js +484 -0
  108. package/cypress/pages/index.js +4 -1
  109. package/cypress/pages/simpleCalculatorPage.js +310 -0
  110. package/cypress/pages/uploadResponsePage.js +260 -92
  111. package/package.json +2 -2
  112. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
  113. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
  114. package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
  115. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
  116. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -386,7 +386,6 @@ describe('Preview of Audio response for bar audio recorder style', () => {
386
386
 
387
387
  it('When the user seeks the progress bar slider while the audio is playing, then the audio should continue to play from the position where the slider is seeked', () => {
388
388
  audioResponsePage.steps.seekProgressBarSliderToCenter();
389
- audioResponsePage.steps.addWaitToPlayAudio(1000);
390
389
  audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
391
390
  });
392
391
 
@@ -394,12 +393,11 @@ describe('Preview of Audio response for bar audio recorder style', () => {
394
393
  audioResponsePage.steps.pausePlayback();
395
394
  audioResponsePage.steps.seekProgressBarSliderToCenter();
396
395
  audioResponsePage.steps.startPlayback();
397
- audioResponsePage.steps.addWaitToPlayAudio(5000);
398
396
  audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
399
397
  });
400
398
 
401
399
  it('When the audio playback is completed, the \'Pause\' button should get replaced with \'Play\' button', () => {
402
- audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:45', '00:45');
400
+ audioResponsePage.steps.verifyPlaybackTimeBarPreview('00:10', '00:10');
403
401
  utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
404
402
  utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
405
403
  audioResponsePage.steps.verifyProgressBarSliderPosition(99);
@@ -484,7 +482,7 @@ describe('Preview of Audio response for bar audio recorder style', () => {
484
482
  it('When the user clicks on Confirm button of the retake popup, the previous recording should get deleted and a new recording should begin', () => {
485
483
  audioResponsePage.steps.retakeRecordingBarPreview();
486
484
  audioResponsePage.steps.confirmRetake();
487
- audioResponsePage.steps.verifyRecordingTimeBarPreview('00:02', '15:00');
485
+ audioResponsePage.steps.verifyRecordingTimeBarPreview('00:05', '00:10');
488
486
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
489
487
  utilities.verifyInnerText(audioResponsePage.recordingStatusText(), 'Recording...');
490
488
  });
@@ -219,6 +219,7 @@ describe('Preview of Audio response for compact audio recorder style', () => {
219
219
  audioResponsePage.steps.switchToEditTab();
220
220
  audioResponsePage.steps.setMaximumRecorderLength(5);
221
221
  audioResponsePage.steps.switchToPreviewTab();
222
+ audioResponsePage.steps.startRecordingCompactPreview();
222
223
  audioResponsePage.steps.waitForRecordingToStartCompactPreview();
223
224
  cy.log('Starting a recording and letting it record until Maximum recording length is reached');
224
225
  audioResponsePage.steps.verifyResponseIsRecordedHelpText();
@@ -376,7 +377,6 @@ describe('Preview of Audio response for compact audio recorder style', () => {
376
377
 
377
378
  it('When the user seeks the progress bar slider while the audio is playing, then the audio should continue to play from the position where the slider is seeked', () => {
378
379
  audioResponsePage.steps.seekProgressBarSliderToCenter();
379
- audioResponsePage.steps.addWaitToPlayAudio(1000);
380
380
  audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
381
381
  });
382
382
 
@@ -384,7 +384,6 @@ describe('Preview of Audio response for compact audio recorder style', () => {
384
384
  audioResponsePage.steps.pausePlaybackCompactPreview();
385
385
  audioResponsePage.steps.seekProgressBarSliderToCenter();
386
386
  audioResponsePage.steps.startPlaybackCompactPreview();
387
- audioResponsePage.steps.addWaitToPlayAudio(5000);
388
387
  audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
389
388
  });
390
389
 
@@ -450,7 +449,6 @@ describe('Preview of Audio response for compact audio recorder style', () => {
450
449
  audioResponsePage.steps.navigateToCreateQuestion('audio response');
451
450
  cy.barsPreLoaderWait();
452
451
  audioResponsePage.steps.selectAudioRecorderStyle('Compact');
453
- audioResponsePage.steps.setMaximumRecorderLength(10);
454
452
  audioResponsePage.steps.switchToPreviewTab();
455
453
  audioResponsePage.steps.recordAndSaveAudioCompactPreview(10000);
456
454
  });
@@ -475,7 +473,7 @@ describe('Preview of Audio response for compact audio recorder style', () => {
475
473
  it('When the user clicks on Confirm button of the retake popup, the previous recording should get deleted and a new recording should begin', () => {
476
474
  audioResponsePage.steps.retakeRecordingCompactPreview();
477
475
  audioResponsePage.steps.confirmRetake();
478
- audioResponsePage.steps.verifyRecordingTimeCompactPreview('00:02', '15:00');
476
+ audioResponsePage.steps.verifyRecordingTimeCompactPreview('00:04', '15:00');
479
477
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
480
478
  utilities.verifyInnerText(audioResponsePage.compactPreviewRecordingStatusText(), 'Recording...');
481
479
  });
@@ -84,7 +84,7 @@ describe('Preview of Audio response for standard audio recorder style', () => {
84
84
  audioResponsePage.steps.resetQuestionPreview();
85
85
  audioResponsePage.steps.startRecordingStandardPreview();
86
86
  audioResponsePage.steps.waitForRecordingToStartStandardPreview();
87
- utilities.verifyCSS(audioResponsePage.recordingMicIcon().find('svg path').eq(1), {
87
+ utilities.verifyCSS(audioResponsePage.recordingMicIcon(), {
88
88
  'fill': css.color.microphoneIcon
89
89
  });
90
90
  utilities.verifyCSS(audioResponsePage.recordingStatusText(), {
@@ -254,7 +254,6 @@ describe('Preview of Audio response for standard audio recorder style', () => {
254
254
  audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:00', '00:04');
255
255
  });
256
256
 
257
- //Failing due to https://redmine.zeuslearning.com/issues/560794
258
257
  it('When recording is inprogress and user has reached maximum recorder length, \'Your response has been recorded\' message should be displayed below mic icon. Retake and Play icon should be displayed along with progress bar. User should be able to view the duration of their recorded speech in minutes, displayed as \'(min:secs)\'. Volume meter should not be displayed in player', () => {
259
258
  audioResponsePage.steps.switchToEditTab();
260
259
  audioResponsePage.steps.setMaximumRecorderLength(10);
@@ -262,14 +261,13 @@ describe('Preview of Audio response for standard audio recorder style', () => {
262
261
  audioResponsePage.steps.startRecordingStandardPreview();
263
262
  audioResponsePage.steps.waitForRecordingToStartStandardPreview();
264
263
  cy.log('Response will keep recording until maximum recording length of 10 seconds is reached');
265
- utilities.verifyInnerText(audioResponsePage.standardPreviewRecorderHelpText(), 'Recording...');
266
264
  audioResponsePage.steps.verifyResponseIsRecordedHelpText();
267
265
  utilities.verifyElementVisibilityState(audioResponsePage.standardPreviewRetakeButton(), 'visible');
268
266
  utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
269
267
  utilities.verifyElementVisibilityState(audioResponsePage.previewVolumeMeter(), 'visible');
270
268
  utilities.verifyElementVisibilityState(audioResponsePage.standardPreviewPlaybackTime(), 'visible');
271
269
  utilities.verifyElementVisibilityState(audioResponsePage.playbackProgressBar(), 'visible');
272
- audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:10', '00:10');
270
+ audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:00', '00:10');
273
271
  });
274
272
  });
275
273
 
@@ -420,7 +418,6 @@ describe('Preview of Audio response for standard audio recorder style', () => {
420
418
 
421
419
  it('When the user seeks the progress bar slider while the audio is playing, then the audio should continue to play from the position where the slider is seeked', () => {
422
420
  audioResponsePage.steps.seekProgressBarSliderToCenter();
423
- audioResponsePage.steps.addWaitToPlayAudio(1000);
424
421
  audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
425
422
  });
426
423
 
@@ -428,12 +425,11 @@ describe('Preview of Audio response for standard audio recorder style', () => {
428
425
  audioResponsePage.steps.pausePlayback();
429
426
  audioResponsePage.steps.seekProgressBarSliderToCenter();
430
427
  audioResponsePage.steps.startPlayback();
431
- audioResponsePage.steps.addWaitToPlayAudio(5000);
432
428
  audioResponsePage.steps.verifyProgressBarSliderPosition(actualAudioSeekedInPercent);
433
429
  });
434
430
 
435
431
  it('When the audio playback is completed, the \'Pause\' button should get replaced with \'Play\' button', () => {
436
- audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:45', '00:45');
432
+ audioResponsePage.steps.verifyPlaybackTimeStandardPreview('00:10', '00:10');
437
433
  utilities.verifyElementVisibilityState(audioResponsePage.playbackPlayButton(), 'visible');
438
434
  utilities.verifyElementVisibilityState(audioResponsePage.playbackPauseButton(), 'notExist');
439
435
  audioResponsePage.steps.verifyProgressBarSliderPosition(99);
@@ -0,0 +1,210 @@
1
+ import { contentBlocksPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Content blocks - Edit tab', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Header section', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ contentBlocksPage.steps.navigateToCreateResource('content blocks');
15
+ });
16
+
17
+ it('\'Header\' label should be displayed', () => {
18
+ utilities.verifyInnerText(contentBlocksPage.headerLabel(), 'Header');
19
+ utilities.verifyElementVisibilityState(contentBlocksPage.headerLabel(), 'visible');
20
+ });
21
+
22
+ it('\'Title\' label and input field should be displayed and by default input field should be empty', () => {
23
+ utilities.verifyInnerText(contentBlocksPage.titleLabel(), 'Title');
24
+ utilities.verifyElementVisibilityState(contentBlocksPage.titleLabel(), 'visible');
25
+ utilities.verifyInnerText(contentBlocksPage.titleInputField(), '');
26
+ utilities.verifyElementVisibilityState(contentBlocksPage.titleInputField(), 'visible');
27
+ });
28
+
29
+ it('\'Title\' input field should have a placeholder text \'Enter title\'', () => {
30
+ contentBlocksPage.steps.verifyTitleInputFieldPlaceholderText();
31
+ });
32
+
33
+ it('When user enters text in \'Title\'input field then placeholder text should disappear after user enters the text in input field', () => {
34
+ contentBlocksPage.steps.enterTextInTitleInputField('Title text');
35
+ contentBlocksPage.steps.verifyPlaceholderTextNotExist(contentBlocksPage.titleInputField);
36
+ });
37
+
38
+ it('\'Sub title\' label and input field should be displayed and by default input field should be empty', () => {
39
+ utilities.verifyInnerText(contentBlocksPage.headerSubTitleLabel(), 'Sub title');
40
+ utilities.verifyElementVisibilityState(contentBlocksPage.headerSubTitleLabel(), 'visible');
41
+ utilities.verifyInnerText(contentBlocksPage.headerSubTitleInputField(), '');
42
+ utilities.verifyElementVisibilityState(contentBlocksPage.headerSubTitleInputField(), 'visible');
43
+ });
44
+
45
+ it('\'Sub title\' input field should have a placeholder text \'Enter sub title\'', () => {
46
+ contentBlocksPage.steps.verifySubTitleInputFieldPlaceholderText();
47
+ });
48
+
49
+ it('When user enters text in \'Sub title\'input field then placeholder text should disappear after user enters the text in input field', () => {
50
+ contentBlocksPage.steps.enterTextInSubTitleInputField('Sub title text');
51
+ contentBlocksPage.steps.verifyPlaceholderTextNotExist(contentBlocksPage.headerSubTitleInputField);
52
+ });
53
+
54
+ it('CSS of header section', { tags: 'css' }, () => {
55
+ utilities.verifyCSS(contentBlocksPage.headerLabel(), {
56
+ 'color': css.color.labels,
57
+ 'font-size': css.fontSize.default,
58
+ 'font-weight': css.fontWeight.semibold
59
+ });
60
+ utilities.verifyCSS(contentBlocksPage.titleLabel(), {
61
+ 'color': css.color.labels,
62
+ 'font-size': css.fontSize.normal,
63
+ 'font-weight': css.fontWeight.semibold
64
+ });
65
+ utilities.verifyCSS(contentBlocksPage.headerSubTitleLabel(), {
66
+ 'color': css.color.labels,
67
+ 'font-size': css.fontSize.normal,
68
+ 'font-weight': css.fontWeight.semibold
69
+ });
70
+ });
71
+
72
+ it('Accessibility of header section', { tags: 'a11y' }, () => {
73
+ cy.checkAccessibility(contentBlocksPage.headerLabel().parents('content-blocks'));
74
+ });
75
+ });
76
+
77
+ describe('Body section', () => {
78
+ abortEarlySetup();
79
+ before(() => {
80
+ contentBlocksPage.steps.navigateToCreateResource('content blocks');
81
+ });
82
+
83
+ it('\'Body\' label should be displayed', () => {
84
+ utilities.verifyInnerText(contentBlocksPage.bodyLabel(), 'Body');
85
+ utilities.verifyElementVisibilityState(contentBlocksPage.bodyLabel(), 'visible');
86
+ });
87
+
88
+ it('\'Text block\' label and input field should be displayed and by default input field should be empty', () => {
89
+ utilities.verifyInnerText(contentBlocksPage.textBlockLabel(), 'Text block');
90
+ utilities.verifyElementVisibilityState(contentBlocksPage.textBlockLabel(), 'visible');
91
+ utilities.verifyInnerText(contentBlocksPage.textBlockInputField(), '\n');
92
+ utilities.verifyElementVisibilityState(contentBlocksPage.textBlockInputField(), 'visible');
93
+ });
94
+
95
+ it('\'Text block\' input field should have a placeholder text \'Enter text block\' and numeration 1', () => {
96
+ utilities.verifyInnerText(contentBlocksPage.blockNumeration(), '1');
97
+ utilities.verifyElementVisibilityState(contentBlocksPage.blockNumeration(), 'visible');
98
+ contentBlocksPage.steps.verifyTextBlockInputFieldPlaceholderText();
99
+ });
100
+
101
+ it('When user enters text in \'Text block\'input field then placeholder text should disappear after user enters the text in input field', () => {
102
+ contentBlocksPage.steps.enterTextInTextBlockInputField(0, 'Text block text');
103
+ contentBlocksPage.steps.verifyTextBlockInputFieldPlaceholderTextNotExist(contentBlocksPage.verifyTextBlockInputFieldPlaceholderText);
104
+ });
105
+
106
+ it('When user clears text and focuses out of text block input field, then error message \'Error: Text block is required.\' should be displayed', () => {
107
+ contentBlocksPage.steps.clearAndFocusOutOfTextBlockInputField();
108
+ utilities.verifyInnerText(utilities.getNthElement(contentBlocksPage.errorMessage(), 2), 'Error: Text block is required.');
109
+ utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'visible');
110
+ });
111
+
112
+ it('When user enters text again then error message should disappear', () => {
113
+ contentBlocksPage.steps.enterTextInTextBlockInputField(0, '​​​​​​​​​​​​​​​​​​​​​Text block');
114
+ utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'hidden');
115
+ });
116
+
117
+ it('When body input fields are less than 2 then drag handle and Delete page button should be in disabled state', () => {
118
+ utilities.verifyElementVisibilityState(contentBlocksPage.dragHandleButton(), 'visible');
119
+ utilities.verifyElementVisibilityState(contentBlocksPage.deleteButton(), 'visible');
120
+ contentBlocksPage.steps.verifyDragHandleButtonDisabled();
121
+ utilities.verifyElementDisabledClass(contentBlocksPage.deleteButton());
122
+ });
123
+
124
+ it('When user hovers over delete button, then \'Minimum one text block is required.\' tooltip should be displayed', () => {
125
+ utilities.hoverOverElement(contentBlocksPage.deleteButton());
126
+ utilities.verifyElementVisibilityState(contentBlocksPage.tooltipText(), 'visible');
127
+ utilities.verifyInnerText(contentBlocksPage.tooltipText(), 'Minimum one text block is required.');
128
+ });
129
+
130
+ it('\'Add group divider\', \'Add sub title\' and \'Add text block\' buttons should be displayed', () => {
131
+ utilities.verifyInnerText(contentBlocksPage.addGroupDividerButton(), 'Add group divider');
132
+ utilities.verifyElementVisibilityState(contentBlocksPage.addGroupDividerButton(), 'visible');
133
+ utilities.verifyInnerText(contentBlocksPage.addSubTitleButton(), 'Add sub title');
134
+ utilities.verifyElementVisibilityState(contentBlocksPage.addSubTitleButton(), 'visible');
135
+ utilities.verifyInnerText(contentBlocksPage.addTextBlockButton(), 'Add text block');
136
+ utilities.verifyElementVisibilityState(contentBlocksPage.addTextBlockButton(), 'visible');
137
+ });
138
+
139
+ it('When user clicks on \'Add sub title\' then sub title input field should be displayed with label, placeholder text and numeration. Drag handle and Delete option icon buttons should be displayed besides body input field', () => {
140
+ contentBlocksPage.steps.addSubTitle();
141
+ contentBlocksPage.steps.verifyBodySubTitleContent(0, '2');
142
+ });
143
+
144
+ it('When user enters text in \'Sub title\'input field then placeholder text should disappear after user enters the text in input field', () => {
145
+ contentBlocksPage.steps.enterTextInBodySubTitleInputField(0, 'Sub title text');
146
+ contentBlocksPage.steps.verifyPlaceholderTextNotExist(contentBlocksPage.bodySubTitleInputField);
147
+ });
148
+
149
+ it('When body input fields are more than one then drag handle and Delete page button should be in displayed in enabled state', () => {
150
+ utilities.verifyElementCount(contentBlocksPage.inputFieldWrapper(), 2);
151
+ contentBlocksPage.steps.verifyDragHandleButtonEnabled();
152
+ utilities.verifyElementNotDisabled(contentBlocksPage.deleteButton());
153
+ });
154
+
155
+ it('When user clicks on \'Add text block\' then text block input field should be displayed with label, placeholder text and numeration. Drag handle and Delete option icon buttons should be displayed besides body input field', () => {
156
+ contentBlocksPage.steps.addTextBlock();
157
+ contentBlocksPage.steps.verifyTextBlockContent(1, '3');
158
+ });
159
+
160
+ it('When user clicks on \'Add group divider\' then group divider should be displayed with label. Drag handle and Delete option icon buttons should be displayed besides group divider', () => {
161
+ contentBlocksPage.steps.addGroupDivider();
162
+ contentBlocksPage.steps.verifyGroupDividerContent(0);
163
+ });
164
+
165
+ it('CSS of header section', { tags: 'css' }, () => {
166
+ utilities.verifyCSS(contentBlocksPage.bodyLabel(), {
167
+ 'color': css.color.labels,
168
+ 'font-size': css.fontSize.default,
169
+ 'font-weight': css.fontWeight.semibold
170
+ });
171
+ utilities.verifyCSS(utilities.getNthElement(contentBlocksPage.textBlockLabel(), 0), {
172
+ 'color': css.color.labels,
173
+ 'font-size': css.fontSize.normal,
174
+ 'font-weight': css.fontWeight.semibold
175
+ });
176
+ utilities.verifyCSS(utilities.getNthElement(contentBlocksPage.bodySubTitleLabel, 0), {
177
+ 'color': css.color.labels,
178
+ 'font-size': css.fontSize.normal,
179
+ 'font-weight': css.fontWeight.semibold
180
+ });
181
+ utilities.verifyCSS(contentBlocksPage.groupDividerLabel(), {
182
+ 'color': css.color.labels,
183
+ 'font-size': css.fontSize.normal,
184
+ 'font-weight': css.fontWeight.semibold
185
+ });
186
+ });
187
+
188
+ it('Accessibility of header section', { tags: 'a11y' }, () => {
189
+ cy.checkAccessibility(contentBlocksPage.headerLabel().parents('content-blocks'));
190
+ });
191
+
192
+ it('When the user hovers over the drag handle of the body field, \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
193
+ utilities.hoverOverElement(utilities.getNthElement(contentBlocksPage.dragHandleButton(), 0));
194
+ utilities.verifyElementVisibilityState(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'visible');
195
+ utilities.verifyInnerText(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'Drag to reorder');
196
+ });
197
+
198
+ it('When the user hovers over the enabled \'Delete\' icon buttons then, \'Delete page\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
199
+ utilities.hoverOverElement(utilities.getNthElement(contentBlocksPage.deleteButton(), 0));
200
+ utilities.verifyElementVisibilityState(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'visible');
201
+ utilities.verifyInnerText(utilities.getNthElement(contentBlocksPage.tooltipText(), 1), 'Delete page');
202
+ });
203
+
204
+ it('When user clicks on the \'Delete\' page button then the respective body input field should get deleted, body numeration should change accordingly', () => {
205
+ contentBlocksPage.steps.deletePage(0);
206
+ contentBlocksPage.steps.verifyNumerationText(2);
207
+ utilities.verifyElementCount(contentBlocksPage.inputFieldWrapper(), 2);
208
+ });
209
+ });
210
+ });
@@ -0,0 +1,91 @@
1
+ import { contentBlocksPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(previewContentViews);
7
+ var itemReferenceID = "";
8
+
9
+ describe('Preview tab contents for all views', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ views.forEach((view) => {
15
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ switch (view) {
19
+ case 'Question preview':
20
+ contentBlocksPage.steps.navigateToCreateResource('content blocks');
21
+ contentBlocksPage.steps.enterTextInTitleInputField('This is title text');
22
+ contentBlocksPage.steps.enterTextInSubTitleInputField('This is subtitle text');
23
+ contentBlocksPage.steps.enterTextInTextBlockInputField('This is text block text');
24
+ contentBlocksPage.steps.addGroupDivider();
25
+ utilities.verifyElementVisibilityState(contentBlocksPage.groupDivider(), 'visible');
26
+ contentBlocksPage.steps.addSubTitle();
27
+ contentBlocksPage.steps.enterTextInBodySubTitleInputField('This is body subtitle text');
28
+ contentBlocksPage.steps.switchToPreviewTab();
29
+ break;
30
+ case 'Item view':
31
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
32
+ break;
33
+ case 'Item preview':
34
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
35
+ contentBlocksPage.steps.switchToPreviewTab();
36
+ break;
37
+ case 'Student view':
38
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
39
+ break;
40
+ case 'Grading view':
41
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
42
+ break;
43
+ case 'Correct answer view':
44
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
45
+ break;
46
+ default:
47
+ throw new Error('Invalid view');
48
+ }
49
+ });
50
+
51
+ after(() => {
52
+ if (view === 'Question preview') {
53
+ contentBlocksPage.steps.clickOnSaveQuestionButton();
54
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
55
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
56
+ }
57
+ if (view === 'Student view') {
58
+ studentViewPage.steps.submitResponse();
59
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
60
+ }
61
+ });
62
+
63
+ it('Title and subtitle text should be displayed', () => {
64
+ utilities.verifyInnerText(contentBlocksPage.titlePreviewTab(), 'This is title text');
65
+ utilities.verifyElementVisibilityState(contentBlocksPage.titlePreviewTab(), 'visible');
66
+ utilities.verifyInnerText(contentBlocksPage.subTitleLabelPreviewTab(), 'This is subtitle text');
67
+ utilities.verifyElementVisibilityState(contentBlocksPage.subTitleLabelPreviewTab(), 'visible');
68
+ });
69
+
70
+ it('Text block, solid group divider and subtitle text should be displayed', () => {
71
+ utilities.verifyInnerText(contentBlocksPage.textBlockPreviewTab(), 'This is text block text');
72
+ utilities.verifyElementVisibilityState(contentBlocksPage.textBlockPreviewTab(), 'visible');
73
+ utilities.verifyElementVisibilityState(contentBlocksPage.groupDividerPreviewTab(), 'visible');
74
+ utilities.verifyInnerText(contentBlocksPage.bodySubTitlePreviewTab(), 'This is body subtitle text');
75
+ utilities.verifyElementVisibilityState(contentBlocksPage.bodySubTitlePreviewTab(), 'visible');
76
+ });
77
+
78
+ it('CSS of Preview tab', { tags: 'css' }, () => {
79
+ utilities.verifyCSS(contentBlocksPage.textBlockPreviewTab(), {
80
+ 'color': css.color.text,
81
+ 'font-size': css.fontSize.default,
82
+ 'font-weight': css.fontWeight.regular
83
+ });
84
+ });
85
+
86
+ it('Accessibility of Preview tab', { tags: 'a11y' }, () => {
87
+ cy.checkAccessibility(contentBlocksPage.textBlockPreviewTab().parents('[class*="ItemEnginestyles__MainWrapper"]'));
88
+ });
89
+ });
90
+ });
91
+ });