itemengine-cypress-automation 1.0.184-e2e-execution-crash-3b9d0d0.0 → 1.0.184
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +79 -0
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +345 -0
- package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +429 -0
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +489 -0
- package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +313 -0
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -8
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +417 -28
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
- package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +11 -3
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +230 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +201 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +279 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +109 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +335 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +250 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +161 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +252 -0
- package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +118 -0
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
- package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +155 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +195 -0
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +78 -0
- package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
- package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +112 -0
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +244 -0
- package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/LayoutSection.js +181 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +57 -1
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +33 -0
- package/cypress/e2e/ILC/NumberLine/numberLineSection.js +46 -0
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +696 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +173 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +183 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +73 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +204 -0
- package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +288 -0
- package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +153 -0
- package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +164 -0
- package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
- package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
- package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +6 -7
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +179 -0
- package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
- package/cypress/fixtures/theme/ilc.json +20 -18
- package/cypress/pages/audioPlayerPage.js +274 -504
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
- package/cypress/pages/components/commonComponents.js +1 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/equationEditorFlyout.js +3 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
- package/cypress/pages/components/imageCanvasComponent.js +2 -1
- package/cypress/pages/components/index.js +3 -0
- package/cypress/pages/components/layoutSectionComponent.js +1191 -0
- package/cypress/pages/components/numberLineCommonComponent.js +36 -0
- package/cypress/pages/components/optionsWrapperComponent.js +13 -2
- package/cypress/pages/components/playbackControlsBaseComponent.js +20 -13
- package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
- package/cypress/pages/components/toolSettingsComponent.js +6 -0
- package/cypress/pages/contentBlocksPage.js +18 -2
- package/cypress/pages/createItemPage.js +75 -8
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/drawingResponsePage.js +24 -4
- package/cypress/pages/feedbackScalePage.js +3 -0
- package/cypress/pages/graphingPage.js +19 -1
- package/cypress/pages/gridFillPage.js +25 -8
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/itemPreviewSettingsPage.js +4 -0
- package/cypress/pages/listOrderingPage.js +435 -557
- package/cypress/pages/matchingPage.js +1 -1
- package/cypress/pages/multipleSelectionPage.js +23 -1
- package/cypress/pages/numberLineLabelPage.js +333 -0
- package/cypress/pages/numberLinePage.js +1370 -132
- package/cypress/pages/rulerPage.js +6 -2
- package/cypress/pages/textSelectionPage.js +461 -23
- package/package.json +1 -1
@@ -0,0 +1,260 @@
|
|
1
|
+
import { textSelectionPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const paragraphTextArray = ['Horses cannot breat& through their mouth! Cows can sleep standing up?', 'Dogs have e#cellent \'hearing\'.', 'Deers possess nearly, 300 degree field of vision.'];
|
7
|
+
const sentenceTextArray = ['Horses cannot breat& through their mouth! ', 'Cows can sleep standing up?', 'Dogs have e#cellent \'hearing\'.', 'Deers possess nearly, 300 degree field of vision.'];
|
8
|
+
const wordTextArray = ['Horses', 'cannot', 'breat&', 'through', 'their', 'mouth', 'Cows', 'can', 'sleep', 'standing', 'up', 'Dogs', 'have', 'e#cellent', 'hearing', 'Deers', 'possess', 'nearly', '300', 'degree', 'field', 'of', 'vision'];
|
9
|
+
const customTextArray = ['Cows can sleep', 'Dogs have e#cellent \'hearing\'', 'nearly, 300 degree field of vision.'];
|
10
|
+
|
11
|
+
describe('Create Item page - Text selection: Text selection modes in Set correct answer section', () => {
|
12
|
+
before(() => {
|
13
|
+
cy.loginAs('admin');
|
14
|
+
});
|
15
|
+
|
16
|
+
describe('Specify correct answer section: Custom', () => {
|
17
|
+
abortEarlySetup();
|
18
|
+
before(() => {
|
19
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
20
|
+
cy.barsPreLoaderWait();
|
21
|
+
textSelectionPage.steps.clearQuestionInputField();
|
22
|
+
paragraphTextArray.forEach((paragraphText) => {
|
23
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
24
|
+
});
|
25
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
26
|
+
});
|
27
|
+
|
28
|
+
it('When \'Custom\' text selection type is selected, then no options should be provided in specify correct answer section', () => {
|
29
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextParagraphs(), 3);
|
30
|
+
utilities.verifyElementVisibilityState(textSelectionPage.optionSpecifyCorrectAnswer(), 'notExist');
|
31
|
+
});
|
32
|
+
|
33
|
+
it('When user selects text in specify possible options section, then that text should be provided as option in specify correct answer section', () => {
|
34
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[0]);
|
35
|
+
utilities.verifyElementCount(textSelectionPage.optionSpecifyCorrectAnswer(), 1);
|
36
|
+
utilities.verifyTextContent(textSelectionPage.optionSpecifyCorrectAnswer(), customTextArray[0]);
|
37
|
+
});
|
38
|
+
|
39
|
+
it('When user deselects the option in specify possible options section, then that text should not provided as option in specify correct answer section', () => {
|
40
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(customTextArray[0]);
|
41
|
+
utilities.verifyElementVisibilityState(textSelectionPage.optionSpecifyCorrectAnswer(), 'notExist');
|
42
|
+
});
|
43
|
+
|
44
|
+
it('When the user hovers over the provided option in specify correct answer section, then that option should be displayed in hover state', () => {
|
45
|
+
cy.log('Pre-step: Select an option in specify possible options section');
|
46
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[0]);
|
47
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[1]);
|
48
|
+
textSelectionPage.steps.verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection(customTextArray[0], 'blue');
|
49
|
+
});
|
50
|
+
|
51
|
+
it('When user clicks on the provided option in specify correct answer section, then the option should be selected ', () => {
|
52
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(customTextArray[0]);
|
53
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(customTextArray[1]);
|
54
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(customTextArray[0], 'blue');
|
55
|
+
});
|
56
|
+
|
57
|
+
it('When user clicks on the selected option, the option should then be deselected state', () => {
|
58
|
+
textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(customTextArray[1]);
|
59
|
+
});
|
60
|
+
|
61
|
+
it('CSS of the option in deselected state in specify correct answer section', { tags: 'css' }, () => {
|
62
|
+
utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(customTextArray[1]), {
|
63
|
+
'color': css.color.text,
|
64
|
+
'font-size': css.fontSize.default,
|
65
|
+
'font-weight': css.fontWeight.regular,
|
66
|
+
'background-color': css.color.transparent
|
67
|
+
});
|
68
|
+
});
|
69
|
+
|
70
|
+
it('Accessibility of options in specify correct answer section', { tags: 'a11y' }, () => {
|
71
|
+
cy.checkAccessibility(textSelectionPage.optionSpecifyCorrectAnswer().parents('[class*="Highlightstyles__HighlightPreviewWrapper"] [data-testid="question-instruction-element"]'));
|
72
|
+
});
|
73
|
+
});
|
74
|
+
|
75
|
+
describe('Specify correct answer section: Paragraph', () => {
|
76
|
+
abortEarlySetup();
|
77
|
+
before(() => {
|
78
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
79
|
+
cy.barsPreLoaderWait();
|
80
|
+
textSelectionPage.steps.clearQuestionInputField();
|
81
|
+
paragraphTextArray.forEach((paragraphText) => {
|
82
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
83
|
+
});
|
84
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
85
|
+
textSelectionPage.steps.switchTextSelectionMode('Paragraph');
|
86
|
+
});
|
87
|
+
|
88
|
+
it('When \'Paragraph\' text selection type is selected, then no options should be available in specify correct answer section', () => {
|
89
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextParagraphs(), 3);
|
90
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextSpans(), 3);
|
91
|
+
paragraphTextArray.forEach((paragraphText, index) => {
|
92
|
+
utilities.verifyTextContent(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), paragraphText);
|
93
|
+
})
|
94
|
+
utilities.verifyElementVisibilityState(textSelectionPage.optionSpecifyCorrectAnswer(), 'notExist');
|
95
|
+
});
|
96
|
+
|
97
|
+
it('When user has selected options in specify possible options, then the corresponding text should be available as options in specify correct answer section in deselected state', () => {
|
98
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
|
99
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
|
100
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
|
101
|
+
textSelectionPage.steps.verifyOptionsInSpecifyCorrectAnswerSection(paragraphTextArray);
|
102
|
+
});
|
103
|
+
|
104
|
+
it('When user deselects the option in specify possible options section, then that text should not provided as option in specify correct answer section', () => {
|
105
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
|
106
|
+
textSelectionPage.steps.verifyOptionsInSpecifyCorrectAnswerSection([paragraphTextArray[0], paragraphTextArray[1]]);
|
107
|
+
});
|
108
|
+
|
109
|
+
it('When the user hovers over the provided option in specify correct answer section, then that option should be displayed in hover state', () => {
|
110
|
+
textSelectionPage.steps.verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0], 'blue');
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When user clicks on the provided option in specify correct answer section, then the option should be selected ', () => {
|
114
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
|
115
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
|
116
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0], 'blue');
|
117
|
+
});
|
118
|
+
|
119
|
+
it('When user clicks on the selected option, the option should then be in deselected state', () => {
|
120
|
+
textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
|
121
|
+
});
|
122
|
+
|
123
|
+
it('CSS of the option in selected and deselected state in specify correct answer section', { tags: 'css' }, () => {
|
124
|
+
utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(paragraphTextArray[0]), {
|
125
|
+
'color': css.color.text,
|
126
|
+
'font-size': css.fontSize.default,
|
127
|
+
'font-weight': css.fontWeight.regular,
|
128
|
+
'background-color': css.color.transparent
|
129
|
+
});
|
130
|
+
});
|
131
|
+
|
132
|
+
it('Accessibility of response options in specify correct answer section', { tags: 'a11y' }, () => {
|
133
|
+
cy.checkAccessibility(textSelectionPage.optionSpecifyCorrectAnswer().parents('[class*="Highlightstyles__HighlightPreviewWrapper"] [data-testid="question-instruction-element"]'));
|
134
|
+
});
|
135
|
+
});
|
136
|
+
|
137
|
+
describe('Specify correct answer section: Sentence', () => {
|
138
|
+
abortEarlySetup();
|
139
|
+
before(() => {
|
140
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
141
|
+
cy.barsPreLoaderWait();
|
142
|
+
textSelectionPage.steps.clearQuestionInputField();
|
143
|
+
paragraphTextArray.forEach((paragraphText) => {
|
144
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
145
|
+
});
|
146
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
147
|
+
textSelectionPage.steps.switchTextSelectionMode('Sentence');
|
148
|
+
});
|
149
|
+
|
150
|
+
it('When \'Sentence\' text selection type is selected, then no options should be available in specify correct answer section', () => {
|
151
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextParagraphs(), 3);
|
152
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextSpans(), 4);
|
153
|
+
sentenceTextArray.forEach((sentenceText, index) => {
|
154
|
+
utilities.verifyTextContent(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), sentenceText);
|
155
|
+
})
|
156
|
+
utilities.verifyElementVisibilityState(textSelectionPage.optionSpecifyCorrectAnswer(), 'notExist');
|
157
|
+
});
|
158
|
+
|
159
|
+
it('When user has selected options in specify possible options, then the corresponding text should be available as options in specify correct answer section in deselected state', () => {
|
160
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(sentenceTextArray[0]);
|
161
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(sentenceTextArray[1]);
|
162
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(sentenceTextArray[2]);
|
163
|
+
textSelectionPage.steps.verifyOptionsInSpecifyCorrectAnswerSection([sentenceTextArray[0], sentenceTextArray[1], sentenceTextArray[2]]);
|
164
|
+
});
|
165
|
+
|
166
|
+
it('When user deselects the option in specify possible options section, then that text should not be provided as option in specify correct answer section', () => {
|
167
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Sentence', sentenceTextArray[2]);
|
168
|
+
textSelectionPage.steps.verifyOptionsInSpecifyCorrectAnswerSection([sentenceTextArray[0], sentenceTextArray[1]]);
|
169
|
+
});
|
170
|
+
|
171
|
+
it('When the user hovers over the provided option in specify correct answer section, then that option should be displayed in hover state', () => {
|
172
|
+
textSelectionPage.steps.verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection(sentenceTextArray[1], 'blue');
|
173
|
+
});
|
174
|
+
|
175
|
+
it('When user clicks on the provided option in specify correct answer section, then the option should be selected ', () => {
|
176
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(sentenceTextArray[0]);
|
177
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(sentenceTextArray[1]);
|
178
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(sentenceTextArray[0], 'blue');
|
179
|
+
});
|
180
|
+
|
181
|
+
it('When user clicks on the selected option, the option should then be deselected state', () => {
|
182
|
+
textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(sentenceTextArray[1]);
|
183
|
+
});
|
184
|
+
|
185
|
+
it('CSS of the option in selected and deselected state in specify correct answer section', { tags: 'css' }, () => {
|
186
|
+
utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(sentenceTextArray[1]), {
|
187
|
+
'color': css.color.text,
|
188
|
+
'font-size': css.fontSize.default,
|
189
|
+
'font-weight': css.fontWeight.regular,
|
190
|
+
'background-color': css.color.transparent
|
191
|
+
});
|
192
|
+
});
|
193
|
+
|
194
|
+
it('Accessibility of response options in specify correct answer section', { tags: 'a11y' }, () => {
|
195
|
+
cy.checkAccessibility(textSelectionPage.optionSpecifyCorrectAnswer().parents('[class*="Highlightstyles__HighlightPreviewWrapper"] [data-testid="question-instruction-element"]'));
|
196
|
+
});
|
197
|
+
});
|
198
|
+
|
199
|
+
describe('Specify correct answer section: Word', () => {
|
200
|
+
abortEarlySetup();
|
201
|
+
before(() => {
|
202
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
203
|
+
cy.barsPreLoaderWait();
|
204
|
+
textSelectionPage.steps.clearQuestionInputField();
|
205
|
+
paragraphTextArray.forEach((paragraphText) => {
|
206
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
207
|
+
});
|
208
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
209
|
+
textSelectionPage.steps.switchTextSelectionMode('Word');
|
210
|
+
});
|
211
|
+
|
212
|
+
it('When \'Word\' text selection type is selected, then no options should be available in specify correct answer section', () => {
|
213
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextParagraphs(), 3);
|
214
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextSpans(), 23);
|
215
|
+
wordTextArray.forEach((wordText, index) => {
|
216
|
+
utilities.verifyTextContent(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), wordText);
|
217
|
+
})
|
218
|
+
utilities.verifyElementVisibilityState(textSelectionPage.optionSpecifyCorrectAnswer(), 'notExist');
|
219
|
+
});
|
220
|
+
|
221
|
+
it('When user has selected options in specify possible options, then the corresponding text should be available as options in specify correct answer section in deselected state', () => {
|
222
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(wordTextArray[0]);
|
223
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(wordTextArray[1]);
|
224
|
+
textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(wordTextArray[2]);
|
225
|
+
textSelectionPage.steps.verifyOptionsInSpecifyCorrectAnswerSection([wordTextArray[0], wordTextArray[1], wordTextArray[2]]);
|
226
|
+
});
|
227
|
+
|
228
|
+
it('When user deselects the option in specify possible options section, then that text should not be provided as option in specify correct answer section', () => {
|
229
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Word', wordTextArray[2]);
|
230
|
+
textSelectionPage.steps.verifyOptionsInSpecifyCorrectAnswerSection([wordTextArray[0], wordTextArray[1]]);
|
231
|
+
});
|
232
|
+
|
233
|
+
it('When the user hovers over the provided option in specify correct answer section, then that option should be displayed in hover state', () => {
|
234
|
+
textSelectionPage.steps.verifyHoverStateOfDeselectedOptionInSpecifyCorrectAnswerSection(wordTextArray[1], 'blue');
|
235
|
+
});
|
236
|
+
|
237
|
+
it('When user clicks on the provided option in specify correct answer section, then the option should be selected ', () => {
|
238
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(wordTextArray[0]);
|
239
|
+
textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(wordTextArray[1]);
|
240
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyCorrectAnswerSection(wordTextArray[0], 'blue');
|
241
|
+
});
|
242
|
+
|
243
|
+
it('When user clicks on the selected option, the option should then be deselected state', () => {
|
244
|
+
textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(wordTextArray[1]);
|
245
|
+
});
|
246
|
+
|
247
|
+
it('CSS of the option in selected and deselected state in specify correct answer section', { tags: 'css' }, () => {
|
248
|
+
utilities.verifyCSS(textSelectionPage.optionSpecifyCorrectAnswer().contains(wordTextArray[1]), {
|
249
|
+
'color': css.color.text,
|
250
|
+
'font-size': css.fontSize.default,
|
251
|
+
'font-weight': css.fontWeight.regular,
|
252
|
+
'background-color': css.color.transparent
|
253
|
+
});
|
254
|
+
});
|
255
|
+
|
256
|
+
it('Accessibility of response options in specify correct answer section', { tags: 'a11y' }, () => {
|
257
|
+
cy.checkAccessibility(textSelectionPage.optionSpecifyCorrectAnswer().parents('[class*="Highlightstyles__HighlightPreviewWrapper"] [data-testid="question-instruction-element"]'));
|
258
|
+
});
|
259
|
+
});
|
260
|
+
});
|
@@ -0,0 +1,380 @@
|
|
1
|
+
import { textSelectionPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const textSelectionModeArray = ['Custom', 'Paragraph', 'Sentence', 'Word'];
|
7
|
+
const paragraphTextArray = ['Horses cannot breat& through their mouth! Cows can sleep standing up?', 'Dogs have e#cellent \'hearing\'.', 'Deers possess nearly, 300 degree field of vision.'];
|
8
|
+
const sentenceTextArray = ['Horses cannot breat& through their mouth! ', 'Cows can sleep standing up?', 'Dogs have e#cellent \'hearing\'.', 'Deers possess nearly, 300 degree field of vision.'];
|
9
|
+
const wordTextArray = ['Horses', 'cannot', 'breat&', 'through', 'their', 'mouth', 'Cows', 'can', 'sleep', 'standing', 'up', 'Dogs', 'have', 'e#cellent', 'hearing', 'Deers', 'possess', 'nearly', '300', 'degree', 'field', 'of', 'vision'];
|
10
|
+
const customTextArray = ['Cows can sleep', 'Dogs have e#cellent \'hearing\'', 'nearly, 300 degree field of vision.'];
|
11
|
+
|
12
|
+
describe('Create Item page - Text selection: Text selection modes in specify possible options section', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
16
|
+
|
17
|
+
describe('Specify possible options section and Text selection modes: Custom text selection', () => {
|
18
|
+
abortEarlySetup();
|
19
|
+
before(() => {
|
20
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
textSelectionPage.steps.clearQuestionInputField();
|
23
|
+
paragraphTextArray.forEach((paragraphText) => {
|
24
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
25
|
+
});
|
26
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
27
|
+
});
|
28
|
+
|
29
|
+
it('\'Text selection mode\' label and \'Custom\', \'Paragraph\', \'Sentence\' and \'Word\' text selection modes should be displayed', () => {
|
30
|
+
utilities.verifyInnerText(textSelectionPage.textSelectionModeLabel(), 'Text selection mode');
|
31
|
+
utilities.verifyElementVisibilityState(textSelectionPage.textSelectionModeLabel(), 'visible');
|
32
|
+
textSelectionModeArray.forEach((selectionMode, index) => {
|
33
|
+
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.textSelectionModeButtonLabel(), index), selectionMode);
|
34
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(textSelectionPage.textSelectionMode(), index), 'visible');
|
35
|
+
});
|
36
|
+
});
|
37
|
+
|
38
|
+
it('By default \'Custom\' should be selected in text selection dropdown.', () => {
|
39
|
+
textSelectionPage.steps.verifyTextSelectionModeIsSelected('custom');
|
40
|
+
textSelectionPage.steps.verifyTextSelectionModeIsNotSelected('Paragraph');
|
41
|
+
textSelectionPage.steps.verifyTextSelectionModeIsNotSelected('Sentence');
|
42
|
+
textSelectionPage.steps.verifyTextSelectionModeIsNotSelected('Word');
|
43
|
+
});
|
44
|
+
|
45
|
+
it('\'Specify possible answers\' label should be displayed', () => {
|
46
|
+
utilities.verifyInnerText(textSelectionPage.specifyPossibleOptionsLabel(), 'Text selection mode');
|
47
|
+
utilities.verifyElementVisibilityState(textSelectionPage.specifyPossibleOptionsLabel(), 'visible');
|
48
|
+
});
|
49
|
+
|
50
|
+
it('When \'Custom\' text selection type is selected, then no options should be displayed', () => {
|
51
|
+
utilities.verifyElementVisibilityState(textSelectionPage.selectedOptionSpecifyPossibleOptions(), 'notExist');
|
52
|
+
});
|
53
|
+
|
54
|
+
it('The option count should be displayed as \'0\'.', () => {
|
55
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(0);
|
56
|
+
});
|
57
|
+
|
58
|
+
it('When user selects Custom texts, then that text should be selected and the option count should be increased to 1.', () => {
|
59
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[0]);
|
60
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[1]);
|
61
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(2);
|
62
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyPossibleOptionSection(customTextArray[0], 'blue');
|
63
|
+
});
|
64
|
+
|
65
|
+
it('Accessibility of the selected option', { tags: 'a11y' }, () => {
|
66
|
+
cy.checkAccessibility(textSelectionPage.selectedOptionSpecifyPossibleOptions());
|
67
|
+
});
|
68
|
+
|
69
|
+
it('When user clicks on a selected option, then the selected option should be deselected and the option count should reduce by 1.', () => {
|
70
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[0]);
|
71
|
+
utilities.verifyElementVisibilityState(textSelectionPage.selectedOptionSpecifyPossibleOptions(), 'notExist')
|
72
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
73
|
+
});
|
74
|
+
|
75
|
+
it('When user clears all selected options with the \'Clear\' button, then all the selected options should be deselected and the specify possible options field should be in errored state with the error message \'Error: Minimum one highlight option is required.\'', () => {
|
76
|
+
cy.log('Pre-step: Selecting multiple texts to create options');
|
77
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[0]);
|
78
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[1]);
|
79
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[2]);
|
80
|
+
textSelectionPage.steps.clearSelectedOptionsInSpecifyPossibleOptionSection();
|
81
|
+
utilities.verifyElementVisibilityState(textSelectionPage.selectedOptionSpecifyPossibleOptions(), 'notExist');
|
82
|
+
utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Minimum one highlight option is required.');
|
83
|
+
textSelectionPage.steps.verifyErroredStateOfSpecifyPossibleOptionsSection();
|
84
|
+
});
|
85
|
+
|
86
|
+
textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
|
87
|
+
|
88
|
+
it('When user selects Custom text again, the option should be selected and the error message should disappear and option counter should display 1 count', () => {
|
89
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', customTextArray[2]);
|
90
|
+
utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
|
91
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
92
|
+
});
|
93
|
+
|
94
|
+
it('CSS of the text selection modes and specify possible option section', { tags: 'css' }, () => {
|
95
|
+
utilities.verifyCSS(textSelectionPage.textSelectionModeLabel(), {
|
96
|
+
'color': css.color.labels,
|
97
|
+
'font-size': css.fontSize.normal,
|
98
|
+
'font-weight': css.fontWeight.semibold,
|
99
|
+
});
|
100
|
+
utilities.verifyCSS(textSelectionPage.textSelectionModeButtonLabel().eq(0), {
|
101
|
+
'color': css.color.activeButtons,
|
102
|
+
'font-size': css.fontSize.default,
|
103
|
+
'font-weight': css.fontWeight.normal,
|
104
|
+
});
|
105
|
+
utilities.verifyCSS(textSelectionPage.textSelectionMode().eq(0).find('#Icon_awesome-i-cursor'), {
|
106
|
+
'fill': css.color.activeButtons,
|
107
|
+
});
|
108
|
+
utilities.verifyCSS(textSelectionPage.textSelectionModeButtonLabel().eq(1), {
|
109
|
+
'color': css.color.unselectedOptionText,
|
110
|
+
'font-size': css.fontSize.default,
|
111
|
+
'font-weight': css.fontWeight.normal,
|
112
|
+
});
|
113
|
+
utilities.verifyCSS(textSelectionPage.specifyPossibleOptionsLabel(), {
|
114
|
+
'color': css.color.labels,
|
115
|
+
'font-size': css.fontSize.normal,
|
116
|
+
'font-weight': css.fontWeight.semibold,
|
117
|
+
});
|
118
|
+
});
|
119
|
+
|
120
|
+
it('Accessibility of the text selection modes and specify possible option section', { tags: 'a11y' }, () => {
|
121
|
+
cy.checkAccessibility(textSelectionPage.textSelectionModeLabel().parents('.text-selection-mode'));
|
122
|
+
});
|
123
|
+
});
|
124
|
+
|
125
|
+
describe('Specify possible options section: Paragraph', () => {
|
126
|
+
abortEarlySetup();
|
127
|
+
before(() => {
|
128
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
129
|
+
cy.barsPreLoaderWait();
|
130
|
+
textSelectionPage.steps.clearQuestionInputField();
|
131
|
+
paragraphTextArray.forEach((paragraphText) => {
|
132
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
133
|
+
});
|
134
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
135
|
+
});
|
136
|
+
|
137
|
+
it('User should be able to switch to \'Paragraph\' in text selection dropdown.', () => {
|
138
|
+
textSelectionPage.steps.switchTextSelectionMode('Paragraph');
|
139
|
+
textSelectionPage.steps.verifyTextSelectionModeIsSelected('Paragraph');
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When user has selected \'Paragraph\' text selection mode, then \'Select all\' button should be displayed', () => {
|
143
|
+
textSelectionPage.steps.verifySelectAllOptionsButtonIsDisplayed();
|
144
|
+
});
|
145
|
+
|
146
|
+
it('When user has switched to \'Paragraph\' text selection type, the previously added input should be divided into available options as per \'Paragraph\' text selection type and all the options should be in deselected state', () => {
|
147
|
+
utilities.verifyElementCount(textSelectionPage.selectedOptionSpecifyPossibleOptions(), 0);
|
148
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextSpans(), 3);
|
149
|
+
paragraphTextArray.forEach((paragraphText, index) => {
|
150
|
+
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), paragraphText);
|
151
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(paragraphText);
|
152
|
+
});
|
153
|
+
});
|
154
|
+
|
155
|
+
it('The option count should be displayed as per the number of \'Paragraph\'.', () => {
|
156
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(0);
|
157
|
+
});
|
158
|
+
|
159
|
+
it('When user clicks on an option, then the option should be selected and the option count should increase by 1.', () => {
|
160
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Paragraph', paragraphTextArray[0]);
|
161
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Paragraph', paragraphTextArray[1]);
|
162
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
|
163
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(2);
|
164
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyPossibleOptionSection(paragraphTextArray[0], 'blue');
|
165
|
+
});
|
166
|
+
|
167
|
+
it('When user clicks on a selected option, then that option should be deselected and option count should decrease by 1', () => {
|
168
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Paragraph', paragraphTextArray[1]);
|
169
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
170
|
+
});
|
171
|
+
|
172
|
+
it('When the user hovers over the deselected option, then that option should be displayed in hover state', () => {
|
173
|
+
textSelectionPage.steps.verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2], 'blue');
|
174
|
+
});
|
175
|
+
|
176
|
+
//Clear button clear popup verification
|
177
|
+
it('When user clicks on \'Clear button\', Clear popup should be displayed with the text \'Are you sure you want to clear all options? This action will not delete template content but remove all options.\', Cancel and Confirm button', () => {
|
178
|
+
textSelectionPage.steps.clickOnClearOptionsButtonInSpecifyPossibleOptionSection();
|
179
|
+
textSelectionPage.steps.verifyClearPopupForClearingOptionSelection();
|
180
|
+
});
|
181
|
+
|
182
|
+
it('CSS of Clear popup', { tags: 'css' }, () => {
|
183
|
+
utilities.verifyCSS(textSelectionPage.dialogBoxTitle().find('span'), {
|
184
|
+
'color': css.color.flyoutTitle,
|
185
|
+
'font-size': css.fontSize.default,
|
186
|
+
'font-weight': css.fontWeight.bold
|
187
|
+
});
|
188
|
+
utilities.verifyCSS(textSelectionPage.dialogBoxContent(), {
|
189
|
+
'color': css.color.labels,
|
190
|
+
'font-size': css.fontSize.default,
|
191
|
+
'font-weight': css.fontWeight.regular
|
192
|
+
});
|
193
|
+
utilities.verifyCSS(textSelectionPage.buttonAccept(), {
|
194
|
+
'color': css.color.primaryBtn,
|
195
|
+
'font-size': css.fontSize.default,
|
196
|
+
'font-weight': css.fontWeight.regular,
|
197
|
+
'background-color': css.color.primaryBtnBg
|
198
|
+
});
|
199
|
+
utilities.verifyCSS(textSelectionPage.buttonReject(), {
|
200
|
+
'color': css.color.secondaryBtn,
|
201
|
+
'font-size': css.fontSize.default,
|
202
|
+
'font-weight': css.fontWeight.regular,
|
203
|
+
'background-color': css.color.secondaryBtnBg
|
204
|
+
});
|
205
|
+
});
|
206
|
+
|
207
|
+
it('Accessibility of Clear popup', { tags: 'a11y' }, () => {
|
208
|
+
cy.checkAccessibility(textSelectionPage.dialogBox());
|
209
|
+
});
|
210
|
+
|
211
|
+
it('When user clicks on \'Cancel\' button of the Clear popup, then the popup should be closed and the earlier state of selected options should persist', () => {
|
212
|
+
textSelectionPage.steps.clickOnRejectButtonInDialogBox();
|
213
|
+
utilities.verifyElementVisibilityState(textSelectionPage.dialogBox(), 'notExist');
|
214
|
+
textSelectionPage.steps.verifyOptionIsSelectedInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
|
215
|
+
textSelectionPage.steps.verifyOptionIsSelectedInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
|
216
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
|
217
|
+
});
|
218
|
+
|
219
|
+
it('When user clicks on \'Confirm\' button of the Clear popup, then the popup should be closed and all the selected options should be deselected and the specify possible options field should be in errored state with the error message \'Error: Minimum one highlight option is required.\'', () => {
|
220
|
+
cy.log('Pre-step: Again clicking on Clear button to open Clear popup');
|
221
|
+
textSelectionPage.steps.clickOnClearOptionsButtonInSpecifyPossibleOptionSection();
|
222
|
+
textSelectionPage.steps.clickOnAcceptButtonInDialogBox();
|
223
|
+
for (let arrayIndex = 0; arrayIndex < paragraphTextArray.length; arrayIndex++) {
|
224
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(paragraphTextArray[arrayIndex]);
|
225
|
+
}
|
226
|
+
utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Minimum one highlight option is required.');
|
227
|
+
textSelectionPage.steps.verifyErroredStateOfSpecifyPossibleOptionsSection();
|
228
|
+
});
|
229
|
+
|
230
|
+
textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
|
231
|
+
|
232
|
+
it('When user click on a deselected option, the option should be selected and the error message should disappear and option counter should display 1 count', () => {
|
233
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Paragraph', paragraphTextArray[0]);
|
234
|
+
utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
|
235
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
236
|
+
});
|
237
|
+
});
|
238
|
+
|
239
|
+
describe('Specify possible options section: Sentence', () => {
|
240
|
+
abortEarlySetup();
|
241
|
+
before(() => {
|
242
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
243
|
+
cy.barsPreLoaderWait();
|
244
|
+
textSelectionPage.steps.clearQuestionInputField();
|
245
|
+
paragraphTextArray.forEach((paragraphText) => {
|
246
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
247
|
+
});
|
248
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
249
|
+
});
|
250
|
+
|
251
|
+
it('User should be able to switch to \'Sentence\' in text selection dropdown.', () => {
|
252
|
+
textSelectionPage.steps.switchTextSelectionMode('Sentence');
|
253
|
+
});
|
254
|
+
|
255
|
+
it('When user has selected \'Sentence\' text selection mode, then \'Select all\' button should be displayed', () => {
|
256
|
+
textSelectionPage.steps.verifySelectAllOptionsButtonIsDisplayed();
|
257
|
+
});
|
258
|
+
|
259
|
+
it('When user has switched to \'Sentence\' text selection type, the previously added input should be divided into options as per \'Sentence\' text selection type and all the options should be in deselected state', () => {
|
260
|
+
utilities.verifyElementCount(textSelectionPage.selectedOptionSpecifyPossibleOptions(), 0);
|
261
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextSpans(), 4);
|
262
|
+
textSelectionPage.steps.verifyNumberOfOptionsInAParagraphInSpecifyPossibleOptionsSection(0, 2);
|
263
|
+
sentenceTextArray.forEach((sentenceText, index) => {
|
264
|
+
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), sentenceText);
|
265
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(sentenceText);
|
266
|
+
});
|
267
|
+
});
|
268
|
+
|
269
|
+
it('The option count should be displayed as per the number of \'Sentence\'.', () => {
|
270
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(0);
|
271
|
+
});
|
272
|
+
|
273
|
+
it('When user clicks on an option, then the option should be selected and the option count should increase by 1.', () => {
|
274
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Sentence', sentenceTextArray[0])
|
275
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Sentence', sentenceTextArray[1])
|
276
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(sentenceTextArray[2]);
|
277
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(sentenceTextArray[3]);
|
278
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(2);
|
279
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyPossibleOptionSection(sentenceTextArray[0], 'blue');
|
280
|
+
});
|
281
|
+
|
282
|
+
it('When user clicks on a selected option, then that option should be deselected and option count should decrease by 1', () => {
|
283
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Paragraph', sentenceTextArray[1]);
|
284
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
285
|
+
});
|
286
|
+
|
287
|
+
it('When the user hovers over the deselected option, then that option should be displayed in hover state', () => {
|
288
|
+
textSelectionPage.steps.verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection(sentenceTextArray[2], 'blue');
|
289
|
+
});
|
290
|
+
|
291
|
+
it('When user clears all selected options with the \'Clear\' button, then all the selected options should be deselected and the specify possible options field should be in errored state with the error message \'Error: Minimum one highlight option is required.\'', () => {
|
292
|
+
textSelectionPage.steps.clearSelectedOptionsInSpecifyPossibleOptionSection();
|
293
|
+
utilities.verifyElementVisibilityState(textSelectionPage.selectedOptionSpecifyPossibleOptions(), 'notExist');
|
294
|
+
utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Minimum one highlight option is required.');
|
295
|
+
textSelectionPage.steps.verifyErroredStateOfSpecifyPossibleOptionsSection();
|
296
|
+
});
|
297
|
+
|
298
|
+
textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
|
299
|
+
|
300
|
+
it('When user click on a deselected option, the option should be selected and the error message should disappear and option counter should display 1 count', () => {
|
301
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Sentence', sentenceTextArray[0])
|
302
|
+
utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
|
303
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
304
|
+
});
|
305
|
+
});
|
306
|
+
|
307
|
+
describe('Specify possible options section: Word', () => {
|
308
|
+
abortEarlySetup();
|
309
|
+
before(() => {
|
310
|
+
textSelectionPage.steps.navigateToCreateQuestion('text selection');
|
311
|
+
cy.barsPreLoaderWait();
|
312
|
+
textSelectionPage.steps.clearQuestionInputField();
|
313
|
+
paragraphTextArray.forEach((paragraphText) => {
|
314
|
+
textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
|
315
|
+
});
|
316
|
+
textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
|
317
|
+
});
|
318
|
+
|
319
|
+
it('User should be able to switch to \'Word\' in text selection dropdown.', () => {
|
320
|
+
textSelectionPage.steps.switchTextSelectionMode('Word');
|
321
|
+
});
|
322
|
+
|
323
|
+
it('When user has selected \'Word\' text selection mode, then \'Select all\' button should be displayed', () => {
|
324
|
+
textSelectionPage.steps.verifySelectAllOptionsButtonIsDisplayed();
|
325
|
+
});
|
326
|
+
|
327
|
+
it('When user has switched to \'Word\' text selection type, the previously added input should be divided into options as per \'Word\' text selection type and all the options should be in deselected state', () => {
|
328
|
+
utilities.verifyElementCount(textSelectionPage.optionSpecifyCorrectAnswer(), 0);
|
329
|
+
utilities.verifyElementCount(textSelectionPage.specifyPossibleOptionsTextParagraphs(), 3);
|
330
|
+
utilities.verifyElementCount(textSelectionPage.specifyCorrectAnswerTextSpans(), 23);
|
331
|
+
textSelectionPage.steps.verifyNumberOfOptionsInAParagraphInSpecifyPossibleOptionsSection(0, 11);
|
332
|
+
textSelectionPage.steps.verifyNumberOfOptionsInAParagraphInSpecifyPossibleOptionsSection(1, 4);
|
333
|
+
textSelectionPage.steps.verifyNumberOfOptionsInAParagraphInSpecifyPossibleOptionsSection(2, 8);
|
334
|
+
wordTextArray.forEach((wordText, index) => {
|
335
|
+
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.specifyCorrectAnswerTextSpans(), index), wordText);
|
336
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(wordText);
|
337
|
+
});
|
338
|
+
});
|
339
|
+
|
340
|
+
it('The option count should be displayed as per the number of \'Word\'.', () => {
|
341
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
342
|
+
});
|
343
|
+
|
344
|
+
it('When user clicks on an option, then the option should be selected and the option count should increase by 1.', () => {
|
345
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Word', wordTextArray[0])
|
346
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Word', wordTextArray[1])
|
347
|
+
for (let arrayIndex = 2; arrayIndex < wordTextArray.length; arrayIndex++) {
|
348
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(wordTextArray[arrayIndex]);
|
349
|
+
}
|
350
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(2);
|
351
|
+
textSelectionPage.steps.verifySelectedStateOptionInSpecifyPossibleOptionSection(wordTextArray[0], 'blue');
|
352
|
+
});
|
353
|
+
|
354
|
+
it('When user clicks on a selected option, then that option should be deselected and option count should decrease by 1', () => {
|
355
|
+
textSelectionPage.steps.deselectOptionInSpecifyPossibleOptionsSection('Paragraph', wordTextArray[1]);
|
356
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
357
|
+
});
|
358
|
+
|
359
|
+
it('When the user hovers over the deselected option, then that option should be displayed in hover state', () => {
|
360
|
+
textSelectionPage.steps.verifyHoverStateOfDeselectedOptionInSpecifyPossibleOptionsSection(wordTextArray[2], 'blue');
|
361
|
+
});
|
362
|
+
|
363
|
+
it('When user clears all selected options with the \'Clear\' button, then all the selected options should be deselected and the specify possible options field should be in errored state with the error message \'Error: Minimum one highlight option is required.\'', () => {
|
364
|
+
textSelectionPage.steps.clearSelectedOptionsInSpecifyPossibleOptionSection();
|
365
|
+
for (let arrayIndex = 0; arrayIndex < sentenceTextArray.length; arrayIndex++) {
|
366
|
+
textSelectionPage.steps.verifyOptionIsNotSelectedInSpecifyPossibleOptionsSection(wordTextArray[arrayIndex]);
|
367
|
+
}
|
368
|
+
utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Minimum one highlight option is required.');
|
369
|
+
textSelectionPage.steps.verifyErroredStateOfSpecifyPossibleOptionsSection();
|
370
|
+
});
|
371
|
+
|
372
|
+
textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
|
373
|
+
|
374
|
+
it('When user click on a deselected option, the option should be selected and the error message should disappear and option counter should display 1 count', () => {
|
375
|
+
textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Word', wordTextArray[0]);
|
376
|
+
utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
|
377
|
+
textSelectionPage.steps.verifyOptionCounterTextAndValue(1);
|
378
|
+
});
|
379
|
+
});
|
380
|
+
});
|