itemengine-cypress-automation 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. package/.build_wna +4 -0
  2. package/README.md +3 -0
  3. package/currents.config.js +6 -0
  4. package/cypress/API/createItem/toggleItemMode.js +15 -0
  5. package/cypress/config-files/ildev.json +15 -0
  6. package/cypress/config-files/ilprod.json +15 -0
  7. package/cypress/config-files/ilqa.json +15 -0
  8. package/cypress/config-files/ilstage.json +15 -0
  9. package/cypress/e2e/ILC/sorry-cypress-test/spec1.js +18 -0
  10. package/cypress/e2e/ILC/sorry-cypress-test/spec2.js +18 -0
  11. package/cypress/e2e/ILC/sorry-cypress-test/spec3.js +18 -0
  12. package/cypress/fixtures/accessibilityConfig.json +6 -0
  13. package/cypress/fixtures/constants.js +18 -0
  14. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +2271 -0
  15. package/cypress/fixtures/specialAndMathCharacters.js +118 -0
  16. package/cypress/fixtures/theme/ilc.json +150 -0
  17. package/cypress/fixtures/theme/ngie.json +26 -0
  18. package/cypress/fixtures/uploads/20mbFile.png +0 -0
  19. package/cypress/fixtures/uploads/80mbFile.pdf +0 -0
  20. package/cypress/fixtures/uploads/highlightImage.jpg +0 -0
  21. package/cypress/fixtures/uploads/image.png +0 -0
  22. package/cypress/fixtures/uploads/sample.aac +0 -0
  23. package/cypress/fixtures/uploads/sample.accdb +0 -0
  24. package/cypress/fixtures/uploads/sample.csv +100 -0
  25. package/cypress/fixtures/uploads/sample.doc +0 -0
  26. package/cypress/fixtures/uploads/sample.gif +0 -0
  27. package/cypress/fixtures/uploads/sample.heic +0 -0
  28. package/cypress/fixtures/uploads/sample.heif +0 -0
  29. package/cypress/fixtures/uploads/sample.hevc +0 -0
  30. package/cypress/fixtures/uploads/sample.jpeg +0 -0
  31. package/cypress/fixtures/uploads/sample.jpg +0 -0
  32. package/cypress/fixtures/uploads/sample.mp3 +0 -0
  33. package/cypress/fixtures/uploads/sample.mp4 +0 -0
  34. package/cypress/fixtures/uploads/sample.pdf +0 -0
  35. package/cypress/fixtures/uploads/sample.ppt +0 -0
  36. package/cypress/fixtures/uploads/sample.pub +0 -0
  37. package/cypress/fixtures/uploads/sample.rtf +7902 -0
  38. package/cypress/fixtures/uploads/sample.svg +10 -0
  39. package/cypress/fixtures/uploads/sample.txt +1 -0
  40. package/cypress/fixtures/uploads/sample.wav +0 -0
  41. package/cypress/fixtures/uploads/sample.xlsx +0 -0
  42. package/cypress/fixtures/uploads/sample.xps +0 -0
  43. package/cypress/fixtures/uploads/sample.zip +0 -0
  44. package/cypress/fixtures/uploads/sample1.jpg +0 -0
  45. package/cypress/fixtures/uploads/sample1.mp3 +0 -0
  46. package/cypress/fixtures/uploads/sample1.zip +0 -0
  47. package/cypress/fixtures/uploads/sample10Sec.mp3 +0 -0
  48. package/cypress/fixtures/uploads/sample2.jpg +0 -0
  49. package/cypress/fixtures/uploads/sample2.mp3 +0 -0
  50. package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
  51. package/cypress/pages/audioPlayerPage.js +628 -0
  52. package/cypress/pages/audioResponsePage.js +264 -0
  53. package/cypress/pages/components/additionalSettingsPanel.js +174 -0
  54. package/cypress/pages/components/answerNumerationComponent.js +109 -0
  55. package/cypress/pages/components/autoScoredAdditionalSettings.js +183 -0
  56. package/cypress/pages/components/autoScoredPreviewBase.js +94 -0
  57. package/cypress/pages/components/autoScoredScoringSection.js +195 -0
  58. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +268 -0
  59. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +291 -0
  60. package/cypress/pages/components/ckEditorToolbar.js +64 -0
  61. package/cypress/pages/components/colorPopupComponent.js +293 -0
  62. package/cypress/pages/components/commonComponents.js +93 -0
  63. package/cypress/pages/components/componentsFlowChart/figFlowChart.png +0 -0
  64. package/cypress/pages/components/createCustomCategoryFlyout.js +138 -0
  65. package/cypress/pages/components/createQuestionBasePage.js +225 -0
  66. package/cypress/pages/components/customizeHighlightPropertiesComponent.js +318 -0
  67. package/cypress/pages/components/dragAndDropResponseOptions.js +738 -0
  68. package/cypress/pages/components/dragAndDropSetCorrectAnswerCheckboxComponents.js +124 -0
  69. package/cypress/pages/components/draggableOptionsContainer.js +857 -0
  70. package/cypress/pages/components/editCategoryFlyout.js +40 -0
  71. package/cypress/pages/components/equationEditorFlyout.js +158 -0
  72. package/cypress/pages/components/essayResponseCommonComponents.js +86 -0
  73. package/cypress/pages/components/figOverImageCommonComponent.js +924 -0
  74. package/cypress/pages/components/fillInTheGapsCommonComponents.js +687 -0
  75. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +442 -0
  76. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +884 -0
  77. package/cypress/pages/components/gridCommonComponents.js +951 -0
  78. package/cypress/pages/components/index.js +38 -0
  79. package/cypress/pages/components/listSortingAndOrderingBase.js +401 -0
  80. package/cypress/pages/components/maximumRecorderLengthComponent.js +116 -0
  81. package/cypress/pages/components/mcqAdditionalSettingsBase.js +390 -0
  82. package/cypress/pages/components/mcqOptionsComponent.js +263 -0
  83. package/cypress/pages/components/mcqPreviewComponents.js +78 -0
  84. package/cypress/pages/components/mcqQuestionCommonComponents.js +265 -0
  85. package/cypress/pages/components/mcqScoringComponent.js +120 -0
  86. package/cypress/pages/components/mcqSetCorrectAnswerSection.js +143 -0
  87. package/cypress/pages/components/optionsWrapperComponent.js +221 -0
  88. package/cypress/pages/components/playbackControlsBaseComponent.js +163 -0
  89. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +90 -0
  90. package/cypress/pages/components/questionInstructionsComponent.js +112 -0
  91. package/cypress/pages/components/scoringSectionBase.js +308 -0
  92. package/cypress/pages/components/setPointsPopupBase.js +79 -0
  93. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +79 -0
  94. package/cypress/pages/components/specialCharactersFlyoutComponent.js +58 -0
  95. package/cypress/pages/components/studentResponseAreaAndLayoutComponent.js +28 -0
  96. package/cypress/pages/components/uploadImageSectionComponent.js +594 -0
  97. package/cypress/pages/createItemPage.js +28 -0
  98. package/cypress/pages/dialogBoxBase.js +111 -0
  99. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +1161 -0
  100. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +1559 -0
  101. package/cypress/pages/dragAndDropIntoCategoriesPage.js +1556 -0
  102. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +1396 -0
  103. package/cypress/pages/essayResponseBasicPage.js +57 -0
  104. package/cypress/pages/essayResponseMathPage.js +47 -0
  105. package/cypress/pages/essayResponsePage.js +385 -0
  106. package/cypress/pages/feedbackScalePage.js +698 -0
  107. package/cypress/pages/fillInTheGapsDragAndDropPage.js +742 -0
  108. package/cypress/pages/fillInTheGapsDropdownPage.js +99 -0
  109. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +232 -0
  110. package/cypress/pages/fillInTheGapsOverImageTextPage.js +135 -0
  111. package/cypress/pages/fillInTheGapsScoring.js +5974 -0
  112. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +260 -0
  113. package/cypress/pages/fillInTheGapsTextPage.js +225 -0
  114. package/cypress/pages/highlightImagePage.js +1316 -0
  115. package/cypress/pages/highlightPage.js +870 -0
  116. package/cypress/pages/index.js +30 -0
  117. package/cypress/pages/listMatchingPage.js +1330 -0
  118. package/cypress/pages/listMatchingScoring.js +2635 -0
  119. package/cypress/pages/listOrderingPage.js +751 -0
  120. package/cypress/pages/listSortingPage.js +1201 -0
  121. package/cypress/pages/multipleSelectionGridPage.js +359 -0
  122. package/cypress/pages/multipleSelectionPage.js +88 -0
  123. package/cypress/pages/passagePage.js +426 -0
  124. package/cypress/pages/readingRulerPage.js +302 -0
  125. package/cypress/pages/selectQuestionResourceToolPage.js +64 -0
  126. package/cypress/pages/shortTextResponsePage.js +197 -0
  127. package/cypress/pages/singleSelectionGridPage.js +370 -0
  128. package/cypress/pages/singleSelectionPage.js +65 -0
  129. package/cypress/pages/uploadResponsePage.js +110 -0
  130. package/cypress/pages/videoResponsePage.js +375 -0
  131. package/cypress/support/commands.js +140 -0
  132. package/cypress/support/e2e.js +14 -0
  133. package/cypress/support/helpers/abortEarly.js +19 -0
  134. package/cypress/support/helpers/accessibility.js +34 -0
  135. package/cypress/support/helpers/cypressUtilities.js +64 -0
  136. package/cypress/support/helpers/localStorage.js +13 -0
  137. package/cypress/support/helpers/selectText.js +77 -0
  138. package/cypress/support/helpers/utilities.js +126 -0
  139. package/cypress.config.js +76 -0
  140. package/il.yaml +14 -0
  141. package/language +1 -0
  142. package/package.json +26 -0
@@ -0,0 +1,40 @@
1
+ import { equationEditorCategoriesAndSymbols } from "../../fixtures/equationEditorCategoriesAndSymbols ";
2
+ import { dialogBoxBase } from "../dialogBoxBase";
3
+ import { essayResponsePage } from "../essayResponsePage";
4
+
5
+ const selectors = {
6
+ ...dialogBoxBase,
7
+ selectSymbolsToDisplayLabel: () => cy.get('.select-to-display'),
8
+ categoryLabel: () => cy.get('.accordian-label'),
9
+ categoryCheckbox: () => cy.get('.accordian-checkbox input[type="checkbox"]'),
10
+ categoryCharacters: (ariaLabel = null) => {
11
+ if (ariaLabel) {
12
+ return cy.get(`.edit-custom-category-flyout .icon-button-custom-format[aria-label="${ariaLabel}"]`)
13
+ } else {
14
+ return cy.get('.edit-custom-category-flyout .icon-button-custom-format')
15
+ }
16
+ },
17
+ characterDragIcon: () => cy.get('.drag-icon-button-custom-format'),
18
+ characterTickIcon: () => cy.get('.tick-icon-wrapper'),
19
+ buttonReset: () => cy.get('.reset-btn-equation-editor'),
20
+ resetIcon: () => cy.get('.reset-btn-icon-wrapper svg'),
21
+ buttonSave: () => cy.get('.action-btn-wrapper button').eq(0),
22
+ buttonCancel: () => cy.get('.action-btn-wrapper button').eq(1)
23
+ }
24
+
25
+ const steps = {
26
+ openEditCategoryFlyout: () => {
27
+ essayResponsePage.equationEditorSectionCategories()
28
+ .contains(`${equationEditorCategoriesAndSymbols['keypad'].displayName}`)
29
+ .parents('[id*="DraggableItem"]')
30
+ .within(() => {
31
+ essayResponsePage.equationEditorSectionCategoriesEditIcon()
32
+ .click();
33
+ });
34
+ }
35
+ }
36
+
37
+ export const editCategoryFlyout = {
38
+ ...selectors,
39
+ steps
40
+ }
@@ -0,0 +1,158 @@
1
+ import { equationEditorCategoriesAndSymbols } from "../../fixtures/equationEditorCategoriesAndSymbols ";
2
+ import constants from "../../fixtures/constants";
3
+ import { dialogBoxBase } from "../dialogBoxBase";
4
+ import { essayResponsePage } from "../essayResponsePage";
5
+ const css = Cypress.env('css');
6
+
7
+ const selectors = {
8
+ ...dialogBoxBase,
9
+ buttonOk: () => cy.get('.ok-btn'),
10
+ previewInputField: () => cy.get('.mq-editable-field'),
11
+ categoryTab: (categoryName = null) => {
12
+ if (categoryName) {
13
+ return cy.get('.tool-wrapper').contains(categoryName)
14
+ } else {
15
+ return cy.get('.tool-wrapper')
16
+ }
17
+ },
18
+ categoryCharactersWrapper: () => cy.get('.subtools-container'),
19
+ categoryCharacters: (ariaLabel = null) => {
20
+ if (ariaLabel) {
21
+ return cy.get(`.subtools-icon-wrapper[tabindex="0"][aria-label="${ariaLabel}"]`)
22
+ } else {
23
+ return cy.get('.subtools-icon-wrapper[tabindex="0"]')
24
+ }
25
+ },
26
+ categoryTabIcon: () => cy.get('.tool-icon-wrapper'),
27
+ categoryTabTitle: () => cy.get('.tool-title'),
28
+ buttonCancel: () => cy.get('.cancel-btn'),
29
+ buttonNext: () => cy.get('.next-btn'),
30
+ buttonPrevious: () => cy.get('.previous-btn'),
31
+ inputFieldCursor: () => cy.get('.mq-hasCursor'),
32
+ inputFieldFirstEmptyBox: () => cy.get('.mq-empty').eq(0),
33
+ categoryTooltip: () => cy.get('.__react_component_tooltip')
34
+ }
35
+
36
+ const steps = {
37
+ addGenericEquationUsingEquationEditorToCKEditorInputField: () => {
38
+ equationEditorFlyout.categoryTab(equationEditorCategoriesAndSymbols['basic'].displayName)
39
+ .click();
40
+ equationEditorFlyout.previewInputField()
41
+ .type('x');
42
+ equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.basic.symbols.equalTo.ariaLabel)
43
+ .click()
44
+ equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.basic.symbols.cubeRoot.ariaLabel)
45
+ .click()
46
+ equationEditorFlyout.inputFieldCursor()
47
+ .type('8{rightarrow}');
48
+ equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.basic.symbols.comma.ariaLabel)
49
+ .click();
50
+ equationEditorFlyout.previewInputField()
51
+ .type('What is the value of x');
52
+ equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.basic.symbols.questionMark.ariaLabel)
53
+ .click();
54
+ equationEditorFlyout.previewInputField()
55
+ .contains(constants.CKEditorEquationEditorPopupInputFieldEnteredEquationText);
56
+ equationEditorFlyout.buttonOk()
57
+ .click();
58
+ }
59
+ }
60
+
61
+ const tests = {
62
+ verifyEquationEditorFlyoutCategoryTooltip: (categoryName) => {
63
+ it(`When user hovers over the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category a ${equationEditorCategoriesAndSymbols[categoryName].displayName} tooltip should be displayed`, () => {
64
+ equationEditorFlyout.categoryTab()
65
+ .contains(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`, { matchCase: false })
66
+ .parents('.tool-wrapper')
67
+ .as('tool-wrapper')
68
+ .within(() => {
69
+ equationEditorFlyout.categoryTabTitle()
70
+ .realHover();
71
+ });
72
+ equationEditorFlyout.categoryTooltip()
73
+ .verifyInnerText(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`)
74
+ cy.get('@tool-wrapper')
75
+ .within(() => {
76
+ equationEditorFlyout.categoryTabTitle()
77
+ .trigger('mouseout');
78
+ });
79
+ equationEditorFlyout.categoryTooltip()
80
+ .should('not.exist');
81
+ });
82
+ },
83
+
84
+ verifyCSSAnda11yOfEquationEditorInputField: (categoryName) => {
85
+ it(`CSS of added input text for ${equationEditorCategoriesAndSymbols[categoryName].displayName} category`, { tags: 'css' }, () => {
86
+ equationEditorFlyout.previewInputField()
87
+ .find('.mq-root-block')
88
+ .should('have.css', 'color', css.color.text);
89
+ });
90
+
91
+ it(`Accessibility of added input text for ${equationEditorCategoriesAndSymbols[categoryName].displayName} category`, { tags: 'a11y' }, () => {
92
+ cy.checkAccessibility(equationEditorFlyout.previewInputField())
93
+ });
94
+ },
95
+
96
+ verifyEquationEditorFlyoutSymbolCategoriesTabs: (categoryName) => {
97
+ it(`On clicking the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category in the Equation Editor flyout, then the ${equationEditorCategoriesAndSymbols[categoryName].displayName} category tab should get selected`, () => {
98
+ equationEditorFlyout.categoryTab()
99
+ .contains(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`, { matchCase: false })
100
+ .parents('.tool-wrapper')
101
+ .click()
102
+ .within(() => {
103
+ equationEditorFlyout.categoryTabTitle()
104
+ .verifyInnerText(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`)
105
+ .should('have.class', 'selected-tool-content-color');
106
+ });
107
+ });
108
+
109
+ it(`Symbols of ${equationEditorCategoriesAndSymbols[categoryName].displayName} category symbols should be displayed in the flyout`, () => {
110
+ const symbolsArray = Object.values(equationEditorCategoriesAndSymbols[categoryName].symbols)
111
+ equationEditorFlyout.categoryCharacters()
112
+ .each(($el, index) => {
113
+ cy.wrap($el)
114
+ .invoke('attr', 'aria-label')
115
+ .then((ariaLabel) => {
116
+ const expectedValue = symbolsArray[index].ariaLabel;
117
+ expect(ariaLabel.trim().toLowerCase()).to.equal(expectedValue.toLowerCase());
118
+ cy.wrap($el)
119
+ .find('title')
120
+ .should('have.text', symbolsArray[index].title);
121
+ if (symbolsArray[index].textElement) {
122
+ cy.wrap($el)
123
+ .verifyInnerText(symbolsArray[index].textElement)
124
+ }
125
+ });
126
+ });
127
+ });
128
+ },
129
+
130
+ verifyEquationEditorFlyoutSymbolCategoriesFunctionality: (categoryName, wordCount) => {
131
+ let symbols = Object.values(equationEditorCategoriesAndSymbols[categoryName].symbols)
132
+ let mappedArr = symbols.map(x => x.displayText)
133
+ it('If the user clicks on the symbol then that symbol should be displayed in the Equation Editor flyout input field', () => {
134
+ equationEditorFlyout.categoryCharacters()
135
+ .then($elements => {
136
+ const selectorLength = $elements.length;
137
+ for (let index = 0; index < selectorLength; index++) {
138
+ equationEditorFlyout.categoryCharacters()
139
+ .eq(index)
140
+ .click();
141
+ }
142
+ });
143
+ //The equation editor input Field equation is not checked.
144
+ });
145
+
146
+ equationEditorFlyout.tests.verifyCSSAnda11yOfEquationEditorInputField(categoryName)
147
+ if (categoryName === 'keypad') {
148
+ essayResponsePage.tests.insertEquationAndVerifyInputFieldContentsAndWordCount(`1234567890·,+−×÷`, wordCount);
149
+ } else {
150
+ essayResponsePage.tests.insertEquationAndVerifyInputFieldContentsAndWordCount(mappedArr.toString().replaceAll(',', ''), wordCount)
151
+ }
152
+ }
153
+ }
154
+ export const equationEditorFlyout = {
155
+ ...selectors,
156
+ steps,
157
+ tests
158
+ }
@@ -0,0 +1,86 @@
1
+ const selectors = {
2
+ //Basic section
3
+ setWordLimitLabel: () => cy.get('[class*="EssayResponseComponentstyles__PropertyLabel"]'),
4
+ setWordLimitInputField: () => cy.get('.essay-response-question-word-limit-setting-wrapper input[type="text"]'),
5
+ displayWordLimitLabel: () => cy.get('[id="Display-Word-Limit-dropdown-label"]'),
6
+ displayWordLimitDropdown: () => cy.get('#Display-word-limit-select'),
7
+ displayWordLimitDropdownListOptions: (optionIndex) => cy.get('.dropdown-list-ul [role="option"]').eq(optionIndex),
8
+ allowSubmissionOverWordLimitLabel: () => cy.get('.essay-response-question-word-limit-check-box-form-group').eq(0),
9
+ allowSubmissionOverWordLimitCheckbox: () => cy.get('.essay-response-question-word-limit-check-box-form-group [type="checkbox"]').eq(0),
10
+ showWordCountLabel: () => cy.get('.essay-response-question-word-limit-check-box-form-group').eq(1),
11
+ showWordCountCheckbox: () => cy.get('.essay-response-question-word-limit-check-box-form-group [type="checkbox"]').eq(1),
12
+ previewTabToolbarWrapper: () => cy.get('.toolbar-overlay'),
13
+ previewTabToolbarOption: (formattingOption) => cy.get(`.essay-preview-wrapper a[title = "${formattingOption}"]`),
14
+ //Additional settings
15
+ studentResponseAndLayoutLabel: () => cy.get('.layout-text'),
16
+ predefinedTextLabel: () => cy.get('[class*="EssayResponsestyles__PropertyLabel"]'),
17
+ predefinedTextInputField: () => cy.get('[title="Predefined Text"]'),
18
+ placeholderTextLabel: () => cy.get('.place-holder-text .text-label'),
19
+ placeholderTextInputField: () => cy.get('[aria-label="Placeholder Text"]'),
20
+ minHeightLabel: () => cy.get('.size-wrapper .text-label').eq(0),
21
+ minHeightInputField: () => cy.get('[aria-label="Minimum Height (px)"]'),
22
+ maxHeightLabel: () => cy.get('.size-wrapper .text-label').eq(1),
23
+ maxHeightInputField: () => cy.get('[aria-label="Maximum Height (px)"]'),
24
+ disableAutoHyperlinkingLabel: () => cy.get('[data-ngie-testid="disable-automatic-hyperlinking-checkbox"] .MuiFormControlLabel-label'),
25
+ disableAutoHyperlinkingCheckbox: () => cy.get('[data-ngie-testid="disable-automatic-hyperlinking-checkbox"] input'),
26
+ spellCheckLabel: () => cy.get('[data-ngie-testid="spell-check-checkbox"] .MuiFormControlLabel-label'),
27
+ spellCheckCheckbox: () => cy.get('[data-ngie-testid="spell-check-checkbox"] input'),
28
+ customSpecialCharacterLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]').eq(1),
29
+ customSpecialCharacterInputField: () => cy.get('input[aria-label="Custom Special Characters"]'),
30
+ wordLimitReachedWarningMessage: () => cy.get('[data-at="limit-reached"]'),
31
+ //Preview tab
32
+ responseField: () => cy.get('[title="Enter your response to the question here."]'),
33
+ responseFieldWordCount: () => cy.get('[data-at="character-count"]'),
34
+ }
35
+
36
+ const steps = {
37
+ //TODO: need to improve this, we are passing two parameters here, only one should suffice
38
+ openAndSelectOptionFromDisplayWordLimitDropdown: (optionIndex, optionName) => {
39
+ essayResponseCommonComponents.displayWordLimitDropdown()
40
+ .click();
41
+ essayResponseCommonComponents.displayWordLimitDropdownListOptions(optionIndex)
42
+ .click();
43
+ essayResponseCommonComponents.displayWordLimitDropdown()
44
+ .should('have.text', optionName);
45
+ },
46
+
47
+ setWordLimit: (wordLimit) => {
48
+ essayResponseCommonComponents.setWordLimitInputField()
49
+ .clear()
50
+ .type(wordLimit)
51
+ .blur()
52
+ .should('have.value', wordLimit);
53
+ },
54
+
55
+ enterTextInResponseField: (textContent) => {
56
+ essayResponseCommonComponents.responseField()
57
+ .type(textContent)
58
+ .find('p')
59
+ .should('have.text', textContent);
60
+ },
61
+
62
+ verifyResponseFieldWordCount: (countValue) => {
63
+ essayResponseCommonComponents.responseFieldWordCount()
64
+ .should('have.text', countValue);
65
+ },
66
+
67
+ verifyWordLimitReachedWarningMessage: () => {
68
+ essayResponseCommonComponents.wordLimitReachedWarningMessage()
69
+ .should('have.text', 'Word limit reached')
70
+ .and('be.visible');
71
+ },
72
+
73
+ resetPreviewTabResponseField: () => {
74
+ cy.log('clearing and resetting the response field');
75
+ essayResponseCommonComponents.responseField()
76
+ .clear()
77
+ .blur();
78
+ essayResponseCommonComponents.responseField()
79
+ .type('{backspace}');
80
+ },
81
+ }
82
+
83
+ export const essayResponseCommonComponents = {
84
+ ...selectors,
85
+ steps
86
+ }