itemengine-cypress-automation 1.0.157 → 1.0.158

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +1 -1
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +49 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -8
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +7 -7
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -4
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettingsForGroupedLayout.js +1 -1
  8. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +11 -8
  9. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +5 -5
  10. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +2 -1
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +1 -1
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +0 -5
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +10 -10
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/specifyCorrectAnswerSection.js +1 -1
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +0 -5
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +1 -0
  18. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +3 -3
  19. package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +4 -4
  20. package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +4 -4
  21. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +1 -0
  22. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +2 -2
  23. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  24. package/cypress/e2e/ILC/Matching/draggableOptions.js +53 -0
  25. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +302 -0
  26. package/cypress/e2e/ILC/MultipleSelectionGridNew/additionalSettingsBasic.js +146 -0
  27. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +83 -0
  28. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +18 -22
  29. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -2
  30. package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettingsBasic.js +146 -0
  31. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +83 -0
  32. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -1
  33. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +1 -1
  34. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +1 -1
  35. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +6 -0
  36. package/cypress/fixtures/evaluationMethodsAndCustomSettings.js +1 -1
  37. package/cypress/pages/components/autoScoredScoringPreviewTab.js +6 -0
  38. package/cypress/pages/components/commonComponents.js +2 -1
  39. package/cypress/pages/components/createCustomCategoryFlyout.js +0 -1
  40. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +4 -4
  41. package/cypress/pages/components/gridQuestionCommonComponent.js +29 -1
  42. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  43. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  44. package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -4
  45. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +10 -0
  46. package/cypress/pages/graphingPage.js +4 -4
  47. package/cypress/pages/index.js +0 -3
  48. package/cypress/pages/matchingPage.js +166 -10
  49. package/cypress/pages/multipleSelectionGridPage.js +10 -2
  50. package/cypress/pages/rulerPage.js +12 -12
  51. package/cypress/pages/singleSelectionGridPage.js +10 -2
  52. package/cypress/pages/textEntryMathPage.js +2 -1
  53. package/package.json +1 -1
  54. package/cypress/pages/listMatchingPage.js +0 -1514
  55. package/cypress/pages/listMatchingScoring.js +0 -2547
  56. package/cypress/pages/passagePage.js +0 -436
@@ -1,436 +0,0 @@
1
- import constants from "../fixtures/constants";
2
- import utilities from "../support/helpers/utilities";
3
- import { additionalSettingsPanel, ckEditorToolbar, commonComponents, createQuestionBasePage, equationEditorFlyout } from "./components";
4
- import { dialogBoxBase } from "./dialogBoxBase";
5
- import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
6
- const css = Cypress.env('css');
7
-
8
- const selectors = {
9
- ...commonComponents,
10
- ...ckEditorToolbar,
11
- ...equationEditorFlyout,
12
- ...additionalSettingsPanel,
13
- ...createQuestionBasePage,
14
- //TODO: Need to update selectors https://redmine.zeuslearning.com/issues/518498
15
- headingLabel: () => cy.get('.inline-text-property-label').eq(0),
16
- headingInputField: () => cy.get('.inline-text-question-prefix-wrapper input').eq(0),
17
- contentLabel: () => cy.get('.content-label'),
18
- enableMultipageContentLabel: () => cy.get('[data-ngie-testid="enable-multi-page-content-checkbox"] .MuiFormControlLabel-label'),
19
- enableMultipageContentLabelCheckbox: () => cy.get('[data-ngie-testid="enable-multi-page-content-checkbox"] input'),
20
- bodyLabel: () => cy.get('.additional-settings-label').eq(0),
21
- bodyInputField: () => cy.get('[title="Enter body"]'),
22
- addPageButton: () => cy.get('.ngie-icon-with-label-btn'),
23
- deletePageButton: () => cy.get('.ngie-icon-btn-cls'),
24
- bodyWrapper: () => cy.get('.edit-mcq-option-wrapper'),
25
- bodyNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]'),
26
- //Preview
27
- previewHeadingText: () => cy.get('[class*="TabsComponentstyles__PreviewWrapper"] .passage_Heading'),
28
- previewTabBody: () => cy.get('.question-text-wrapper'),
29
- previousPageButton: () => cy.get('.pagination-button[data-at="previous"]'),
30
- nextPageButton: () => cy.get('.pagination-button[data-at="next"]'),
31
- noPreviewText: () => cy.get('[class*="PassagePreviewstyles__NoPreview"]'),
32
- paginationText: () => cy.get('.pagination-text'),
33
- previewWrapper: () => cy.get('[class*="TabsComponentstyles__PreviewWrapper"]'),
34
- // additionalSettings
35
- additionalSettingsFleschKincaidLabel: () => cy.get('.inline-text-property-label').eq(1),
36
- additionalSettingsLexileLabel: () => cy.get('.inline-text-property-label').eq(2),
37
- additionalSettingsFleschKincaidInputField: () => cy.get('.MuiInputBase-root [aria-label="Flesch-Kincaid"]'),
38
- additionalSettingsLexileInputField: () => cy.get('.MuiInputBase-root [aria-label="Lexile"]')
39
- }
40
-
41
- const steps = {
42
- ...createQuestionBasePage.steps,
43
- ...commonComponents.steps,
44
- ...ckEditorToolbar.steps,
45
- ...equationEditorFlyout.steps,
46
- ...additionalSettingsPanel.steps,
47
-
48
- verifyHeadingPlaceholder: () => {
49
- passagePage.headingInputField()
50
- .should('have.attr', 'placeholder', 'Enter heading');
51
- },
52
-
53
- verifyBodyPlaceholder: () => {
54
- passagePage.bodyInputField()
55
- .should('have.attr', 'data-cke-editorplaceholder', 'Enter body');
56
- },
57
-
58
- addHeadingText: () => {
59
- passagePage.headingInputField()
60
- .type('Globalization', { delay: 0 })
61
- .blur();
62
- },
63
-
64
- addInputTextToBodyInputField: (inputTextArray) => {
65
- inputTextArray.forEach((inputText, index) => {
66
- passagePage.bodyInputField()
67
- .eq(index)
68
- .type(inputText)
69
- .should('have.text', inputText)
70
- .blur();
71
- });
72
- },
73
-
74
- focusInBodyInputField: (index) => {
75
- passagePage.bodyInputField()
76
- .eq(index)
77
- .focus();
78
- },
79
-
80
- focusInHeadingInputField: () => {
81
- passagePage.headingInputField()
82
- .focus();
83
- },
84
-
85
- focusOutOfBodyInputField: (index) => {
86
- passagePage.bodyInputField()
87
- .eq(index)
88
- .blur();
89
- },
90
-
91
- focusOutOfHeadingInputField: () => {
92
- passagePage.headingInputField()
93
- .blur();
94
- },
95
-
96
- verifyHeadingInputFieldErrorMessage: () => {
97
- passagePage.headingLabel()
98
- .parents('.passage')
99
- .within(() => {
100
- commonComponents.errorMessage()
101
- .eq(0)
102
- .verifyInnerText('Error: Heading is required.');
103
- });
104
- },
105
-
106
- verifyBodyInputFieldErrorMessage: () => {
107
- passagePage.bodyLabel()
108
- .parents('.passage')
109
- .within(() => {
110
- commonComponents.errorMessage()
111
- .eq(1)
112
- .verifyInnerText('Error: Body is required.');
113
- });
114
- },
115
-
116
- addBoldTextInputToBodyInputField: (index) => {
117
- passagePage.bodyInputField()
118
- .eq(index)
119
- .type('This is a bold option')
120
- .should('have.text', '​​​​​​​This is a bold option');
121
- },
122
-
123
- verifyImageAndAltTextInBodyInputField: (index) => {
124
- passagePage.bodyInputField()
125
- .eq(index)
126
- .find('img')
127
- .should('have.attr', 'src', constants.foxImageLink)
128
- .and('have.attr', 'alt', constants.foxImageAltText);
129
- },
130
-
131
- verifyEquationInBodyInputField: (index) => {
132
- passagePage.bodyInputField()
133
- .eq(index)
134
- .find('[data-widget="ngie_equation"]')
135
- .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
136
- .contains(constants.CKEditorInputFieldEnteredEquationText);
137
- },
138
-
139
- verifyLinkInBodyInputField: (index) => {
140
- passagePage.bodyInputField()
141
- .eq(index)
142
- .find('a')
143
- .should('have.text', 'lorem')
144
- .and('have.attr', 'href', `${Cypress.config().baseUrl}`);
145
- },
146
-
147
- verifyBoldTextInBodyInputField: (index) => {
148
- passagePage.bodyInputField()
149
- .eq(index)
150
- .find('strong')
151
- .should('exist')
152
- .should('have.text', '​​​​​​​This is a bold option');
153
- },
154
-
155
- verifyTextInBodyInputField: (index, bodyInputText) => {
156
- passagePage.bodyInputField()
157
- .eq(index)
158
- .should('have.text', bodyInputText);
159
- },
160
-
161
- addPage: () => {
162
- passagePage.addPageButton()
163
- .click();
164
- },
165
-
166
- deletePage: (index) => {
167
- passagePage.deletePageButton()
168
- .eq(index)
169
- .click();
170
- },
171
-
172
- verifyDeletePageButtonDisabled: () => {
173
- passagePage.deletePageButton()
174
- .should('be.disabled');
175
- },
176
-
177
- verifyDragHandleButtonDisabled: () => {
178
- commonComponents.dragHandleButton()
179
- .parents('[class*="SingleOptionstyle__IconWrapper"]')
180
- .should('have.attr', 'draggable', 'false');
181
- },
182
-
183
- verifyDeletePageButtonEnabled: () => {
184
- passagePage.deletePageButton()
185
- .should('be.enabled');
186
- },
187
-
188
- verifyDragHandleButtonEnabled: () => {
189
- commonComponents.dragHandleButton()
190
- .parents('[class*="SingleOptionstyle__IconWrapper"]')
191
- .should('have.attr', 'draggable', 'true');
192
- },
193
-
194
- verifyBodyContents: (index) => {
195
- passagePage.bodyWrapper()
196
- .eq(index)
197
- .within(() => {
198
- passagePage.bodyInputField()
199
- .should('have.attr', 'data-cke-editorplaceholder', 'Enter body');
200
- commonComponents.dragHandleButton()
201
- .should('exist');
202
- passagePage.deletePageButton()
203
- .should('exist');
204
- passagePage.bodyNumeration()
205
- .should('have.text', index + 1);
206
- });
207
- },
208
-
209
- verifyDisabledDeletePageButtonTooltip: () => {
210
- passagePage.deletePageButton()
211
- .eq(0)
212
- .trigger('mouseover', { force: true })
213
- commonComponents.tooltipText()
214
- .should('have.text', 'Minimum one page is required.');
215
- passagePage.deletePageButton()
216
- .eq(0)
217
- .trigger('mouseout', { force: true });
218
- commonComponents.tooltipText()
219
- .should('not.exist');
220
- },
221
-
222
- verifyDragHandleButtonTooltip: () => {
223
- commonComponents.dragHandleButton()
224
- .eq(0)
225
- .verifyTooltip('Drag to reorder');
226
- },
227
-
228
- verifyDeletePageButtonTooltip: () => {
229
- passagePage.deletePageButton()
230
- .eq(0)
231
- .verifyTooltip('Delete page');
232
- },
233
-
234
- verifyBodyPlaceholderTextNotExist: () => {
235
- passagePage.bodyInputField()
236
- .should('not.have.attr', 'data-cke-editorplaceholder');
237
- },
238
-
239
- verifyHeadingPlaceholderTextDisappear: () => {
240
- passagePage.headingInputField()
241
- .should('not.have.attr', 'placeholder');
242
- },
243
-
244
- verifyEnableMultiPageContentCheckboxUnchecked: () => {
245
- passagePage.enableMultipageContentLabelCheckbox()
246
- .should('not.be.checked');
247
- },
248
-
249
- clearBodyInputField: () => {
250
- passagePage.bodyInputField()
251
- .clear();
252
- },
253
-
254
- checkMultipageContentCheckbox: () => {
255
- passagePage.enableMultipageContentLabelCheckbox()
256
- .click()
257
- .should('be.checked');
258
- },
259
-
260
- uncheckMultipageContentCheckbox: () => {
261
- passagePage.enableMultipageContentLabelCheckbox()
262
- .click()
263
- .should('not.be.checked');
264
- },
265
- //Preview
266
- verifyImageAddedToBodyInPreviewTab: () => {
267
- passagePage.previewTabBody()
268
- .find('img')
269
- .should('have.attr', 'src', constants.foxImageLink)
270
- .and('have.attr', 'alt', constants.foxImageAltText);
271
- },
272
-
273
- verifyEquationAddedToBodyInPreviewTab: () => {
274
- passagePage.previewTabBody()
275
- .contains(constants.CKEditorInputFieldEnteredEquationText)
276
- passagePage.previewTabBody()
277
- .find('[role="math"]')
278
- .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
279
- },
280
-
281
- verifyLinkAddedToBodyInPreviewTab: () => {
282
- passagePage.previewTabBody()
283
- .should('have.text', 'lorem')
284
- .find('a')
285
- .should('have.attr', 'href', `${Cypress.config().baseUrl}`)
286
- },
287
-
288
- verifyBoldTextAddedToBodyInPreviewTab: () => {
289
- passagePage.previewTabBody()
290
- .find('strong')
291
- .should('exist')
292
- .should('have.text', 'This is a bold option')
293
- },
294
-
295
- verifyPreviousPageButtonDisabled: () => {
296
- passagePage.previousPageButton()
297
- .should('be.disabled');
298
- },
299
-
300
- verifyNextPageButtonDisabled: () => {
301
- passagePage.nextPageButton()
302
- .should('be.disabled');
303
- },
304
-
305
- verifyPreviousPageButtonEnabled: () => {
306
- passagePage.previousPageButton()
307
- .should('be.enabled');
308
- },
309
-
310
- verifyNextPageButtonEnabled: () => {
311
- passagePage.nextPageButton()
312
- .should('be.enabled');
313
- },
314
-
315
- navigateToNextPage: () => {
316
- passagePage.nextPageButton()
317
- .click();
318
- },
319
-
320
- navigateToPreviousPage: () => {
321
- passagePage.previousPageButton()
322
- .click();
323
- },
324
-
325
- hoverOnNextPageButton: () => {
326
- passagePage.nextPageButton()
327
- .realHover()
328
- },
329
-
330
- hoverAwayFromNextPageButton: () => {
331
- passagePage.nextPageButton()
332
- .realHover({ position: 'topLeft' })
333
- },
334
-
335
- hoverOnPreviousPageButton: () => {
336
- passagePage.previousPageButton()
337
- .realHover()
338
- },
339
-
340
- hoverAwayFromPreviousPageButton: () => {
341
- passagePage.previousPageButton()
342
- .realHover({ position: 'topLeft' })
343
- },
344
-
345
- // additional settings
346
- addAndVerifyTextInFleschKincaidInputField: (text) => {
347
- passagePage.additionalSettingsFleschKincaidInputField()
348
- .type(text, { delay: 0 })
349
- .blur()
350
- .should('have.attr', 'value', text);
351
- },
352
-
353
- addAndVerifyTextInLexileInputField: (text) => {
354
- passagePage.additionalSettingsLexileInputField()
355
- .type(text, { delay: 0 })
356
- .blur()
357
- .should('have.attr', 'value', text);
358
- },
359
-
360
- addTextToTeacherGuidelinesInputField: () => {
361
- passagePage.additionalSettingsTeacherGuidelinesInputField()
362
- .type('Teacher scoring guidelines', { delay: 0 })
363
- .blur();
364
- },
365
-
366
- /**
367
- * @param {number} currentPage shows the current page
368
- * @param {number} TotalPages shows the total no of pages
369
- * @description this function verifies pagination text displayed in the preview tab
370
- */
371
- verifyPaginationText: (currentPage, TotalPages) => {
372
- passagePage.paginationText()
373
- .should('have.text', `${currentPage} of ${TotalPages}`);
374
- },
375
-
376
- createBasicPassageResourceAndTool: (inputHeadingText, inputBodyText) => {
377
- passagePage.headingInputField()
378
- .type(inputHeadingText);
379
- passagePage.bodyInputField()
380
- .type(inputBodyText);
381
- passagePage.saveQuestionButton()
382
- .click();
383
- },
384
- }
385
-
386
- const tests = {
387
- ...equationEditorFlyout.tests,
388
- ...commonComponents.tests,
389
- ...createQuestionBasePage.tests,
390
- ...additionalSettingsPanel.tests,
391
-
392
- // header section
393
- verifyCancelButton: () => {
394
- it('When user has made no edits and clicks on Cancel button, the user should be directed back to the \'Select a Question\' page', () => {
395
- createQuestionBasePage.cancelButton()
396
- .click();
397
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.selectAQuestionHeaderText(), 'visible');
398
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.questionTypeOptionTitle(), 'visible');
399
- });
400
-
401
- it('When user has made some edits/changes and clicks on Cancel button, a popup should be displayed', () => {
402
- selectQuestionResourceToolPage.steps.selectResourceType('passage');
403
- utilities.verifyElementVisibilityState(passagePage.headingInputField(), 'visible');
404
- passagePage.steps.addHeadingText();
405
- createQuestionBasePage.cancelButton()
406
- .click();
407
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible')
408
- });
409
-
410
- dialogBoxBase.tests.verifyContentsOfLeavePagePopupWithCSSAnda11y();
411
-
412
- 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`, () => {
413
- dialogBoxBase.buttonReject()
414
- .click();
415
- createQuestionBasePage.editTab()
416
- .should('have.attr', 'aria-selected', 'true')
417
- passagePage.headingInputField()
418
- .should('have.attr', 'value', 'Globalization')
419
- });
420
-
421
- it(`Clicking on \'Yes, I want to leave this page\' button should should discard all changes and direct the user to the \'Select a question\' page.`, () => {
422
- createQuestionBasePage.cancelButton()
423
- .click();
424
- dialogBoxBase.buttonAccept()
425
- .click();
426
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.selectAQuestionHeaderText(), 'visible');
427
- utilities.verifyElementVisibilityState(selectQuestionResourceToolPage.questionTypeOptionTitle(), 'visible');
428
- });
429
- },
430
- }
431
-
432
- export const passagePage = {
433
- ...selectors,
434
- steps,
435
- tests
436
- }