itemengine-cypress-automation 1.0.119 → 1.0.121
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
- package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
- package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
- package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
- package/cypress/e2e/migration/migration.js +6 -5
- package/cypress/e2e/migration/migration2.js +4 -3
- package/cypress/e2e/migration/migration3.js +4 -3
- package/cypress/e2e/migration/migration4.js +4 -3
- package/cypress/e2e/migration/migration5.js +4 -3
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/audioResponsePage.js +2 -1
- package/cypress/pages/components/additionalSettingsPanel.js +27 -0
- package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
- package/cypress/pages/components/autoScoredScoringSection.js +1 -1
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
- package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
- package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
- package/cypress/pages/components/index.js +3 -3
- package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +49 -23
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/createItemPage.js +67 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
- package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
- package/cypress/pages/fillInTheGapsTextPage.js +52 -199
- package/cypress/pages/index.js +5 -5
- package/cypress/pages/multipleSelectionPage.js +1 -0
- package/cypress/pages/shortTextResponsePage.js +575 -33
- package/cypress/pages/singleSelectionGridPage.js +1 -2
- package/cypress/pages/singleSelectionPage.js +5 -6
- package/cypress/pages/textEntryMathPage.js +46 -22
- package/cypress/pages/textEntryMathWithImagePage.js +212 -0
- package/cypress/pages/uploadResponsePage.js +74 -21
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +73 -2
- package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +49 -2
- package/package.json +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
- package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
- package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
- package/cypress/pages/fillInTheGapsScoring.js +0 -5872
- package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -1,878 +1,606 @@
|
|
1
1
|
import utilities from "../../support/helpers/utilities";
|
2
|
-
import { additionalSettingsPanel } from "./additionalSettingsPanel";
|
3
|
-
import { autoScoredAdditionalSettings } from "./autoScoredAdditionalSettings";
|
4
|
-
import { autoScoredScoringSectionMultipleResponsesType } from "./autoScoredScoringSectionMultipleResponsesType";
|
5
|
-
import { autoScoredSetCorrectAnswerSection } from "./autoScoredSetCorrectAnswerSection";
|
6
2
|
import { commonComponents } from "./commonComponents";
|
7
|
-
import {
|
8
|
-
import { scoringSectionBase } from "./scoringSectionBase";
|
9
|
-
import { specialAndCustomSpecialCharactersComponent } from "./specialAndCustomSpecialCharactersComponent";
|
3
|
+
import { createQuestionBasePage } from "./createQuestionBasePage";
|
10
4
|
const css = Cypress.env('css');
|
11
5
|
|
12
6
|
const selectors = {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
7
|
+
answerInputFieldSpecifyCorrectAnswerSection: () => cy.get('.label-image-text-inline-text-field input'),
|
8
|
+
answerInputFieldPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-input-field input'),
|
9
|
+
responseAreaNumeration: () => cy.get('.response-input-adornment'),
|
10
|
+
correctAnswerSectionWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
|
11
|
+
correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="correct-answer-label"]'),
|
12
|
+
responseStatusWrapper: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper:visible'),
|
13
|
+
correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
|
14
|
+
correctAnswerResponseWrapper: () => cy.get('[class*="ClozeWithTextResponsestyles__AnswerCell"]'),
|
15
|
+
correctAnswerResponse: () => cy.get('[class*="AnswerWrapperForLabel"]'),
|
16
|
+
|
17
|
+
setLimitLabel: () => cy.get('[class*="SetLimitWrapper"] .text-label'),
|
18
|
+
minimumCharacterLimitLabel: () => cy.get('.label-image-min-max-container .additional-settings-label').eq(0),
|
19
|
+
maximumCharacterLimitLabel: () => cy.get('.label-image-min-max-container .additional-settings-label').eq(1),
|
20
|
+
minMaxLabelAndInputFieldWrapper: () => cy.get('.label-image-min-max-container'),
|
21
|
+
minimumCharacterLimitInputField: () => cy.get('.label-image-min-max-container input').eq(0),
|
22
|
+
maximumCharacterLimitInputField: () => cy.get('.label-image-min-max-container input').eq(1),
|
23
|
+
characterRadioButton: () => cy.get('input[aria-label="Character"]'),
|
24
|
+
characterLabel: () => cy.get('[aria-label="Character"].ngie-radio-label'),
|
25
|
+
noneRadioButton: () => cy.get('input[aria-label="None"]'),
|
26
|
+
noneLabel: () => cy.get('[aria-label="None"].ngie-radio-label'),
|
27
|
+
limitReachedWarningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
28
|
+
limitReachedWarningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
29
|
+
|
30
|
+
//response accordion
|
31
|
+
responseAccordion: () => cy.get('.response-text-accordion'),
|
32
|
+
responseAccordionLabel: () => cy.get('[class*="ResponseComponentstyles__Label"]'),
|
33
|
+
responseAccordionAnswersLabel: () => cy.get('.correct-response-answer-wrapper-cls .points-label'),
|
34
|
+
responseAccordionAnswerInputFieldWrapper: () => cy.get('.label-image-text-answer-label'),
|
35
|
+
responseAccordionAnswerNumeration: () => cy.get('.additional-option-placeholder-input .start-adornment'),
|
36
|
+
responseAccordionAnswerDeleteButton: () => cy.get('.delete-button'),
|
37
|
+
responseAccordionPointsWrapper: () => cy.get('[class*="ResponseComponentstyles__PointsDiv"]'),
|
38
|
+
responseAccordionPointsLabel: () => cy.get('[class*="ResponseComponentstyles__PointsLabel"]'),
|
39
|
+
responseAccordionPointsScore: () => cy.get('[class*="ResponseComponentstyles__Points-"]'),
|
40
|
+
responseAccordionPointsInputFieldWrapper: () => cy.get('[class*="ResponseComponentstyles__PointsWrapper"]'),
|
41
|
+
responseAccordionAddAlternateButton: () => cy.get('.add-alternate-btn'),
|
42
|
+
responseAccordionAddAlternateButtonLabel: () => cy.get('.add-alternate-btn p'),
|
43
|
+
responseAreaNumeration: () => cy.get('.response-input-adornment'),
|
44
|
+
|
45
|
+
//additional settings
|
46
|
+
enterAriaLabelInputField: () => cy.get('input[aria-label*="Enter ARIA label"]')
|
47
47
|
}
|
48
48
|
|
49
49
|
const steps = {
|
50
50
|
/**
|
51
|
-
*
|
52
|
-
* @param {
|
53
|
-
* @param {
|
54
|
-
* @
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
51
|
+
* Enter text in the answer input fields of the specify correct answer section.
|
52
|
+
* @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
|
53
|
+
* @param {number} responses[].responseIndex - The index of the answer input field for each response.
|
54
|
+
* @param {string} responses[].responseText - The text to be entered in the respective answer input field.
|
55
|
+
* @example - enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([
|
56
|
+
* { responseIndex: 0, responseText: "Answer 1" },
|
57
|
+
* { responseIndex: 1, responseText: "Answer 2" },
|
58
|
+
* ]);
|
59
|
+
*/
|
60
|
+
enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection: (responses) => {
|
61
|
+
responses.forEach(({ responseIndex, responseText }) => {
|
62
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldSpecifyCorrectAnswerSection(), responseIndex)
|
63
|
+
.clear()
|
64
|
+
.type(responseText)
|
65
|
+
.blur();
|
66
|
+
});
|
62
67
|
},
|
63
68
|
|
64
69
|
/**
|
65
|
-
*
|
66
|
-
* @param {
|
70
|
+
* Verify text in the answer input fields of the preview tab.
|
71
|
+
* @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
|
72
|
+
* @param {number} responses[].responseIndex - The index of the answer input field for each response.
|
73
|
+
* @param {string} responses[].responseText - The text to be verified in the respective answer input field.
|
67
74
|
*/
|
68
|
-
|
69
|
-
|
70
|
-
.
|
71
|
-
|
75
|
+
verifyTextInAnswerInputFieldsPreviewTab: (responses) => {
|
76
|
+
responses.forEach(({ responseIndex, responseText }) => {
|
77
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
78
|
+
.should('have.value', responseText)
|
79
|
+
});
|
72
80
|
},
|
73
81
|
|
74
82
|
/**
|
75
|
-
*
|
76
|
-
* @param {
|
83
|
+
* Enter text in the answer input fields of the preview tab.
|
84
|
+
* @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
|
85
|
+
* @param {number} responses[].responseIndex - The index of the answer input field for each response.
|
86
|
+
* @param {string} responses[].responseText - The text to be entered in the respective answer input field.
|
77
87
|
*/
|
78
|
-
|
79
|
-
|
80
|
-
.
|
81
|
-
|
88
|
+
enterTextInAnswerInputFieldsPreviewTab: (responses) => {
|
89
|
+
responses.forEach(({ responseIndex, responseText }) => {
|
90
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
91
|
+
.clear()
|
92
|
+
.type(responseText)
|
93
|
+
.blur();
|
94
|
+
});
|
82
95
|
},
|
83
96
|
|
84
97
|
/**
|
85
|
-
*
|
86
|
-
* @param {number}
|
87
|
-
* @param {string} value - The expected text value to compare against.
|
88
|
-
* @returns {void}
|
98
|
+
* Verify that a specific answer input field is disabled on the preview tab.
|
99
|
+
* @param {number} inputFieldIndex - The index of the disabled answer input field.
|
89
100
|
*/
|
90
|
-
|
91
|
-
fillInTheGapsTextCommonComponent.
|
92
|
-
.eq(index)
|
93
|
-
.should('have.attr', 'value', value);
|
101
|
+
verifyAnswerInputFieldDisabled: (inputFieldIndex) => {
|
102
|
+
utilities.verifyElementDisabled(utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), inputFieldIndex));
|
94
103
|
},
|
95
104
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
.clear()
|
106
|
-
.type(text)
|
107
|
-
.blur();
|
105
|
+
verifyResponseAreaNumeration: () => {
|
106
|
+
fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab()
|
107
|
+
.each(($element, index) => {
|
108
|
+
cy.wrap($element)
|
109
|
+
.parents('.cloze-with-text-response-field-wrapper')
|
110
|
+
.within(() => {
|
111
|
+
utilities.verifyTextContent(fillInTheGapsTextCommonComponent.responseAreaNumeration(), `${index + 1}`);
|
112
|
+
});
|
113
|
+
});
|
108
114
|
},
|
109
115
|
|
110
116
|
/**
|
111
|
-
*
|
112
|
-
* @param {
|
113
|
-
* @
|
114
|
-
* @returns {void}
|
117
|
+
* Verify correct answer responses in the correct answer section and count.
|
118
|
+
* @param {string[]} correctAnswerArray - An array containing the expected correct answer responses.
|
119
|
+
* @example verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Petals', 'Stem']);
|
115
120
|
*/
|
116
|
-
|
117
|
-
fillInTheGapsTextCommonComponent.
|
118
|
-
|
119
|
-
.
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
},
|
128
|
-
|
129
|
-
verifyCaseSensitiveCheckboxNotChecked: () => {
|
130
|
-
fillInTheGapsTextCommonComponent.caseSensitiveCheckbox()
|
131
|
-
.should('not.be.checked');
|
121
|
+
verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
|
122
|
+
utilities.verifyElementCount(fillInTheGapsTextCommonComponent.correctAnswerResponseWrapper(), correctAnswerArray.length);
|
123
|
+
correctAnswerArray.forEach((correctAnswer, index) => {
|
124
|
+
fillInTheGapsTextCommonComponent.correctAnswerResponseWrapper()
|
125
|
+
.eq(index)
|
126
|
+
.within(() => {
|
127
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
|
128
|
+
fillInTheGapsTextCommonComponent.correctAnswerResponse()
|
129
|
+
.should('have.text', correctAnswer);
|
130
|
+
});
|
131
|
+
});
|
132
132
|
},
|
133
133
|
|
134
|
-
|
135
|
-
fillInTheGapsTextCommonComponent.
|
136
|
-
.should('be.checked')
|
134
|
+
verifyCorrectAnswerSectionNotExists: () => {
|
135
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.correctAnswerSectionWrapper(), 'notExist');
|
137
136
|
},
|
138
137
|
|
139
|
-
|
140
|
-
fillInTheGapsTextCommonComponent.
|
138
|
+
verifyCharacterRadioButtonSelected: () => {
|
139
|
+
fillInTheGapsTextCommonComponent.characterRadioButton()
|
141
140
|
.should('be.checked');
|
142
141
|
},
|
143
142
|
|
144
|
-
|
145
|
-
fillInTheGapsTextCommonComponent.
|
143
|
+
verifyNoneRadioButtonNotSelected: () => {
|
144
|
+
fillInTheGapsTextCommonComponent.noneRadioButton()
|
146
145
|
.should('not.be.checked');
|
147
146
|
},
|
148
147
|
|
149
|
-
|
150
|
-
fillInTheGapsTextCommonComponent.
|
151
|
-
.should('have.class', 'Mui-disabled');
|
152
|
-
fillInTheGapsTextCommonComponent.matchFromAllResponsesCheckbox()
|
153
|
-
.and('be.disabled');
|
154
|
-
},
|
155
|
-
|
156
|
-
//Note: Need to move this in figOverImageCommonComponent file along with the selectors once the checkbox enhancement build is uploaded
|
157
|
-
checkMatchFromAllResponsesCheckbox: () => {
|
158
|
-
fillInTheGapsTextCommonComponent.matchFromAllResponsesCheckbox()
|
148
|
+
selectCharacterRadioButton: () => {
|
149
|
+
fillInTheGapsTextCommonComponent.characterRadioButton()
|
159
150
|
.click()
|
160
151
|
.should('be.checked');
|
161
152
|
},
|
162
153
|
|
163
|
-
|
164
|
-
|
165
|
-
* @param {number[]} optionNumerationArray numeration of the correct answer response
|
166
|
-
* @description verify the correct answer responses in the correct answer container
|
167
|
-
*/
|
168
|
-
verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount: (correctAnswerArray, optionNumerationArray) => {
|
169
|
-
fillInTheGapsTextCommonComponent.previewTabCorrectAnswerContainer()
|
170
|
-
.should('be.visible')
|
171
|
-
.within(() => {
|
172
|
-
correctAnswerArray.forEach((responseFieldText, count) => {
|
173
|
-
fillInTheGapsTextCommonComponent.previewTabCorrectAnswerResponseWrapper()
|
174
|
-
.eq(count)
|
175
|
-
.should('have.value', responseFieldText);
|
176
|
-
});
|
177
|
-
optionNumerationArray.forEach((optionNumeration, count) => {
|
178
|
-
fillInTheGapsTextCommonComponent.responseNumeration()
|
179
|
-
.eq(count)
|
180
|
-
.should('have.text', `${optionNumeration}`);
|
181
|
-
});
|
182
|
-
});
|
183
|
-
fillInTheGapsTextCommonComponent.previewTabCorrectAnswerResponseWrapper()
|
184
|
-
.should('have.length', optionNumerationArray.length);
|
185
|
-
},
|
186
|
-
|
187
|
-
/**
|
188
|
-
* Verify that the incorrect option at the specified index has a cross-mark icon and is visible.
|
189
|
-
* @param {number} index - The index of the incorrect option to verify.
|
190
|
-
*/
|
191
|
-
verifyIncorrectOptionCrossmarkIcon: (index) => {
|
192
|
-
fillInTheGapsTextCommonComponent.previewTabResponseWrapper()
|
193
|
-
.eq(index)
|
194
|
-
.find('.tick-icon-wrapper')
|
195
|
-
.should('have.class', 'icon-incorrect')
|
196
|
-
.and('be.visible');
|
197
|
-
},
|
198
|
-
|
199
|
-
/**
|
200
|
-
* Verify that the correct option at the specified index has a check-mark icon and is visible.
|
201
|
-
* @param {number} index - The index of the correct option to verify.
|
202
|
-
*/
|
203
|
-
verifyCorrectOptionCheckmarkIcon: (index) => {
|
204
|
-
fillInTheGapsTextCommonComponent.previewTabResponseWrapper()
|
205
|
-
.eq(index)
|
206
|
-
.find('.tick-icon-wrapper')
|
207
|
-
.should('have.class', 'icon-correct')
|
208
|
-
.and('be.visible');
|
209
|
-
},
|
210
|
-
|
211
|
-
verifyPreviewTabCorrectAnswerContainerNotExist: () => {
|
212
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.previewTabCorrectAnswerContainer(), 'notExist');
|
213
|
-
},
|
214
|
-
|
215
|
-
checkCaseSensitiveCheckbox: () => {
|
216
|
-
fillInTheGapsTextCommonComponent.caseSensitiveCheckbox()
|
154
|
+
selectNoneRadioButton: () => {
|
155
|
+
fillInTheGapsTextCommonComponent.noneRadioButton()
|
217
156
|
.click()
|
218
|
-
.should('be.checked');
|
219
|
-
},
|
220
|
-
|
221
|
-
uncheckIgnoreSpacesBeforeAndAfterCheckbox: () => {
|
222
|
-
fillInTheGapsTextCommonComponent.ignoreSpacesBeforeAndAfterCheckbox()
|
223
|
-
.click()
|
224
|
-
.should('not.be.checked');
|
225
|
-
},
|
226
|
-
|
227
|
-
uncheckMatchFromAllResponsesCheckbox: () => {
|
228
|
-
fillInTheGapsTextCommonComponent.matchFromAllResponsesCheckbox()
|
229
|
-
.click()
|
230
|
-
.should('not.be.checked')
|
231
|
-
},
|
232
|
-
|
233
|
-
/**
|
234
|
-
* @param {number} index - The index of the option to verify.
|
235
|
-
* @description Verify that the option at the specified index does not have a check-mark or cross-mark.
|
236
|
-
*/
|
237
|
-
verifyCheckmarkOrCrossmarkNotVisible: (index) => {
|
238
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.previewTabResponseWrapper().eq(index).find('.tick-icon-wrapper'), 'notExist');
|
239
157
|
},
|
240
158
|
|
241
159
|
/**
|
242
|
-
*
|
243
|
-
* @
|
160
|
+
* @param {number} minLimit value of minimum input field
|
161
|
+
* @description this function verifies the value in minimum limit input field
|
244
162
|
*/
|
245
|
-
|
246
|
-
fillInTheGapsTextCommonComponent.
|
247
|
-
.should('have.value',
|
163
|
+
verifyMinimumCharacterLimitInputField: (minLimit) => {
|
164
|
+
fillInTheGapsTextCommonComponent.minimumCharacterLimitInputField()
|
165
|
+
.should('have.value', minLimit);
|
248
166
|
},
|
249
167
|
|
250
168
|
/**
|
251
|
-
*
|
252
|
-
* @
|
169
|
+
* @param {number} maxLimit value of maximum input field
|
170
|
+
* @description this function verifies the value in maximum limit input field
|
253
171
|
*/
|
254
|
-
|
255
|
-
fillInTheGapsTextCommonComponent.
|
256
|
-
.
|
257
|
-
.should('not.have.attr', 'placeholder');
|
172
|
+
verifyMaximumCharacterLimitInputField: (maxLimit) => {
|
173
|
+
fillInTheGapsTextCommonComponent.maximumCharacterLimitInputField()
|
174
|
+
.should('have.value', maxLimit);
|
258
175
|
},
|
259
176
|
|
260
177
|
/**
|
261
|
-
*
|
262
|
-
* @
|
178
|
+
* @param {number} maxLimit value to be entered in maximum limit input field
|
179
|
+
* @description this function enters the value in maximum limit input field
|
263
180
|
*/
|
264
|
-
|
265
|
-
fillInTheGapsTextCommonComponent.
|
266
|
-
.
|
267
|
-
.
|
268
|
-
|
269
|
-
|
270
|
-
/**
|
271
|
-
* Verify the placeholder attribute in a response field in the Correct Answer section.
|
272
|
-
* @param {number} responseFieldIndex - The index of the response field to verify.
|
273
|
-
* @param {string} placeholderText - The expected placeholder text to match the attribute.
|
274
|
-
*/
|
275
|
-
verifyPlaceholderAttributeInSetCorrectAnswerSectionResponseField: (responseFieldIndex, placeholderText) => {
|
276
|
-
fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection()
|
277
|
-
.eq(responseFieldIndex)
|
278
|
-
.should('have.attr', 'placeholder', placeholderText);
|
279
|
-
},
|
280
|
-
|
281
|
-
/**
|
282
|
-
* Verify the placeholder attribute in a response field in the Preview Tab.
|
283
|
-
* @param {number} responseFieldIndex - The index of the response field to verify.
|
284
|
-
* @param {string} placeholderText - The expected placeholder text to match the attribute.
|
285
|
-
*/
|
286
|
-
verifyPlaceholderAttributeInPreviewTabResponseField: (responseFieldIndex, placeholderText) => {
|
287
|
-
fillInTheGapsTextCommonComponent.responseFieldPreviewTab()
|
288
|
-
.eq(responseFieldIndex)
|
289
|
-
.should('have.attr', 'placeholder', placeholderText);
|
181
|
+
setMaximumLimit: (maxLimit) => {
|
182
|
+
fillInTheGapsTextCommonComponent.maximumCharacterLimitInputField()
|
183
|
+
.clear()
|
184
|
+
.type(maxLimit)
|
185
|
+
.blur();
|
290
186
|
},
|
291
187
|
|
292
188
|
/**
|
293
|
-
* @param {
|
294
|
-
* @
|
295
|
-
* @description Verify Aria-label of response field in set correct answer section
|
296
|
-
* @param {number} index of response field in preview tab
|
297
|
-
* @description this function focuses in the preview atb response field
|
189
|
+
* @param {number} maxLimit value to be entered in maximum limit input field
|
190
|
+
* @description this function verifies the value in maximum limit input field
|
298
191
|
*/
|
299
|
-
|
300
|
-
fillInTheGapsTextCommonComponent.
|
301
|
-
.
|
302
|
-
.click();
|
303
|
-
},
|
304
|
-
|
305
|
-
/**
|
306
|
-
* @param {index} responseIndex Index of response
|
307
|
-
* @param {string} ariaLabel Aria-label of response
|
308
|
-
* @description Verify aria-label of response in set correct answer section
|
309
|
-
*/
|
310
|
-
verifyResponseFieldAriaLabelAttributeInSetCorrectAnswerSection: (responseIndex, ariaLabel) => {
|
311
|
-
fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection()
|
312
|
-
.eq(responseIndex)
|
313
|
-
.should('have.attr', 'aria-label', ariaLabel);
|
314
|
-
},
|
315
|
-
|
316
|
-
/**
|
317
|
-
* @param {index} responseIndex Index of response field
|
318
|
-
* @param {string} ariaLabel Aria-label of response field
|
319
|
-
* @description Verify Aria-label of response field in preview tab
|
320
|
-
*/
|
321
|
-
verifyResponseFieldAriaLabelAttributeInPreviewTab: (responseIndex, ariaLabel) => {
|
322
|
-
fillInTheGapsTextCommonComponent.responseFieldPreviewTab()
|
323
|
-
.eq(responseIndex)
|
324
|
-
.should('have.attr', 'aria-label', ariaLabel);
|
325
|
-
},
|
192
|
+
verifyMaximumLimit: (maxLimit) => {
|
193
|
+
fillInTheGapsTextCommonComponent.maximumCharacterLimitInputField()
|
194
|
+
.should('have.value', maxLimit);
|
326
195
|
|
327
|
-
/**
|
328
|
-
* @param {number} responseIndex Index of response field
|
329
|
-
* @description Verify response is displayed in set correct answer section
|
330
|
-
*/
|
331
|
-
verifyResponseFieldIsDisplayedInSetCorrectAnswerSection: (responseIndex) => {
|
332
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection().eq(responseIndex), 'visible');
|
333
196
|
},
|
334
197
|
|
335
198
|
/**
|
336
|
-
* @param {
|
337
|
-
* @description
|
199
|
+
* @param {number} minLimit value to be entered in minimum limit input field
|
200
|
+
* @description this function enters and verifies the value in minimum limit input field
|
338
201
|
*/
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
});
|
345
|
-
},
|
346
|
-
|
347
|
-
clickOnTypeOfAnswerDropdown: () => {
|
348
|
-
fillInTheGapsTextCommonComponent.typeOfAnswerInputDropdown()
|
349
|
-
.eq(0)
|
350
|
-
.click();
|
202
|
+
setMinimumLimit: (minLimit) => {
|
203
|
+
fillInTheGapsTextCommonComponent.minimumCharacterLimitInputField()
|
204
|
+
.clear()
|
205
|
+
.type(minLimit)
|
206
|
+
.blur();
|
351
207
|
},
|
352
208
|
|
353
209
|
/**
|
354
|
-
*
|
355
|
-
* @
|
210
|
+
* @param {number} minLimit value to be entered in minimum limit input field
|
211
|
+
* @description this function verifies the value in minimum limit input field
|
356
212
|
*/
|
357
|
-
|
358
|
-
fillInTheGapsTextCommonComponent.
|
359
|
-
.
|
213
|
+
verifyMinimumLimit: (minLimit) => {
|
214
|
+
fillInTheGapsTextCommonComponent.minimumCharacterLimitInputField()
|
215
|
+
.should('have.value', minLimit)
|
360
216
|
},
|
361
217
|
|
362
|
-
|
363
|
-
fillInTheGapsTextCommonComponent.
|
218
|
+
clearAndFocusOutOfMaximumCharacterLimitInputField: () => {
|
219
|
+
fillInTheGapsTextCommonComponent.maximumCharacterLimitInputField()
|
364
220
|
.clear()
|
365
|
-
.type(value)
|
366
221
|
.blur();
|
367
222
|
},
|
368
223
|
|
369
|
-
|
370
|
-
fillInTheGapsTextCommonComponent.
|
371
|
-
.should('not.have.value', '0')
|
372
|
-
.and('have.value', '1');
|
373
|
-
},
|
374
|
-
|
375
|
-
clearSetCharacterLimitInputField: () => {
|
376
|
-
fillInTheGapsTextCommonComponent.setCharacterLimitInputField()
|
224
|
+
clearAndFocusOutOfMinimumCharacterLimitInputField: () => {
|
225
|
+
fillInTheGapsTextCommonComponent.minimumCharacterLimitInputField()
|
377
226
|
.clear()
|
378
227
|
.blur();
|
379
228
|
},
|
380
229
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
.should('have.attr', 'height', height);
|
230
|
+
verifyMaximumLimitErrorMessage: () => {
|
231
|
+
utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), 1), 'Error: Maximum limit must be greater than or equal to Minimum limit.');
|
232
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(commonComponents.errorMessage(), 1), 'visible');
|
233
|
+
},
|
234
|
+
|
235
|
+
verifyMinimumLimitErrorMessage: () => {
|
236
|
+
utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), 0), 'Error: Minimum limit must be less than or equal to Maximum limit.');
|
237
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(commonComponents.errorMessage(), 0), 'visible');
|
390
238
|
},
|
391
239
|
|
392
240
|
/**
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
fillInTheGapsTextCommonComponent.
|
399
|
-
.
|
400
|
-
.should('have.attr', 'width', width);
|
241
|
+
* @param {number} responseIndex index of response container
|
242
|
+
* @param {number} maxlen value of maxlength attribute
|
243
|
+
* @description function verifies maxlength attribute of response container in preview tab
|
244
|
+
*/
|
245
|
+
verifyMaximumCharacterLimitInPreviewTab: (responseIndex, maxlen) => {
|
246
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
247
|
+
.should('have.attr', 'maxlength', maxlen);
|
401
248
|
},
|
402
249
|
|
403
250
|
/**
|
404
|
-
*
|
405
|
-
* @param {number}
|
406
|
-
* @
|
251
|
+
* @param {number} responseIndex index of input field in specify correct answer
|
252
|
+
* @param {number} maxlen value of maxlength attribute
|
253
|
+
* @description function verifies maxlength attribute of input field in specify correct answer
|
407
254
|
*/
|
408
|
-
|
409
|
-
fillInTheGapsTextCommonComponent.
|
410
|
-
.
|
411
|
-
.should('have.attr', 'height', height);
|
255
|
+
verifyMaximumCharacterLimit: (responseIndex, maxlen) => {
|
256
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldSpecifyCorrectAnswerSection(), responseIndex)
|
257
|
+
.should('have.attr', 'maxlength', maxlen);
|
412
258
|
},
|
413
259
|
|
414
260
|
/**
|
415
|
-
*
|
416
|
-
* @
|
417
|
-
* @param {string} width - The expected width value to match the attribute.
|
261
|
+
* @param {number} responseIndex index of response container in preview tab
|
262
|
+
* @description function verifies maxlength attribute of input field in preview tab
|
418
263
|
*/
|
419
|
-
|
420
|
-
fillInTheGapsTextCommonComponent.
|
421
|
-
.
|
422
|
-
.should('have.attr', 'width', width);
|
264
|
+
verifyMaximumCharacterLimitNotExistInPreviewTab: (responseIndex) => {
|
265
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
266
|
+
.should('not.have.attr', 'maxlength');
|
423
267
|
},
|
424
268
|
|
425
|
-
|
426
|
-
|
427
|
-
.within(() => {
|
428
|
-
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.typeOfAnswerInputLabel(), 'Type of answer input');
|
429
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.typeOfAnswerInputLabel(), 'visible');
|
430
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.typeOfAnswerInputDropdown(), 'visible');
|
431
|
-
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.typeOfAnswerInputDropdown(), 'Text');
|
432
|
-
});
|
269
|
+
verifyLimitReachedWarningMessageNotExist: () => {
|
270
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.limitReachedWarningMessage(), 'notExist');
|
433
271
|
},
|
434
272
|
|
435
273
|
/**
|
436
|
-
*
|
437
|
-
* @param {
|
274
|
+
* @description this function verifies warning text for limit reached
|
275
|
+
* @param {string} warningText warning message displayed
|
438
276
|
*/
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
.within(() => {
|
443
|
-
fillInTheGapsTextCommonComponent.typeOfAnswerInputDropdown()
|
444
|
-
.click();
|
445
|
-
});
|
277
|
+
verifyLimitReachedWarningMessageExist: (warningText) => {
|
278
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.limitReachedWarningMessage(), 'visible');
|
279
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.limitReachedWarningMessage(), warningText);
|
446
280
|
},
|
447
281
|
|
448
282
|
/**
|
449
|
-
|
450
|
-
* @param {
|
451
|
-
* @param {
|
283
|
+
*@description Verify text in the answer input fields of the specify correct answer section.
|
284
|
+
* @param {Object[]} responses - An array of objects containing the responseIndex and responseText.
|
285
|
+
* @param {number} responses[].responseIndex - The index of the answer input field for each response.
|
286
|
+
* @param {string} responses[].responseText - The text to be verified for the respective answer input field.
|
452
287
|
*/
|
453
|
-
|
454
|
-
|
455
|
-
.
|
456
|
-
|
457
|
-
|
458
|
-
});
|
288
|
+
verifyTextInResponseAccordionAnswerInputField: (responses) => {
|
289
|
+
responses.forEach(({ responseIndex, responseText }) => {
|
290
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldSpecifyCorrectAnswerSection(), responseIndex)
|
291
|
+
.should('have.value', responseText);
|
292
|
+
});
|
459
293
|
},
|
460
294
|
|
461
|
-
|
462
|
-
|
463
|
-
|
295
|
+
//Used in setLimitSection.js only.
|
296
|
+
/**
|
297
|
+
* @param {number} responseIndex index number of text container
|
298
|
+
* @param {string} responseText text to be added in text container
|
299
|
+
* @description function enters text in the answer input fields of the preview tab
|
300
|
+
*/
|
301
|
+
addTextInAnswerInputFieldsPreviewTab: (responseIndex, responseText) => {
|
302
|
+
utilities.getNthElement(fillInTheGapsTextCommonComponent.answerInputFieldPreviewTab(), responseIndex)
|
303
|
+
.type(responseText);
|
464
304
|
},
|
305
|
+
}
|
465
306
|
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
cy.wrap($el)
|
473
|
-
.find('textarea')
|
474
|
-
.should('not.exist');
|
475
|
-
});
|
476
|
-
},
|
307
|
+
const tests = {
|
308
|
+
verifySetLimitSectionContents: () => {
|
309
|
+
it('\'Set limit\' label should be displayed', () => {
|
310
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.setLimitLabel(), 'Set limit');
|
311
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.setLimitLabel(), 'visible');
|
312
|
+
});
|
477
313
|
|
478
|
-
|
479
|
-
|
480
|
-
.
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
.should('not.exist');
|
487
|
-
});
|
488
|
-
},
|
314
|
+
it('\'Character\' and \'None\' labels and radio buttons should be displayed and by default \'Character\' should be selected', () => {
|
315
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.characterLabel(), 'Character');
|
316
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.characterLabel(), 'visible');
|
317
|
+
fillInTheGapsTextCommonComponent.steps.verifyCharacterRadioButtonSelected();
|
318
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.noneLabel(), 'None');
|
319
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.noneLabel(), 'visible');
|
320
|
+
fillInTheGapsTextCommonComponent.steps.verifyNoneRadioButtonNotSelected();
|
321
|
+
});
|
489
322
|
|
490
|
-
|
491
|
-
|
492
|
-
.
|
493
|
-
.
|
494
|
-
|
323
|
+
it('\'Minimum character limit\' and \'Maximum character limit\' labels should be displayed', () => {
|
324
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.minimumCharacterLimitLabel(), 'Minimum character limit');
|
325
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.minimumCharacterLimitLabel(), 'visible');
|
326
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.maximumCharacterLimitLabel(), 'Maximum character limit');
|
327
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.maximumCharacterLimitLabel(), 'visible');
|
328
|
+
});
|
495
329
|
|
496
|
-
|
497
|
-
|
498
|
-
.
|
499
|
-
.
|
500
|
-
|
330
|
+
it('\'Minimum character limit\' and \'Maximum character limit\' input fields should be displayed and have 0 and 50 value by default', () => {
|
331
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.minimumCharacterLimitInputField(), 'visible');
|
332
|
+
fillInTheGapsTextCommonComponent.steps.verifyMinimumCharacterLimitInputField(0);
|
333
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.maximumCharacterLimitInputField(), 'visible');
|
334
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitInputField(50);
|
335
|
+
});
|
501
336
|
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
*/
|
507
|
-
enterTextInMultilineResponseAreaSetCorrectAnswerSection: (responseFieldIndex, text) => {
|
508
|
-
fillInTheGapsTextCommonComponent.multilineResponseAreaSetCorrectAnswerSection()
|
509
|
-
.eq(responseFieldIndex)
|
510
|
-
.clear()
|
511
|
-
.type(text);
|
512
|
-
},
|
337
|
+
it('User should be able to update values in both the input fields', () => {
|
338
|
+
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(10);
|
339
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(40);
|
340
|
+
});
|
513
341
|
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
verifyTextInMultilineResponseAreaSetCorrectAnswerSection: (responseFieldIndex, text) => {
|
520
|
-
fillInTheGapsTextCommonComponent.multilineResponseAreaSetCorrectAnswerSection()
|
521
|
-
.eq(responseFieldIndex)
|
522
|
-
.should('have.text', text);
|
523
|
-
},
|
342
|
+
it('When the user clears the minimum character limit input field and focuses out of it, then error message \'Error: Minimum character limit is required\' should be displayed below the input field', () => {
|
343
|
+
fillInTheGapsTextCommonComponent.steps.clearAndFocusOutOfMinimumCharacterLimitInputField();
|
344
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Minimum character limit is required.');
|
345
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
346
|
+
});
|
524
347
|
|
525
|
-
|
526
|
-
* Enter text in a multiline response area in the Preview Tab.
|
527
|
-
* @param {number} responseFieldIndex - The index of the response field to enter text in.
|
528
|
-
* @param {string} text - The text to enter in the multiline response area.
|
529
|
-
*/
|
530
|
-
enterTextInMultilineResponseAreaPreviewTab: (responseFieldIndex, text) => {
|
531
|
-
fillInTheGapsTextCommonComponent.multilineResponseAreaPreviewTab()
|
532
|
-
.eq(responseFieldIndex)
|
533
|
-
.clear()
|
534
|
-
.type(text);
|
535
|
-
},
|
348
|
+
commonComponents.tests.verifyErrorMessageCSSAndA11y();
|
536
349
|
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
*/
|
542
|
-
verifyTextInMultilineResponseAreaPreviewTab: (responseFieldIndex, text) => {
|
543
|
-
fillInTheGapsTextCommonComponent.multilineResponseAreaPreviewTab()
|
544
|
-
.eq(responseFieldIndex)
|
545
|
-
.should('have.text', text);
|
546
|
-
},
|
350
|
+
it('When the user enters value in minimum character limit input field then the error message should disappear', () => {
|
351
|
+
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(0);
|
352
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
353
|
+
});
|
547
354
|
|
548
|
-
|
549
|
-
|
550
|
-
.
|
551
|
-
|
355
|
+
it('When the user clears the maximum character limit input field and focuses out of it, then error message \'Error: Maximum character limit is required.\' should be displayed below the input field', () => {
|
356
|
+
fillInTheGapsTextCommonComponent.steps.clearAndFocusOutOfMaximumCharacterLimitInputField();
|
357
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Maximum character limit is required.');
|
358
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
359
|
+
});
|
552
360
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
verifySpellCheckOfResponseFieldSetCorrectAnswerSectionDisabled: (responseFieldIndex) => {
|
558
|
-
fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection()
|
559
|
-
.eq(responseFieldIndex)
|
560
|
-
.should('have.attr', 'spellcheck', 'false');
|
561
|
-
},
|
361
|
+
it('When the user enters value in maximum character limit input field then the error message should disappear', () => {
|
362
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(40);
|
363
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
364
|
+
});
|
562
365
|
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection()
|
569
|
-
.eq(responseFieldIndex)
|
570
|
-
.should('have.attr', 'spellcheck', 'true');
|
571
|
-
},
|
366
|
+
it('When the user sets minimum limit input field value greater than maximum limit input field value then error message \'Error: Minimum limit must be less than or equal to maximum limit.\' and \'Error: Maximum limit must be greater than or equal to minimum limit.\'should be displayed below the minimum and maximum input field respectively', () => {
|
367
|
+
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(45);
|
368
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumLimitErrorMessage();
|
369
|
+
fillInTheGapsTextCommonComponent.steps.verifyMinimumLimitErrorMessage();
|
370
|
+
});
|
572
371
|
|
573
|
-
|
574
|
-
* Verify that the spell check for a response field in the Preview Tab is disabled.
|
575
|
-
* @param {number} responseFieldIndex - The index of the response field to verify.
|
576
|
-
*/
|
577
|
-
verifySpellCheckOfResponseFieldPreviewTabDisabled: (responseFieldIndex) => {
|
578
|
-
fillInTheGapsTextCommonComponent.responseFieldPreviewTab()
|
579
|
-
.eq(responseFieldIndex)
|
580
|
-
.should('have.attr', 'spellcheck', 'false');
|
581
|
-
},
|
372
|
+
commonComponents.tests.verifyErrorMessageCSSAndA11y();
|
582
373
|
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
verifySpellCheckOfResponseFieldPreviewTabEnabled: (responseFieldIndex) => {
|
588
|
-
fillInTheGapsTextCommonComponent.responseFieldPreviewTab()
|
589
|
-
.eq(responseFieldIndex)
|
590
|
-
.should('have.attr', 'spellcheck', 'true');
|
591
|
-
},
|
374
|
+
it('When the user sets minimum limit input field value less than or equal to maximum limit input field value then error message should disappear', () => {
|
375
|
+
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(30);
|
376
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
377
|
+
});
|
592
378
|
|
593
|
-
|
594
|
-
|
595
|
-
.
|
596
|
-
.
|
597
|
-
|
379
|
+
it('When the user sets maximum limit input field value less than minimum limit input field value then error message \'Error: Minimum limit must be less than or equal to maximum limit.\' and \'Error: Maximum limit must be greater than or equal to minimum limit.\'should be displayed below the minimum and maximum input field respectively', () => {
|
380
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(26);
|
381
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumLimitErrorMessage();
|
382
|
+
fillInTheGapsTextCommonComponent.steps.verifyMinimumLimitErrorMessage();
|
383
|
+
});
|
598
384
|
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
*/
|
603
|
-
verifyPreviewTabResponseFieldAndCorrectAnswerNumeration: (numerationArray) => {
|
604
|
-
numerationArray.forEach((optionNumeration, index) => {
|
605
|
-
fillInTheGapsTextCommonComponent.previewTabResponseWrapper()
|
606
|
-
.eq(index)
|
607
|
-
.within(() => {
|
608
|
-
fillInTheGapsTextCommonComponent.responseNumeration()
|
609
|
-
.should('have.text', optionNumeration);
|
610
|
-
});
|
611
|
-
fillInTheGapsTextCommonComponent.previewTabCorrectAnswerResponseWrapper()
|
612
|
-
.eq(index)
|
613
|
-
.parent()
|
614
|
-
.within(() => {
|
615
|
-
fillInTheGapsTextCommonComponent.responseNumeration()
|
616
|
-
.should('have.text', optionNumeration);
|
617
|
-
});
|
385
|
+
it('When the user sets maximum limit input field value greater than or equal to minimum limit input field value then error message should disappear', () => {
|
386
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(45);
|
387
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
618
388
|
});
|
619
|
-
},
|
620
389
|
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
390
|
+
it('CSS of \'Set character limit\' sections', { tags: 'css' }, () => {
|
391
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.setLimitLabel(), {
|
392
|
+
'color': css.color.labels,
|
393
|
+
'font-size': css.fontSize.normal,
|
394
|
+
'font-weight': css.fontWeight.semibold
|
395
|
+
});
|
396
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.characterLabel(), {
|
397
|
+
'color': css.color.labelText,
|
398
|
+
'font-size': css.fontSize.normal,
|
399
|
+
'font-weight': css.fontWeight.regular
|
400
|
+
});
|
401
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.characterLabel(), {
|
402
|
+
'color': css.color.labelText,
|
403
|
+
'font-size': css.fontSize.normal,
|
404
|
+
'font-weight': css.fontWeight.regular
|
405
|
+
});
|
406
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.noneLabel(), {
|
407
|
+
'color': css.color.labelText,
|
408
|
+
'font-size': css.fontSize.normal,
|
409
|
+
'font-weight': css.fontWeight.regular
|
410
|
+
});
|
411
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.minimumCharacterLimitLabel(), {
|
412
|
+
'color': css.color.labels,
|
413
|
+
'font-size': css.fontSize.normal,
|
414
|
+
'font-weight': css.fontWeight.semibold
|
415
|
+
});
|
416
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.minimumCharacterLimitLabel(), {
|
417
|
+
'color': css.color.labels,
|
418
|
+
'font-size': css.fontSize.normal,
|
419
|
+
'font-weight': css.fontWeight.semibold
|
420
|
+
});
|
421
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.minimumCharacterLimitInputField(), {
|
422
|
+
'color': css.color.text,
|
423
|
+
'font-size': css.fontSize.default,
|
424
|
+
'font-weight': css.fontWeight.regular
|
425
|
+
});
|
426
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.maximumCharacterLimitInputField(), {
|
427
|
+
'color': css.color.text,
|
428
|
+
'font-size': css.fontSize.default,
|
429
|
+
'font-weight': css.fontWeight.regular
|
430
|
+
});
|
431
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.characterRadioButton().parent().find('svg'), {
|
432
|
+
'fill': css.color.activeButtons
|
433
|
+
});
|
434
|
+
});
|
628
435
|
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
*/
|
633
|
-
verifySpecialCharacterButtonNotVisibleInResponseFieldSetCorrectAnswerSection: (responseFieldIndex) => {
|
634
|
-
specialAndCustomSpecialCharactersComponent.setCorrectAnsResponseFieldSpecialCharactersButton()
|
635
|
-
.eq(responseFieldIndex)
|
636
|
-
.should('not.have.class', 'active-response-input-field')
|
637
|
-
.should('not.be.visible');
|
638
|
-
},
|
436
|
+
it('Accessibility of \'Set limit\' section', { tags: 'a11y' }, () => {
|
437
|
+
cy.checkAccessibility(fillInTheGapsTextCommonComponent.setLimitLabel().parents('[class*="SetLimitWrapper"]'));
|
438
|
+
});
|
639
439
|
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection()
|
646
|
-
.eq(responseFieldIndex)
|
647
|
-
.click();
|
648
|
-
specialAndCustomSpecialCharactersComponent.setCorrectAnsResponseFieldSpecialCharactersButton()
|
649
|
-
.eq(responseFieldIndex)
|
650
|
-
.should('have.class', 'active-response-input-field')
|
651
|
-
.should('be.visible');
|
652
|
-
},
|
440
|
+
it('When user enters zero in maximum limit input field, then error message \'Error: Maximum limit must be greater than 0.\' should be displayed', () => {
|
441
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(0);
|
442
|
+
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.errorMessage(), 'Error: Maximum limit must be greater than 0.');
|
443
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.errorMessage(), 'visible');
|
444
|
+
});
|
653
445
|
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
verifySpecialCharacterButtonNotVisibleInResponseFieldPreviewTab: (responseFieldIndex) => {
|
659
|
-
fillInTheGapsTextCommonComponent.previewTabResponseFieldSpecialCharactersButton()
|
660
|
-
.eq(responseFieldIndex)
|
661
|
-
.should('not.have.class', 'active-response-input-field')
|
662
|
-
.should('not.be.visible');
|
663
|
-
},
|
446
|
+
it('When user enters limit more than zero in maximum limit input field, then error message should disappear', () => {
|
447
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(50);
|
448
|
+
fillInTheGapsTextCommonComponent.steps.verifyErrorMessageIsNotDisplayed();
|
449
|
+
});
|
664
450
|
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
.eq(responseFieldIndex)
|
672
|
-
.click();
|
673
|
-
fillInTheGapsTextCommonComponent.previewTabResponseFieldSpecialCharactersButton()
|
674
|
-
.eq(responseFieldIndex)
|
675
|
-
.should('have.class', 'active-response-input-field')
|
676
|
-
.should('be.visible');
|
677
|
-
},
|
451
|
+
it('When user should not be able to add limit more than 50 inside minimum and maximum limit input field', () => {
|
452
|
+
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(60);
|
453
|
+
fillInTheGapsTextCommonComponent.steps.verifyMinimumLimit(6);
|
454
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(60);
|
455
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumLimit(6);
|
456
|
+
});
|
678
457
|
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
clickOnSpecialCharactersButtonPreviewTab: (responseFieldIndex) => {
|
684
|
-
fillInTheGapsTextCommonComponent.previewTabResponseFieldSpecialCharactersButton()
|
685
|
-
.eq(responseFieldIndex)
|
686
|
-
.click();
|
458
|
+
it('When the user selects \'None\' radio button then the maximum and minimum character limit labels and input field should not be displayed', () => {
|
459
|
+
fillInTheGapsTextCommonComponent.steps.selectNoneRadioButton();
|
460
|
+
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.minMaxLabelAndInputFieldWrapper(), 'notExist');
|
461
|
+
});
|
687
462
|
},
|
688
463
|
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
verifyResponseFieldNumeration: (optionNumerationArray) => {
|
694
|
-
optionNumerationArray.forEach((optionNumeration, count) => {
|
695
|
-
fillInTheGapsTextCommonComponent.previewTabResponseWrapper()
|
696
|
-
.eq(count)
|
697
|
-
.should('be.visible')
|
698
|
-
.within(() => {
|
699
|
-
fillInTheGapsTextCommonComponent.responseNumeration()
|
700
|
-
.should('have.text', `${optionNumeration}`);
|
701
|
-
});
|
464
|
+
verifySetLimitSectionEditTabFunctionality: () => {
|
465
|
+
it('When maximum character limit input field value is 50 then maximum character limit should be 50 in the specify correct answer section', () => {
|
466
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitInputField(50);
|
467
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimit(0, 50);
|
702
468
|
});
|
703
|
-
}
|
704
|
-
}
|
705
469
|
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
* @param {string} tabName Correct or Alternate tab
|
710
|
-
* @description This function verifies the input field and error states of set correct answer section
|
711
|
-
*/
|
712
|
-
verifySetCorrectAnswerTabContentsAndFunctionality: (tabName) => {
|
713
|
-
it('An empty points input field and two empty response fields with labels \'Response 1\' and \'Response 2\' should be present', () => {
|
714
|
-
scoringSectionBase.steps.verifyPointsFieldValue('');
|
715
|
-
for (let index = 0; index < 2; index++) {
|
716
|
-
utilities.verifyInnerText(fillInTheGapsTextCommonComponent.responseFieldLabelSetCorrectAnswerSection().eq(index), `Response ${index + 1}`)
|
717
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection().eq(index), 'visible');
|
718
|
-
};
|
470
|
+
it('When the user updates the maximum character limit input field value then maximum character limit should update in the specify correct answer section', () => {
|
471
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(10);
|
472
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimit(0, 10);
|
719
473
|
});
|
720
474
|
|
721
|
-
it('User should
|
722
|
-
fillInTheGapsTextCommonComponent.steps.
|
723
|
-
fillInTheGapsTextCommonComponent.steps.verifyTextInResponseFieldSetCorrectAnswerSection(0, 'Flower');
|
475
|
+
it('User should able to enter characters in the answer input field', () => {
|
476
|
+
fillInTheGapsTextCommonComponent.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }]);
|
724
477
|
});
|
725
478
|
|
726
|
-
it(
|
727
|
-
fillInTheGapsTextCommonComponent.
|
728
|
-
|
729
|
-
|
730
|
-
.blur();
|
731
|
-
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
|
732
|
-
if (tabName == 'Correct tab') {
|
733
|
-
autoScoredSetCorrectAnswerSection.correctTab()
|
734
|
-
.within(() => {
|
735
|
-
utilities.verifyElementVisibilityState(autoScoredSetCorrectAnswerSection.setCorrectAnswerErrorIcon(), 'visible');
|
736
|
-
});
|
737
|
-
} else {
|
738
|
-
autoScoredSetCorrectAnswerSection.alternateAnswerTab(1)
|
739
|
-
.within(() => {
|
740
|
-
utilities.verifyElementVisibilityState(autoScoredSetCorrectAnswerSection.setCorrectAnswerErrorIcon(), 'visible');
|
741
|
-
});
|
742
|
-
};
|
479
|
+
it('When the user reaches the character limit, then the warning message \'Maximum 10 characters have been entered\' should be displayed', () => {
|
480
|
+
fillInTheGapsTextCommonComponent.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'pots' }]);
|
481
|
+
fillInTheGapsTextCommonComponent.steps.verifyTextInResponseAccordionAnswerInputField([{ responseIndex: 0, responseText: 'Flowerpots' }])
|
482
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageExist('Maximum 10 words have been entered.');
|
743
483
|
});
|
744
484
|
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
'
|
485
|
+
it('CSS of error message', { tags: 'css' }, () => {
|
486
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessage(), {
|
487
|
+
'color': css.color.warningMessage,
|
488
|
+
'font-size': css.fontSize.normal,
|
489
|
+
'font-weight': css.fontWeight.regular
|
750
490
|
});
|
751
|
-
utilities.verifyCSS(fillInTheGapsTextCommonComponent.
|
752
|
-
'
|
491
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessageContainer().find('svg'), {
|
492
|
+
'color': css.color.warningMessage,
|
493
|
+
});
|
494
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessageContainer(), {
|
495
|
+
'border': `1px solid ${css.color.warningContainerBorder}`
|
496
|
+
});
|
497
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessageContainer(), {
|
498
|
+
'background-color': css.color.warningContainerBackground
|
753
499
|
});
|
754
500
|
});
|
755
501
|
|
756
|
-
it('Accessibility of
|
757
|
-
cy.checkAccessibility(fillInTheGapsTextCommonComponent.
|
502
|
+
it('Accessibility of error message', { tags: 'a11y' }, () => {
|
503
|
+
cy.checkAccessibility(fillInTheGapsTextCommonComponent.limitReachedWarningMessage());
|
758
504
|
});
|
759
505
|
|
760
|
-
it('When the user
|
761
|
-
fillInTheGapsTextCommonComponent.steps.
|
762
|
-
fillInTheGapsTextCommonComponent.steps.
|
763
|
-
|
506
|
+
it('When the user removes/deletes some characters to make the number of characters less than the set maximum limit, the warning message should disappear', () => {
|
507
|
+
fillInTheGapsTextCommonComponent.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: '{backspace}' }]);
|
508
|
+
fillInTheGapsTextCommonComponent.steps.verifyTextInResponseAccordionAnswerInputField([{ responseIndex: 0, responseText: 'Flowerpot' }])
|
509
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageNotExist();
|
764
510
|
});
|
765
511
|
|
766
|
-
|
512
|
+
it('When the user updates minimum character limit and enters character less than the minimum character limit value set and focus out of response field, then the warning message \'Minimum 6 characters are required\' should be displayed in specify correct answer', () => {
|
513
|
+
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(6);
|
514
|
+
fillInTheGapsTextCommonComponent.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Air' }]);
|
515
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageExist('Minimum 6 words are required.');
|
516
|
+
});
|
767
517
|
|
768
|
-
it(
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
'font-weight': css.fontWeight.regular
|
773
|
-
});
|
774
|
-
utilities.verifyCSS(fillInTheGapsTextCommonComponent.responseFieldSetCorrectAnswerSection(), {
|
775
|
-
'color': css.color.text,
|
776
|
-
'font-size': css.fontSize.default,
|
777
|
-
'font-weight': css.fontWeight.regular
|
778
|
-
});
|
518
|
+
it('When the user enters the character greater than the minimum character limit value set by the user, then the warning message should disappear', () => {
|
519
|
+
fillInTheGapsTextCommonComponent.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Airwater' }]);
|
520
|
+
fillInTheGapsTextCommonComponent.steps.verifyTextInResponseAccordionAnswerInputField([{ responseIndex: 0, responseText: 'Airwater' }])
|
521
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageNotExist();
|
779
522
|
});
|
780
523
|
|
781
|
-
it(
|
782
|
-
|
524
|
+
it('When the user selects \'None\' radio button then maximum limit should not be displayed in the preview tab and when user types anything in the response field then error message should not be displayed', () => {
|
525
|
+
fillInTheGapsTextCommonComponent.steps.selectNoneRadioButton();
|
526
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitNotExistInPreviewTab(0);
|
527
|
+
fillInTheGapsTextCommonComponent.steps.addTextInAnswerInputFieldsPreviewTab(0, 'water');
|
528
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageNotExist();
|
783
529
|
});
|
784
530
|
},
|
785
531
|
|
786
|
-
|
787
|
-
it('
|
788
|
-
|
789
|
-
|
790
|
-
fillInTheGapsTextCommonComponent.steps.
|
532
|
+
verifySetLimitSectionPreviewTabFunctionality: () => {
|
533
|
+
it('When maximum character limit input field value is 50 then maximum character limit should be 50 in the preview tab', () => {
|
534
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitInputField(50);
|
535
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
536
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitInPreviewTab(0, 50);
|
791
537
|
});
|
792
538
|
|
793
|
-
it('
|
794
|
-
|
795
|
-
|
796
|
-
|
539
|
+
it('When the user updates the maximum character limit input field value then maximum character limit should update in the preview tab', () => {
|
540
|
+
createQuestionBasePage.steps.switchToEditTab();
|
541
|
+
fillInTheGapsTextCommonComponent.steps.setMaximumLimit(10);
|
542
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
543
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitInPreviewTab(0, 10);
|
797
544
|
});
|
798
545
|
|
799
|
-
it('
|
800
|
-
|
801
|
-
fillInTheGapsTextCommonComponent.steps.verifyMatchFromAllResponsesLabelAndCheckboxDisabledState();
|
546
|
+
it('User should able to enter characters in the response field', () => {
|
547
|
+
fillInTheGapsTextCommonComponent.steps.addTextInAnswerInputFieldsPreviewTab(0, 'Flower');
|
802
548
|
});
|
803
549
|
|
804
|
-
it('When the user
|
805
|
-
fillInTheGapsTextCommonComponent.
|
806
|
-
|
550
|
+
it('When the user reaches the character limit, then the warning message \'Maximum 10 characters have been entered\' should be displayed', () => {
|
551
|
+
fillInTheGapsTextCommonComponent.steps.addTextInAnswerInputFieldsPreviewTab(0, 'pots');
|
552
|
+
fillInTheGapsTextCommonComponent.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flowerpots' }])
|
553
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageExist('Maximum 10 words have been entered.');
|
807
554
|
});
|
808
555
|
|
809
|
-
it('CSS of
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
'color': css.color.labelText,
|
815
|
-
'font-size': css.fontSize.normal,
|
816
|
-
'font-weight': css.fontWeight.regular
|
817
|
-
});
|
556
|
+
it('CSS of error message', { tags: 'css' }, () => {
|
557
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessage(), {
|
558
|
+
'color': css.color.warningMessage,
|
559
|
+
'font-size': css.fontSize.normal,
|
560
|
+
'font-weight': css.fontWeight.regular
|
818
561
|
});
|
819
|
-
|
820
|
-
|
821
|
-
'fill': css.color.uncheckedCheckbox
|
822
|
-
});
|
562
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessageContainer().find('svg'), {
|
563
|
+
'color': css.color.warningMessage,
|
823
564
|
});
|
824
|
-
utilities.verifyCSS(fillInTheGapsTextCommonComponent.
|
825
|
-
'
|
565
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessageContainer(), {
|
566
|
+
'border': `1px solid ${css.color.warningContainerBorder}`
|
826
567
|
});
|
827
|
-
|
828
|
-
|
829
|
-
utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'visible');
|
830
|
-
utilities.verifyCSS(commonComponents.tooltipText(), {
|
831
|
-
'color': css.color.whiteText,
|
832
|
-
'font-size': css.fontSize.normal,
|
833
|
-
'font-weight': css.fontWeight.regular,
|
834
|
-
'background-color': css.color.tooltipBg
|
568
|
+
utilities.verifyCSS(fillInTheGapsTextCommonComponent.limitReachedWarningMessageContainer(), {
|
569
|
+
'background-color': css.color.warningContainerBackground
|
835
570
|
});
|
836
|
-
utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
|
837
571
|
});
|
838
572
|
|
839
|
-
it(
|
840
|
-
cy.checkAccessibility(fillInTheGapsTextCommonComponent.
|
841
|
-
cy.log('Checking a11y of match from all responses tooltip')
|
842
|
-
utilities.hoverOverElement(fillInTheGapsTextCommonComponent.matchFromAllResponsesLabel());
|
843
|
-
utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'visible');
|
844
|
-
cy.checkAccessibility(commonComponents.tooltipText());
|
845
|
-
utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
|
573
|
+
it('Accessibility of error message', { tags: 'a11y' }, () => {
|
574
|
+
cy.checkAccessibility(fillInTheGapsTextCommonComponent.limitReachedWarningMessage());
|
846
575
|
});
|
847
|
-
},
|
848
576
|
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
577
|
+
it('When the user removes/deletes some characters to make the number of characters less than the set maximum limit, the warning message should disappear', () => {
|
578
|
+
fillInTheGapsTextCommonComponent.steps.addTextInAnswerInputFieldsPreviewTab(0, '{backspace}');
|
579
|
+
fillInTheGapsTextCommonComponent.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flowerpot' }])
|
580
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageNotExist();
|
581
|
+
});
|
582
|
+
|
583
|
+
it('When the user updates minimum character limit in edit tab and enters character less than the minimum character limit value set and focus out of response field, then the warning message \'Minimum 6 characters are required\' should be displayed in preview tab', () => {
|
584
|
+
createQuestionBasePage.steps.switchToEditTab();
|
585
|
+
fillInTheGapsTextCommonComponent.steps.setMinimumLimit(6);
|
586
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
587
|
+
fillInTheGapsTextCommonComponent.steps.addTextInAnswerInputFieldsPreviewTab(0, 'Air');
|
588
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageExist('Minimum 6 words are required.');
|
589
|
+
});
|
590
|
+
|
591
|
+
it('When the user enters the character greater than the minimum character limit value set by the user, then the warning message should disappear', () => {
|
592
|
+
fillInTheGapsTextCommonComponent.steps.addTextInAnswerInputFieldsPreviewTab(0, 'water');
|
593
|
+
fillInTheGapsTextCommonComponent.steps.verifyTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Airwater' }])
|
594
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageNotExist();
|
855
595
|
});
|
856
|
-
},
|
857
596
|
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.penaltyPointsLabel(), 'notExist');
|
866
|
-
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckbox(), 'notExist');
|
867
|
-
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel(), 'notExist');
|
868
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.caseSensitiveCheckbox(), 'notExist');
|
869
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.ignoreSpacesBeforeAndAfterCheckbox(), 'notExist');
|
870
|
-
utilities.verifyElementVisibilityState(fillInTheGapsTextCommonComponent.matchFromAllResponsesCheckbox(), 'notExist');
|
871
|
-
scoringSectionBase.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
|
872
|
-
additionalSettingsPanel.steps.expandAdditonalSettings();
|
873
|
-
utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.checkAnswerLabel(), 'notExist');
|
874
|
-
utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.allowStudentsToCheckAnswerLabel(), 'notExist');
|
875
|
-
utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.allowStudentsToCheckAnswerCheckbox(), 'notExist');
|
597
|
+
it('When the user selects \'None\' radio button then maximum limit should not be displayed in the preview tab and when user types anything in the response field then error message should not be displayed', () => {
|
598
|
+
createQuestionBasePage.steps.switchToEditTab();
|
599
|
+
fillInTheGapsTextCommonComponent.steps.selectNoneRadioButton();
|
600
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
601
|
+
fillInTheGapsTextCommonComponent.steps.verifyMaximumCharacterLimitNotExistInPreviewTab(0);
|
602
|
+
fillInTheGapsTextCommonComponent.steps.addTextInAnswerInputFieldsPreviewTab(0, 'water');
|
603
|
+
fillInTheGapsTextCommonComponent.steps.verifyLimitReachedWarningMessageNotExist();
|
876
604
|
});
|
877
605
|
}
|
878
606
|
}
|