itemengine-cypress-automation 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseEditTabBasicSections.js +2 -2
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseManuallyScoredNonScoredScoringSection.js +1 -0
- package/cypress/pages/audioPlayerPage.js +2 -2
- package/cypress/pages/audioResponsePage.js +3 -3
- package/cypress/pages/components/additionalSettingsPanel.js +1 -1
- package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +7 -1
- package/cypress/pages/components/browseItemsPage.js +53 -0
- package/cypress/pages/components/createQuestionBasePage.js +32 -2
- package/cypress/pages/components/customizeHighlightPropertiesComponent.js +1 -1
- package/cypress/pages/components/dragAndDropResponseOptions.js +3 -2
- package/cypress/pages/components/draggableOptionsContainer.js +1 -0
- package/cypress/pages/components/figOverImageCommonComponent.js +198 -10
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +4 -4
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +54 -1
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +3 -3
- package/cypress/pages/components/gridCommonComponents.js +3 -2
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +7 -3
- package/cypress/pages/components/uploadImageSectionComponent.js +2 -0
- package/cypress/pages/createItemPage.js +35 -2
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +4 -4
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +2 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +7 -10
- package/cypress/pages/essayResponseBasicPage.js +2 -2
- package/cypress/pages/essayResponseMathPage.js +3 -2
- package/cypress/pages/essayResponsePage.js +1 -1
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +74 -7
- package/cypress/pages/fillInTheGapsTextPage.js +1 -1
- package/cypress/pages/highlightImagePage.js +12 -10
- package/cypress/pages/highlightPage.js +29 -5
- package/cypress/pages/listMatchingPage.js +205 -17
- package/cypress/pages/listMatchingScoring.js +0 -1
- package/cypress/pages/passagePage.js +3 -3
- package/cypress/pages/readingRulerPage.js +1 -1
- package/cypress/pages/shortTextResponsePage.js +1 -1
- package/cypress/pages/videoResponsePage.js +7 -7
- package/package.json +1 -1
@@ -23,6 +23,7 @@ const selectors = {
|
|
23
23
|
return cy.get('[role="listbox"] .dropdown-menu-item')
|
24
24
|
}
|
25
25
|
},
|
26
|
+
responseDropdownOptionText: () => cy.get('[role="listbox"] .dropdown-menu-item .dropdown-label-text'),
|
26
27
|
responseDropdownSetCorrectAnswerSection: () => cy.get('.response-dropdown [role="combobox"]'),
|
27
28
|
responseFieldLabelSetCorrectAnswerSection: () => cy.get('.cloze-with-text-form-control-wrapper .input-field-label'),
|
28
29
|
responseDropdownWrapperSetCorrectAnswerSection: () => cy.get('.response-dropdown-wrapper .dropdown-form-control'),
|
@@ -323,7 +324,54 @@ const steps = {
|
|
323
324
|
fillInTheGapsDropdownCommonComponent.responseDropdownSetCorrectAnswerSection()
|
324
325
|
.eq(responseDropdownIndex)
|
325
326
|
.should('have.attr', 'aria-label', ariaLabel);
|
326
|
-
}
|
327
|
+
},
|
328
|
+
|
329
|
+
/**
|
330
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
331
|
+
* @description Verify placeholder for response dropdown in set correct answer section does not exist
|
332
|
+
*/
|
333
|
+
verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseDropdownNotExists: (responseDropdownIndex) => {
|
334
|
+
fillInTheGapsDropdownCommonComponent.responseDropdownWrapperSetCorrectAnswerSection()
|
335
|
+
.eq(responseDropdownIndex)
|
336
|
+
.within(() => {
|
337
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), 'notExist');
|
338
|
+
});
|
339
|
+
},
|
340
|
+
|
341
|
+
/**
|
342
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
343
|
+
* @param {string} placeholderText Placeholder for dropdown
|
344
|
+
* @description Verify placeholder text displayed for response dropdown in set correct answer section
|
345
|
+
*/
|
346
|
+
verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseDropdown: (responseDropdownIndex, placeholderText) => {
|
347
|
+
fillInTheGapsDropdownCommonComponent.responseDropdownWrapperSetCorrectAnswerSection()
|
348
|
+
.eq(responseDropdownIndex)
|
349
|
+
.within(() => {
|
350
|
+
utilities.verifyTextContent(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), placeholderText);
|
351
|
+
});
|
352
|
+
},
|
353
|
+
|
354
|
+
/**
|
355
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
356
|
+
* @param {number} height Height of response dropdown in set correct answer section
|
357
|
+
* @description Verify height of response dropdown in set correct answer section
|
358
|
+
*/
|
359
|
+
verifyHeightOfResponseDropdownInSetCorrectAnswerSection: (responseDropdownIndex, height) => {
|
360
|
+
fillInTheGapsDropdownCommonComponent.responseDropdownWrapperSetCorrectAnswerSection()
|
361
|
+
.eq(responseDropdownIndex)
|
362
|
+
.should('have.attr', 'height', `${height}px`);
|
363
|
+
},
|
364
|
+
|
365
|
+
/**
|
366
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
367
|
+
* @param {number} width Width of response dropdown in set correct answer section
|
368
|
+
* @description Verify width of response dropdown in set correct answer section
|
369
|
+
*/
|
370
|
+
verifyWidthOfResponseDropdownInSetCorrectAnswerSection: (responseDropdownIndex, width) => {
|
371
|
+
fillInTheGapsDropdownCommonComponent.responseDropdownWrapperSetCorrectAnswerSection()
|
372
|
+
.eq(responseDropdownIndex)
|
373
|
+
.should('have.attr', 'width', `${width}px`);
|
374
|
+
},
|
327
375
|
}
|
328
376
|
|
329
377
|
const tests = {
|
@@ -340,6 +388,11 @@ const tests = {
|
|
340
388
|
fillInTheGapsDropdownCommonComponent.steps.verifyMatchFromAllResponsesLabelAndCheckboxDisabledState();
|
341
389
|
});
|
342
390
|
|
391
|
+
it('When the user hovers over the \'Match from all responses\' label, \'Feature available for only alternate correct answers\' text should appear on a tooltip, on hovering away from the label, the tooltip should disappear', () => {
|
392
|
+
fillInTheGapsDropdownCommonComponent.matchFromAllResponsesLabel()
|
393
|
+
.verifyTooltip('Feature available for only alternate correct answers');
|
394
|
+
});
|
395
|
+
|
343
396
|
it('CSS of correct response conditions section', { tags: 'css' }, () => {
|
344
397
|
const labels = [fillInTheGapsDropdownCommonComponent.randomizeOptionsLabel, fillInTheGapsDropdownCommonComponent.matchFromAllResponsesLabel]
|
345
398
|
const uncheckedCheckboxes = [fillInTheGapsDropdownCommonComponent.randomizeOptionsCheckbox, fillInTheGapsDropdownCommonComponent.matchFromAllResponsesCheckbox]
|
@@ -19,10 +19,10 @@ const selectors = {
|
|
19
19
|
ignoreSpacesBeforeAndAfterCheckbox: () => cy.get('.ngie-checkbox input').eq(1),
|
20
20
|
matchFromAllResponsesLabel: () => cy.get('.ngie-checkbox-control-label').eq(2),
|
21
21
|
matchFromAllResponsesCheckbox: () => cy.get('.ngie-checkbox input').eq(2),
|
22
|
-
responseFieldPreviewTab: () => cy.get('
|
23
|
-
responseFieldWrapperPreviewTab: () => cy.get('
|
22
|
+
responseFieldPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-input-field input[type="text"]'),
|
23
|
+
responseFieldWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-input-field'),
|
24
24
|
previewTabCorrectAnswerContainer: () => cy.get('[class*="ClozeWithTextResponsestyles__CorrectAnswerWrapper"]'),
|
25
|
-
previewTabCorrectAnswerResponseWrapper: () => cy.get('[class*="ClozeWithTextResponsestyles__CorrectResponseWrapper"] [aria-label*="
|
25
|
+
previewTabCorrectAnswerResponseWrapper: () => cy.get('[class*="ClozeWithTextResponsestyles__CorrectResponseWrapper"] [aria-label*="Add answer for response"]'),
|
26
26
|
previewTabResponseWrapper: () => cy.get('.draggable-input .cloze-with-text-answer-status-response-preview-wrapper'),
|
27
27
|
previewTabCorrectAnswerLabel: () => cy.get('[class*="ClozeWithTextResponsestyles__CorrectAnswerLabel"]'),
|
28
28
|
responseNumeration: () => cy.get('.response-input-adornment'),
|
@@ -533,7 +533,8 @@ const steps = {
|
|
533
533
|
.eq(columnIndex)
|
534
534
|
.clear()
|
535
535
|
.type(points, { delay: 0 })
|
536
|
-
.should('have.value', points)
|
536
|
+
.should('have.value', points)
|
537
|
+
.blur();
|
537
538
|
});
|
538
539
|
},
|
539
540
|
|
@@ -895,7 +896,7 @@ const tests = {
|
|
895
896
|
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.regular);
|
896
897
|
});
|
897
898
|
gridCommonComponents.addOptionButton()
|
898
|
-
.verifyCSS(css.color.secondaryBtnActive, css.fontSize.
|
899
|
+
.verifyCSS(css.color.secondaryBtnActive, css.fontSize.default, css.fontWeight.medium);
|
899
900
|
});
|
900
901
|
},
|
901
902
|
|
@@ -35,4 +35,5 @@ export * from './fillInTheGapsDropdownCommonComponent';
|
|
35
35
|
export * from './figOverImageCommonComponent';
|
36
36
|
export * from './uploadImageSectionComponent';
|
37
37
|
export * from './colorPopupComponent';
|
38
|
-
export * from './customizeHighlightPropertiesComponent';
|
38
|
+
export * from './customizeHighlightPropertiesComponent';
|
39
|
+
export * from './browseItemsPage';
|
@@ -246,7 +246,7 @@ const tests = {
|
|
246
246
|
utilities.verifyCSS(optionsWrapperComponent.addOptionButton(), {
|
247
247
|
'color': css.color.secondaryBtnActive,
|
248
248
|
'font-size': css.fontSize.default,
|
249
|
-
'font-weight': css.fontWeight.
|
249
|
+
'font-weight': css.fontWeight.medium
|
250
250
|
});
|
251
251
|
});
|
252
252
|
|
@@ -5,7 +5,7 @@ const css = Cypress.env('css');
|
|
5
5
|
const selectors = {
|
6
6
|
questionInstructionsLabelEditTab: () => cy.get('.edit-question-instruction-label'),
|
7
7
|
questionInstructionsInputField: () => cy.get('[title="Question Instructions"]'),
|
8
|
-
questionInstructionsText: () => cy.get('.edit-question-preview-wrapper .question-instruction
|
8
|
+
questionInstructionsText: () => cy.get('.edit-question-preview-wrapper .question-instruction'),
|
9
9
|
}
|
10
10
|
|
11
11
|
const steps = {
|
@@ -31,6 +31,11 @@ const steps = {
|
|
31
31
|
commonComponents.errorMessage()
|
32
32
|
.verifyInnerText('Error: Question instructions are required.');
|
33
33
|
});
|
34
|
+
},
|
35
|
+
|
36
|
+
verifyQuestionInstructionsText: () => {
|
37
|
+
questionInstructionsComponent.questionInstructionsText()
|
38
|
+
.should('have.text', 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
34
39
|
}
|
35
40
|
}
|
36
41
|
|
@@ -99,8 +104,7 @@ const tests = {
|
|
99
104
|
questionInstructionsComponent.steps.addQuestionInstructions()
|
100
105
|
cy.log('Switching to Preview Tab')
|
101
106
|
createQuestionBasePage.steps.switchToPreviewTab();
|
102
|
-
|
103
|
-
.should('have.text', 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
107
|
+
steps.verifyQuestionInstructionsText();
|
104
108
|
});
|
105
109
|
}
|
106
110
|
};
|
@@ -7,7 +7,12 @@ const selectors = {
|
|
7
7
|
previewTab: () => cy.get('[data-ngie-testid="preview-tab"]'),
|
8
8
|
editTab: () => cy.get('[data-ngie-testid="edit-tab"]'),
|
9
9
|
settingsButton: () => cy.get('.settingsBtn '),
|
10
|
-
viewAllQuestionsButton: () => cy.get('.view-question-resource-button-wrapper')
|
10
|
+
viewAllQuestionsButton: () => cy.get('.view-question-resource-button-wrapper'),
|
11
|
+
createItemContainer: () => cy.get('.edit-wrapper'),
|
12
|
+
referenceId: () => cy.get('.edit-item-reference-id'),
|
13
|
+
itemTitle: () => cy.get('.ItemLevel-Header'),
|
14
|
+
tagsButton: () => cy.get('.ngie-button').contains('Tags'),
|
15
|
+
tagsInputField: () => cy.get('.tags-chip-container')
|
11
16
|
}
|
12
17
|
|
13
18
|
const steps = {
|
@@ -15,10 +20,38 @@ const steps = {
|
|
15
20
|
createItemPage.addQuestionButton()
|
16
21
|
.click();
|
17
22
|
},
|
18
|
-
|
23
|
+
|
19
24
|
clickOnAddResource: () => {
|
20
25
|
createItemPage.addResourceAndToolsButton()
|
21
26
|
.click();
|
27
|
+
},
|
28
|
+
|
29
|
+
navigateToCreateItemPage: () => {
|
30
|
+
cy.visit('/item-engine/demo/create-item');
|
31
|
+
},
|
32
|
+
|
33
|
+
verifyCreateItemContainerIsVisible: () => {
|
34
|
+
createItemPage.createItemContainer()
|
35
|
+
.should('be.visible');
|
36
|
+
},
|
37
|
+
|
38
|
+
verifyAddQuestionButtonIsVisible: () => {
|
39
|
+
createItemPage.addQuestionButton()
|
40
|
+
.should('be.visible');
|
41
|
+
},
|
42
|
+
|
43
|
+
clickOnTagsButton: () => {
|
44
|
+
createItemPage.tagsButton()
|
45
|
+
.click();
|
46
|
+
},
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @param {string[]} arrayOfTags of text displayed in tags input field
|
50
|
+
* @description Verify the text in tags input field
|
51
|
+
*/
|
52
|
+
verifyTagsInInputField: (arrayOfTags) => {
|
53
|
+
createItemPage.tagsInputField()
|
54
|
+
.should('have.text', arrayOfTags.sort().join(''));
|
22
55
|
}
|
23
56
|
}
|
24
57
|
|
@@ -3,8 +3,8 @@ import { createQuestionBasePage } from "./components";
|
|
3
3
|
const css = Cypress.env('css');
|
4
4
|
|
5
5
|
const selectors = {
|
6
|
-
dialogBox: () => cy.get('[
|
7
|
-
dialogBoxTitle: () => cy.get('
|
6
|
+
dialogBox: () => cy.get('[role="dialog"]'),
|
7
|
+
dialogBoxTitle: () => cy.get('.dialog-title'),
|
8
8
|
dialogBoxContent: () => cy.get('div[id="alert-dialog-description"]'),
|
9
9
|
buttonReject: () => cy.get('.action-btn-wrapper button').eq(0),
|
10
10
|
buttonAccept: () => cy.get('.action-btn-wrapper button').eq(1),
|
@@ -106,8 +106,8 @@ const tests = {
|
|
106
106
|
dragAndDropIntoCategoriesPage.steps.verifyNumerationOfCategoryCellsInQuestionPreview(cellNumerationArray);
|
107
107
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
108
108
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
|
109
|
-
dragAndDropIntoCategoriesPage.steps.
|
110
|
-
dragAndDropIntoCategoriesPage.steps.
|
109
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
|
110
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(3);
|
111
111
|
dragAndDropIntoCategoriesPage.steps.verifyIncorrectAttemptBorder();
|
112
112
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectCellBorderNotExists();
|
113
113
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
@@ -119,8 +119,8 @@ const tests = {
|
|
119
119
|
autoScoredPreviewBase.steps.checkAnswer();
|
120
120
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
121
121
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(1);
|
122
|
-
dragAndDropIntoCategoriesPage.steps.
|
123
|
-
dragAndDropIntoCategoriesPage.steps.
|
122
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionCrossmarkIcon(2);
|
123
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionCheckmarkIcon(3);
|
124
124
|
dragAndDropIntoCategoriesPage.steps.verifyIncorrectAttemptBorder();
|
125
125
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectCellBorderNotExists();
|
126
126
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { autoScoredPreviewBase, previewScoringAndShowCorrectAnswerComponent } from "./components";
|
2
2
|
import { dragAndDropIntoCategoriesPage } from "./dragAndDropIntoCategoriesPage";
|
3
3
|
const cellNumerationArray = ['1', '2', '3', '4'];
|
4
|
+
const correctTabAnswerArray = [['Bat'], ['Eagle', 'Parrot'], ['Platypus', 'Whale'], ['Ostrich']];
|
5
|
+
|
4
6
|
const tests = {
|
5
7
|
verifyScoringForEachCell: (scoringSubtype) => {
|
6
8
|
it('When the user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, 0 points should be provided, red cross-mark should be displayed besides incorrect answer responses, incorrect cell border and red cross-mark should be displayed for incorrect cells and the correct answer section should display the incorrect/not attempted options from the correct tab along with category cell numeration', () => {
|
@@ -57,7 +57,7 @@ const selectors = {
|
|
57
57
|
setCorrectAnswerSectionCategoryGrid: () => cy.get('[class*="DragAndDropMatrixstyles__TableWrapper"]'),
|
58
58
|
previewTabCategoryGrid: () => cy.get('.edit-question-preview-wrapper [class*="DragAndDropMatrixstyles__TableWrapper"]'),
|
59
59
|
//Additional settings
|
60
|
-
rowHeadingLabel: () => cy.get('[class*="
|
60
|
+
rowHeadingLabel: () => cy.get('[class*="RowResponseWrapper"] .text-label '),
|
61
61
|
rowHeadingInputField: () => cy.get('input[aria-label="Row heading"]'),
|
62
62
|
rowHeadingSetCorrectAnswerSection: () => cy.get('[class*="DragAndDropMatrixstyles__RowTitleCell"]'),
|
63
63
|
rowHeadingPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="DragAndDropMatrixstyles__RowTitleCell"]'),
|
@@ -786,7 +786,7 @@ const steps = {
|
|
786
786
|
.contains(optionName)
|
787
787
|
.click();
|
788
788
|
draggableOptionsContainer.setCorrectAnswerDraggableOptionsWrapper('drag and drop into categories')
|
789
|
-
.find('[class*="
|
789
|
+
.find('[class*="DroppableWrapper"]')
|
790
790
|
.click({ force: true });
|
791
791
|
},
|
792
792
|
|
@@ -802,7 +802,7 @@ const steps = {
|
|
802
802
|
.click();
|
803
803
|
});
|
804
804
|
draggableOptionsContainer.previewTabDraggableOptionsWrapper('drag and drop into categories')
|
805
|
-
.find('[class*="
|
805
|
+
.find('[class*="DroppableWrapper"]')
|
806
806
|
.click({ force: true });
|
807
807
|
},
|
808
808
|
|
@@ -1066,7 +1066,7 @@ const steps = {
|
|
1066
1066
|
*/
|
1067
1067
|
enterTextInRowTitleWidthInputField: (text) => {
|
1068
1068
|
dragAndDropIntoCategoriesPage.rowTitleWidthInputField()
|
1069
|
-
.type(text
|
1069
|
+
.type(text)
|
1070
1070
|
.blur();
|
1071
1071
|
},
|
1072
1072
|
|
@@ -1092,7 +1092,7 @@ const steps = {
|
|
1092
1092
|
*/
|
1093
1093
|
enterTextInRowMinHeightInputField: (text) => {
|
1094
1094
|
dragAndDropIntoCategoriesPage.rowMinHeightInputField()
|
1095
|
-
.type(text
|
1095
|
+
.type(text)
|
1096
1096
|
.blur();
|
1097
1097
|
},
|
1098
1098
|
|
@@ -1206,7 +1206,8 @@ const steps = {
|
|
1206
1206
|
|
1207
1207
|
clearMaxResponsePerCellInputField: () => {
|
1208
1208
|
dragAndDropIntoCategoriesPage.maxResponsePerCellInputField()
|
1209
|
-
.clear()
|
1209
|
+
.clear()
|
1210
|
+
.blur();
|
1210
1211
|
},
|
1211
1212
|
|
1212
1213
|
/**
|
@@ -1537,10 +1538,6 @@ const tests = {
|
|
1537
1538
|
});
|
1538
1539
|
},
|
1539
1540
|
|
1540
|
-
/**
|
1541
|
-
* @param {string[]} numerationArray array of the numeration displayed with options numbers| lowercase| uppercase
|
1542
|
-
* @description this function checks the numeration displayed for the options and correct answer container options when check answer is selected
|
1543
|
-
*/
|
1544
1541
|
verifyCategoryCellsNumerationNotDisplayedWhenCheckAnswerIsSelected: () => {
|
1545
1542
|
it('When user clicks on \'Check answer\' button then the numeration should not be displayed in the category cells', () => {
|
1546
1543
|
autoScoredPreviewBase.steps.checkAnswer()
|
@@ -13,8 +13,8 @@ const selectors = {
|
|
13
13
|
copyCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="copy-toggle-button"]`),
|
14
14
|
pasteCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="paste-toggle-button"]`),
|
15
15
|
specialCharacterCustomizeFormattingOption: () => cy.get(`[data-ngie-testid="special-characters-toggle-button"]`),
|
16
|
-
customizeFormattingOptionsLabel: () => cy.get('.
|
17
|
-
customizeFormattingOptionsIcon: () => cy.get('.
|
16
|
+
customizeFormattingOptionsLabel: () => cy.get('.ngie-toggle-button-label'),
|
17
|
+
customizeFormattingOptionsIcon: () => cy.get('.ngie-toggle-button-icon svg'),
|
18
18
|
customizeFormattingOptionsWrapper: () => cy.get('.customize-essay-formatting-options'),
|
19
19
|
};
|
20
20
|
|
@@ -12,8 +12,9 @@ const selectors = {
|
|
12
12
|
textToNotBeRenderedAsLaTextInputFieldWrapper: (inputfieldNumber) => cy.get('.text-not-to-be-rendered-input').eq(inputfieldNumber),
|
13
13
|
textToNotBeRenderedAsLaTextInputField: () => cy.get('[aria-label="Text to not be rendered as LaTex"]'),
|
14
14
|
textToNotBeRenderedAsLaTextInputFieldCount: () => cy.get('.start-adornment'),
|
15
|
-
addTextButton: () => cy.get('.text-not-latex-wrapper .
|
16
|
-
inputFieldLatexCharacter: () => cy.get('var[mathquill-command-id]')
|
15
|
+
addTextButton: () => cy.get('.text-not-latex-wrapper .ngie-icon-with-label-btn'),
|
16
|
+
inputFieldLatexCharacter: () => cy.get('var[mathquill-command-id]'),
|
17
|
+
deleteButton: () => cy.get('.icon-button-wrapper button')
|
17
18
|
}
|
18
19
|
|
19
20
|
const steps = {
|
@@ -351,7 +351,7 @@ const tests = {
|
|
351
351
|
cy.log('Adding a space and inserting more symbols in the response field.');
|
352
352
|
essayResponsePage.responseField()
|
353
353
|
.click()
|
354
|
-
.type('
|
354
|
+
.type(' ');
|
355
355
|
essayResponsePage.previewTabToolbarOption(`${specialOrMathCharacters[popupType].popupTitle}`)
|
356
356
|
.click();
|
357
357
|
essayResponsePage.specialAndMathCharacterPopupSymbols()
|
@@ -1,12 +1,15 @@
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
2
|
-
import { createQuestionBasePage, figOverImageCommonComponent, fillInTheGapsDropdownCommonComponent, commonComponents, uploadImageSectionComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredSetCorrectAnswerSection, scoringSectionBase, autoScoredScoringSectionMultipleResponsesType, autoScoredScoringSection, previewScoringAndShowCorrectAnswerComponent, additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, questionInstructionsComponent } from "./components"
|
2
|
+
import { createQuestionBasePage, figOverImageCommonComponent, fillInTheGapsDropdownCommonComponent, commonComponents, uploadImageSectionComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredSetCorrectAnswerSection, scoringSectionBase, autoScoredScoringSectionMultipleResponsesType, autoScoredScoringSection, previewScoringAndShowCorrectAnswerComponent, additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, questionInstructionsComponent, answerNumerationComponent } from "./components"
|
3
3
|
|
4
4
|
const selectors = {
|
5
5
|
...figOverImageCommonComponent,
|
6
6
|
...fillInTheGapsDropdownCommonComponent,
|
7
7
|
...questionInstructionsComponent,
|
8
|
+
...answerNumerationComponent,
|
9
|
+
...additionalSettingsPanel,
|
8
10
|
responseDropdownPreviewTab: () => cy.get('[class*="ImageWithDropdownPreviewstyles__DraggableInput"] [class*="icon-chevron"]'),
|
9
|
-
responseDropdownWrapperPreviewTab: () => cy.get('
|
11
|
+
responseDropdownWrapperPreviewTab: () => cy.get('.response-dropdown-wrapper'),
|
12
|
+
responseDropdownContainerWrapperPreviewTab: () => cy.get('[class*="ImageWithDropdownPreviewstyles__IconDiv"]'),
|
10
13
|
//Correct answer container
|
11
14
|
previewTabCorrectAnswerContainer: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
|
12
15
|
previewTabCorrectAnswerLabel: () => cy.get('.cloze-with-text-correct-answer-label'),
|
@@ -31,7 +34,7 @@ const steps = {
|
|
31
34
|
...autoScoredPreviewBase.steps,
|
32
35
|
...autoScoredScoringSection.steps,
|
33
36
|
...questionInstructionsComponent.steps,
|
34
|
-
|
37
|
+
...answerNumerationComponent.steps,
|
35
38
|
/**
|
36
39
|
* @param {number} responseContainerIndex Index of response container
|
37
40
|
* @param {number[]} responseContainerPositionCoordinates Position coordinates of the response container
|
@@ -128,7 +131,7 @@ const steps = {
|
|
128
131
|
* @description Verify that the incorrect option at the specified index has a cross-mark icon and is visible.
|
129
132
|
*/
|
130
133
|
verifyIncorrectOptionCrossmarkIcon: (index) => {
|
131
|
-
fillInTheGapsOverImageDropdownPage.
|
134
|
+
fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
|
132
135
|
.eq(index)
|
133
136
|
.find('.tick-icon-wrapper')
|
134
137
|
.should('have.class', 'icon-incorrect')
|
@@ -140,7 +143,7 @@ const steps = {
|
|
140
143
|
* @description Verify that the correct option at the specified index has a check-mark icon and is visible.
|
141
144
|
*/
|
142
145
|
verifyCorrectOptionCheckmarkIcon: (index) => {
|
143
|
-
fillInTheGapsOverImageDropdownPage.
|
146
|
+
fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
|
144
147
|
.eq(index)
|
145
148
|
.find('.tick-icon-wrapper')
|
146
149
|
.should('have.class', 'icon-correct')
|
@@ -152,7 +155,7 @@ const steps = {
|
|
152
155
|
* @description Verify that the option at the specified index does not have a check-mark or cross-mark.
|
153
156
|
*/
|
154
157
|
verifyCheckmarkOrCrossmarkNotVisible: (index) => {
|
155
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.
|
158
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab().eq(index).find('.tick-icon-wrapper'), 'notExist');
|
156
159
|
},
|
157
160
|
|
158
161
|
/**
|
@@ -194,7 +197,68 @@ const steps = {
|
|
194
197
|
let responseVerticalCoordinate = coordinatesArray[1].trim();
|
195
198
|
expect(responseVerticalCoordinate).to.be.eq(verticalCoordinate);
|
196
199
|
});
|
200
|
+
},
|
201
|
+
|
202
|
+
/**
|
203
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
204
|
+
* @description Verify placeholder for response dropdown in preview tab does not exist
|
205
|
+
*/
|
206
|
+
verifyPlaceholderAttributeInPreviewTabDropdownNotExists: (responseDropdownIndex) => {
|
207
|
+
fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
|
208
|
+
.eq(responseDropdownIndex)
|
209
|
+
.within(() => {
|
210
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), 'notExist');
|
211
|
+
});
|
212
|
+
},
|
213
|
+
|
214
|
+
/**
|
215
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
216
|
+
* @param {*} placeholderText Placeholder for dropdown
|
217
|
+
* @description Verify placeholder text displayed for response dropdown in preview tab
|
218
|
+
*/
|
219
|
+
verifyPlaceholderAttributeInPreviewTabDropdown: (responseDropdownIndex, placeholderText) => {
|
220
|
+
fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
|
221
|
+
.eq(responseDropdownIndex)
|
222
|
+
.within(() => {
|
223
|
+
utilities.verifyTextContent(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), placeholderText);
|
224
|
+
});
|
225
|
+
},
|
226
|
+
|
227
|
+
/**
|
228
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
229
|
+
* @param {number} height Height of response dropdown in preview tab
|
230
|
+
* @description Verify height of response dropdown in preview tab
|
231
|
+
*/
|
232
|
+
verifyDropdownHeightPreviewTab: (responseDropdownIndex, height) => {
|
233
|
+
fillInTheGapsOverImageDropdownPage.responseDropdownWrapperPreviewTab()
|
234
|
+
.eq(responseDropdownIndex)
|
235
|
+
.should('have.attr', 'height', `${height}px`);
|
236
|
+
},
|
237
|
+
|
238
|
+
/**
|
239
|
+
* @param {number} responseDropdownIndex Index of response dropdown
|
240
|
+
* @param {number} width Width of response dropdown in preview tab
|
241
|
+
* @description Verify width of response dropdown in preview tab
|
242
|
+
*/
|
243
|
+
verifyDropdownWidthPreviewTab: (responseDropdownIndex, width) => {
|
244
|
+
fillInTheGapsOverImageDropdownPage.responseDropdownWrapperPreviewTab()
|
245
|
+
.eq(responseDropdownIndex)
|
246
|
+
.should('have.attr', 'width', `${width}px`);
|
247
|
+
},
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Verify the numeration of response fields in the Preview Tab.
|
251
|
+
* @param {string[]} optionNumerationArray - An array of expected numeration strings to verify.
|
252
|
+
*/
|
253
|
+
verifyResponseDropdownNumeration: (optionNumerationArray) => {
|
254
|
+
fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
|
255
|
+
optionNumerationArray.forEach((optionNumeration, count) => {
|
256
|
+
fillInTheGapsOverImageDropdownPage.responseNumeration()
|
257
|
+
.eq(count)
|
258
|
+
.should('have.text', `${optionNumeration}`);
|
259
|
+
});
|
197
260
|
}
|
261
|
+
|
198
262
|
}
|
199
263
|
|
200
264
|
const tests = {
|
@@ -206,8 +270,11 @@ const tests = {
|
|
206
270
|
...autoScoredScoringSection.tests,
|
207
271
|
...commonComponents.tests,
|
208
272
|
...previewScoringAndShowCorrectAnswerComponent.tests,
|
273
|
+
...answerNumerationComponent.tests,
|
274
|
+
...additionalSettingsPanel.tests,
|
275
|
+
...autoScoredAdditionalSettings.tests,
|
209
276
|
...questionInstructionsComponent.tests,
|
210
|
-
|
277
|
+
...createQuestionBasePage.tests,
|
211
278
|
/**
|
212
279
|
* @param {number} minimumScoreIfAttemptedPoints - The minimum score awarded if attempted.
|
213
280
|
* @param {number} allocatedPoints - The expected allocated points for the question.
|
@@ -59,7 +59,7 @@ const steps = {
|
|
59
59
|
expandResponseAccordion: (responseIndex) => {
|
60
60
|
fillInTheGapsTextPage.responseAccordionWrapper()
|
61
61
|
.eq(responseIndex)
|
62
|
-
.find('
|
62
|
+
.find('[role="button"]')
|
63
63
|
.should('have.attr', 'aria-expanded', 'false')
|
64
64
|
.click()
|
65
65
|
.should('have.attr', 'aria-expanded', 'true');
|
@@ -37,13 +37,11 @@ const selectors = {
|
|
37
37
|
highlighImageCanvasWrapper: () => cy.get('.drawing-tool__wrapper .drawing-tool__canvas'),
|
38
38
|
highlighImageCanvas: () => cy.get('.drawing-tool__wrapper .upper-canvas'),
|
39
39
|
setCorrectAnswerSectionHighlight: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a'),
|
40
|
-
setCorrectAnswerSectionHighlightActivePattern: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPattern-"]'),
|
41
40
|
setCorrectAnswerSectionHighlightFillColor: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPatternWrapper"]'),
|
42
41
|
setCorrectAnswerSectionHighlightPolygon: () => cy.get('[class*="HighlightImageControlstyles__PolygonWrapper"]'),
|
43
42
|
highlightNumeration: () => cy.get('[class*="styles__TextWrapper"]'),
|
44
43
|
setCorrectAnswerSectionImage: () => cy.get('.highlight-svg-responseive image'),
|
45
44
|
previewTabHighlight: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a'),
|
46
|
-
previewTabHighlightActivePattern: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPattern-"]'),
|
47
45
|
previewTabHighlightFillColor: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPatternWrapper"]'),
|
48
46
|
previewTabHighlightPolygon: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__PolygonWrapper"]'),
|
49
47
|
multipleSelectionCheckboxLabel: () => cy.get('[data-ngie-testid="multiple-selection-checkbox"] .MuiFormControlLabel-label'),
|
@@ -486,14 +484,14 @@ const steps = {
|
|
486
484
|
|
487
485
|
clickOnUndoTool: () => {
|
488
486
|
highlightImagePage.undoTool()
|
489
|
-
.click()
|
490
|
-
|
487
|
+
.click();
|
488
|
+
steps.clickOnPenTool();
|
491
489
|
},
|
492
490
|
|
493
491
|
clickOnRedoTool: () => {
|
494
492
|
highlightImagePage.redoTool()
|
495
|
-
.click()
|
496
|
-
|
493
|
+
.click();
|
494
|
+
steps.clickOnPenTool();
|
497
495
|
},
|
498
496
|
|
499
497
|
clickOnClearAllTool: () => {
|
@@ -1150,8 +1148,9 @@ const steps = {
|
|
1150
1148
|
* @description this function verifies that active pattern is displayed on the highlight region in Set correct answer section
|
1151
1149
|
*/
|
1152
1150
|
verifyActivePatternIsDisplayedOnHighlightRegionInSetCorrectAnswerSection: (index) => {
|
1153
|
-
highlightImagePage.
|
1151
|
+
highlightImagePage.setCorrectAnswerSectionHighlight()
|
1154
1152
|
.eq(index)
|
1153
|
+
.find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
|
1155
1154
|
.should('exist');
|
1156
1155
|
},
|
1157
1156
|
|
@@ -1160,8 +1159,9 @@ const steps = {
|
|
1160
1159
|
* @description this function verifies that active pattern is displayed on the highlight region in Preview tab
|
1161
1160
|
*/
|
1162
1161
|
verifyActivePatternIsDisplayedOnHighlightRegionInPreviewTab: (index) => {
|
1163
|
-
highlightImagePage.
|
1162
|
+
highlightImagePage.previewTabHighlight()
|
1164
1163
|
.eq(index)
|
1164
|
+
.find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
|
1165
1165
|
.should('exist');
|
1166
1166
|
},
|
1167
1167
|
|
@@ -1170,8 +1170,9 @@ const steps = {
|
|
1170
1170
|
* @description this function verifies that active pattern is not displayed on the highlight region in Set correct answer section
|
1171
1171
|
*/
|
1172
1172
|
verifyActivePatternIsNotDisplayedOnHighlightRegionInSetCorrectAnswerSection: (index) => {
|
1173
|
-
highlightImagePage.
|
1173
|
+
highlightImagePage.setCorrectAnswerSectionHighlight()
|
1174
1174
|
.eq(index)
|
1175
|
+
.find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
|
1175
1176
|
.should('not.exist');
|
1176
1177
|
},
|
1177
1178
|
|
@@ -1180,8 +1181,9 @@ const steps = {
|
|
1180
1181
|
* @description this function verifies that active pattern is not displayed on the highlight region in Preview Tab
|
1181
1182
|
*/
|
1182
1183
|
verifyActivePatternIsNotDisplayedOnHighlightRegionInPreviewTab: (index) => {
|
1183
|
-
highlightImagePage.
|
1184
|
+
highlightImagePage.previewTabHighlight()
|
1184
1185
|
.eq(index)
|
1186
|
+
.find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
|
1185
1187
|
.should('not.exist');
|
1186
1188
|
}
|
1187
1189
|
}
|