itemengine-cypress-automation 1.0.197 → 1.0.198
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/ImageHighlight/editTabScoring.js +355 -0
- package/cypress/e2e/ILC/ImageHighlight/headerSection.js +83 -0
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +205 -0
- package/cypress/e2e/ILC/ImageHighlight/specifyCorrectAnswerSection.js +92 -0
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +404 -0
- package/cypress/e2e/ILC/ImageHighlight/supportedFileTypes.js +42 -0
- package/cypress/e2e/ILC/ImageHighlight/toolSettings.js +73 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/editTabScoring.js +253 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsBasic.js +114 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +288 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialEqualWeightsBasic.js +164 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/previewContentsForAllViews.smoke.js +168 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/setPointsPopup.js +83 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/specifyCorrectAnswerSection.js +114 -0
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/studentViewSettings.js +179 -0
- package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +5 -21
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +3 -37
- package/cypress/e2e/ILC/VideoResponseNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -1
- package/cypress/pages/components/enableOuterBorderComponent.js +16 -2
- package/cypress/pages/components/index.js +3 -1
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/components/setPointsPopupBase.js +7 -10
- package/cypress/pages/components/showAvailableOptionsToStudents.js +76 -0
- package/cypress/pages/components/showStudentMaximumNumberOfPossibleSelections.js +56 -0
- package/cypress/pages/imageHighlightPage.js +434 -4
- package/cypress/pages/listOrderingPage.js +287 -43
- package/cypress/pages/textSelectionPage.js +6 -71
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import constants from "../fixtures/constants";
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
|
-
import { autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, commonComponents, correctIncorrectAnswerLabelComponent, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, randomizeOptionsComponent, scoringSectionBaseEditTab, studentViewSettingsLabelComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent } from "./components"
|
3
|
+
import { autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, commonComponents, correctIncorrectAnswerLabelComponent, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, randomizeOptionsComponent, scoringSectionBaseEditTab, studentViewSettingsLabelComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, enableOuterBorderComponent } from "./components"
|
4
4
|
const options = ['sprout', 'plant', 'flower', 'seed'];
|
5
5
|
const css = Cypress.env('css');
|
6
6
|
|
@@ -14,21 +14,21 @@ const selectors = {
|
|
14
14
|
...additionalSettingsPanel,
|
15
15
|
...correctIncorrectAnswerLabelComponent,
|
16
16
|
...autoScoredSpecifyCorrectAnswerSection,
|
17
|
+
...enableOuterBorderComponent,
|
17
18
|
//Specify correct answer section
|
18
19
|
optionSpecifyCorrectAnswerSection: () => cy.get('.list-ordering-set-correct-answer .draggable-item-wrapper[role="button"]'),
|
19
20
|
optionWrapperSpecifyCorrectAnswerSection: () => cy.get('[class*="ListOrderingResponsestyles__DroppableWrapper"]'),
|
20
21
|
partialDifferentWeightsPointsLabel: () => cy.get('.partial-points-per-response-label'),
|
21
22
|
pointsPerResponseValue: () => cy.get('.alternate-points-points-per-value-span'),
|
22
|
-
|
23
|
-
enableOuterBorderForQuestionLabel: () => cy.get('[data-ngie-testid*="enable-outer-border-for-question-checkbox"] .MuiFormControlLabel-label'),
|
24
|
-
enableOuterBorderForQuestionCheckbox: () => cy.get('[data-ngie-testid*="enable-outer-border-for-question-checkbox"] input'),
|
23
|
+
draggableOptionDragIcon: () => cy.get('.drag-indicator-icon'),
|
25
24
|
//Preview Tab
|
26
25
|
optionPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .draggable-item-wrapper[role="button"]'),
|
27
26
|
optionWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .orderlist-option-wrapper'),
|
28
|
-
correctAnswersLabel: () => cy.get('
|
27
|
+
correctAnswersLabel: () => cy.get('[class*="CorrectAnswerstyles__CorrectAnswerLabel"]'),
|
29
28
|
correctAnswerSectionAnswerWrapper: () => cy.get('[class*="CorrectAnswers"] [class*="__OptionsWrapper"]'),
|
30
29
|
correctAnswerSectionWrapper: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"]'),
|
31
30
|
correctAnswerSectionAnswerText: () => cy.get('.question-text-wrapper'),
|
31
|
+
correctAnswerSectionIconWrapper: () => cy.get('[class*="CorrectAnswerstyles__IconWrapper"]'),
|
32
32
|
questionBorderPreviewTab: () => cy.get('[class*="ListOrderingResponsestyles__DroppableDiv"]'),
|
33
33
|
//grading view and correct answer view
|
34
34
|
optionGradingView: () => cy.get('[class*="DraggableItemsWrapper"] [class*="OptionTextWrapper"]'),
|
@@ -68,7 +68,16 @@ const selectors = {
|
|
68
68
|
positionDropdownPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-dropdown-wrapper [role="combobox"]'),
|
69
69
|
positionDropdownCorrectAnswerSection: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"] .response-dropdown-wrapper [role="combobox"]'),
|
70
70
|
dropdownWrapperCorrectAnswerSection: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"] [class*="DropdownLayoutstyles__ResponseWrapper"]'),
|
71
|
-
alertMessage: () => cy.get('[class*="ListOrderingResponsestyles__DisabledWrapper"]')
|
71
|
+
alertMessage: () => cy.get('[class*="ListOrderingResponsestyles__DisabledWrapper"]'),
|
72
|
+
|
73
|
+
//horizontal orientation
|
74
|
+
horizontalOptionSpecifyCorrectAnswerSection: () => cy.get('.horizontal-drag-item-wrapper'),
|
75
|
+
horizontalOptionPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .horizontal-drag-item-wrapper'),
|
76
|
+
|
77
|
+
//set points popup
|
78
|
+
setPointsButton: () => cy.get('.list-ordering-set-correct-answer button'),
|
79
|
+
optionWrapperSetPointsPopup: () => cy.get('[class*="OptionContainerstyle__OptionsWrapper"]'),
|
80
|
+
pointsLabelSetPointsPopup: () => cy.get('.dialog-content [class*="PointsLabel-"]')
|
72
81
|
}
|
73
82
|
|
74
83
|
const steps = {
|
@@ -84,6 +93,7 @@ const steps = {
|
|
84
93
|
...randomizeOptionsComponent.steps,
|
85
94
|
...commonComponents.steps,
|
86
95
|
...additionalSettingsPanel.steps,
|
96
|
+
...enableOuterBorderComponent.steps,
|
87
97
|
/**
|
88
98
|
* @param {string} optionsText text content of the option
|
89
99
|
* @param {number} targetIndex the position at which the options is being dropped
|
@@ -345,28 +355,6 @@ const steps = {
|
|
345
355
|
.and('match', /0px none/);
|
346
356
|
},
|
347
357
|
|
348
|
-
verifyEnableOuterBorderForQuestionCheckboxCheckedState: () => {
|
349
|
-
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
350
|
-
.should('be.checked');
|
351
|
-
},
|
352
|
-
|
353
|
-
verifyEnableOuterBorderForQuestionCheckboxUncheckedState: () => {
|
354
|
-
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
355
|
-
.should('not.be.checked');
|
356
|
-
},
|
357
|
-
|
358
|
-
checkEnableOuterBorderForQuestionCheckbox: () => {
|
359
|
-
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
360
|
-
.click()
|
361
|
-
.should('be.checked');
|
362
|
-
},
|
363
|
-
|
364
|
-
uncheckEnableOuterBorderForQuestionCheckbox: () => {
|
365
|
-
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
366
|
-
.click()
|
367
|
-
.should('not.be.checked');
|
368
|
-
},
|
369
|
-
|
370
358
|
/**
|
371
359
|
* @description Verifies that the image in the Specify Correct Answer section has the correct source and alt text.
|
372
360
|
* @param {number} index - The index of the option in the Specify Correct Answer section.
|
@@ -592,6 +580,26 @@ const steps = {
|
|
592
580
|
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.dropdownOptionWrapperGradingView(), index), optionsText);
|
593
581
|
},
|
594
582
|
|
583
|
+
verifyCorrectOptionIconsDropdownLayoutCorrectAnswersSectionNotExists: () => {
|
584
|
+
listOrderingPage.dropdownWrapperCorrectAnswerSection()
|
585
|
+
.each(($element) => {
|
586
|
+
cy.wrap($element)
|
587
|
+
.within(() => {
|
588
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'notExist');
|
589
|
+
})
|
590
|
+
})
|
591
|
+
},
|
592
|
+
|
593
|
+
verifyCorrectOptionIconsDropdownLayoutCorrectAnswersSection: () => {
|
594
|
+
listOrderingPage.dropdownWrapperCorrectAnswerSection()
|
595
|
+
.each(($element) => {
|
596
|
+
cy.wrap($element)
|
597
|
+
.within(() => {
|
598
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
599
|
+
})
|
600
|
+
})
|
601
|
+
},
|
602
|
+
|
595
603
|
/**
|
596
604
|
* @param {string[]} optionsTextArray array of options in the correct answer section
|
597
605
|
* @description this function verifies the correct order of options in correct answer section
|
@@ -724,25 +732,249 @@ const steps = {
|
|
724
732
|
.should('not.have.text', '')
|
725
733
|
.and('not.have.text', previousOrderOfOptionsArray.join(''));
|
726
734
|
},
|
735
|
+
/**
|
736
|
+
* Selects the orientation option on the list ordering page.
|
737
|
+
* @param {'Vertical' | 'Horizontal'} orientationOption - The orientation option to select.
|
738
|
+
*/
|
739
|
+
selectOptionOrientation: (orientationOption) => {
|
740
|
+
switch (orientationOption) {
|
741
|
+
case 'Vertical':
|
742
|
+
listOrderingPage.verticalButton()
|
743
|
+
.click()
|
744
|
+
.should('have.class', 'single-select-toggle-button-selected');
|
745
|
+
break;
|
746
|
+
case 'Horizontal':
|
747
|
+
listOrderingPage.horizontalButton()
|
748
|
+
.click()
|
749
|
+
.should('have.class', 'single-select-toggle-button-selected');
|
750
|
+
break;
|
751
|
+
}
|
752
|
+
},
|
727
753
|
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
})
|
735
|
-
})
|
754
|
+
/**
|
755
|
+
* @param {string[]} optionsTextArray options array for set correct answer options
|
756
|
+
* @description this function verifies options text content in the horizontal orientation
|
757
|
+
*/
|
758
|
+
verifyTextContentOfHorizontalOptionInSpecifyCorrectAnswerSection: (optionsText, index) => {
|
759
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.horizontalOptionSpecifyCorrectAnswerSection(), index), optionsText);
|
736
760
|
},
|
737
761
|
|
738
|
-
|
739
|
-
|
762
|
+
/**
|
763
|
+
* @param {string} optionsText text content of the option
|
764
|
+
* @param {number} targetIndex the position at which the options is being dropped
|
765
|
+
* @description click and drop a option into a position in the specify correct answer section in the horizontal orientation
|
766
|
+
*/
|
767
|
+
clickAndReorderHorizontalOptionInSpecifyCorrectAnswerSection: (optionsText, targetIndex) => {
|
768
|
+
listOrderingPage.horizontalOptionSpecifyCorrectAnswerSection()
|
769
|
+
.contains(optionsText)
|
770
|
+
.click();
|
771
|
+
listOrderingPage.horizontalOptionSpecifyCorrectAnswerSection()
|
772
|
+
.eq(targetIndex)
|
773
|
+
.click();
|
774
|
+
},
|
775
|
+
|
776
|
+
/**
|
777
|
+
* @param {string} optionsText text content of the option
|
778
|
+
* @param {number} targetIndex the position at which the options is being dropped
|
779
|
+
* @description click and drop a option into a position in the preview tab in the horizontal orientation
|
780
|
+
*/
|
781
|
+
clickAndReorderHorizontalOptionInPreviewTab: (optionsText, targetIndex) => {
|
782
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
783
|
+
.contains(optionsText)
|
784
|
+
.click();
|
785
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
786
|
+
.eq(targetIndex)
|
787
|
+
.click();
|
788
|
+
},
|
789
|
+
|
790
|
+
/**
|
791
|
+
* Verifies the order of options in the "Specify Correct Answer" section.
|
792
|
+
* @param {string[]} optionsTextArray - An array containing the text of options in the expected order for horizontal orientation.
|
793
|
+
*/
|
794
|
+
verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection: (optionsTextArray) => {
|
795
|
+
optionsTextArray.forEach((option, index) => {
|
796
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.horizontalOptionSpecifyCorrectAnswerSection(), index), option);
|
797
|
+
});
|
798
|
+
},
|
799
|
+
|
800
|
+
/**
|
801
|
+
* Verifies the order of options in the preview tab
|
802
|
+
* @param {string[]} optionsTextArray - An array containing the text of options in the expected order for horizontal orientation.
|
803
|
+
*/
|
804
|
+
verifyHorizontalOptionsOrderInPreviewTab: (optionsTextArray) => {
|
805
|
+
optionsTextArray.forEach((option, index) => {
|
806
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.horizontalOptionPreviewTab(), index), option);
|
807
|
+
});
|
808
|
+
},
|
809
|
+
|
810
|
+
getHorizontalOptionsArray: () => {
|
811
|
+
const optionsArray = []
|
812
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
813
|
+
.each(($el) => {
|
814
|
+
cy.wrap($el)
|
815
|
+
.invoke('text')
|
816
|
+
.then((text) => {
|
817
|
+
optionsArray.push(text);
|
818
|
+
});
|
819
|
+
});
|
820
|
+
return optionsArray;
|
821
|
+
},
|
822
|
+
|
823
|
+
/**
|
824
|
+
* @param {string[]} optionsArray array of options set in the options section
|
825
|
+
* @description this function verifies if the options are Randomized in the preview tab for horizontal option orientation
|
826
|
+
*/
|
827
|
+
verifyRandomizeHorizontalOptionOrder: (optionsArray) => {
|
828
|
+
let currentOptionsArray = [...optionsArray]
|
829
|
+
for (let index = 0; index < currentOptionsArray.length; index++) {
|
830
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
831
|
+
.eq(index)
|
832
|
+
.then(($element) => {
|
833
|
+
expect($element.text()).to.be.oneOf(currentOptionsArray);
|
834
|
+
currentOptionsArray = currentOptionsArray.filter((value) => value !== $element.text())
|
835
|
+
});
|
836
|
+
};
|
837
|
+
listOrderingPage.steps.verifyHorizontalOptionsAreReRandomized(optionsArray)
|
838
|
+
},
|
839
|
+
|
840
|
+
/**
|
841
|
+
* @param {string[]} previousOrderOfOptionsArray array of previous order of options
|
842
|
+
* @description this function verifies that the order of the options is different from the previous order for horizontal option orientation
|
843
|
+
*/
|
844
|
+
verifyHorizontalOptionsAreReRandomized: (previousOrderOfOptionsArray) => {
|
845
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
846
|
+
.should('not.have.text', '')
|
847
|
+
.and('not.have.text', previousOrderOfOptionsArray.join(''));
|
848
|
+
},
|
849
|
+
|
850
|
+
//Note: Update the below functions when https://redmine.zeuslearning.com/issues/571751 gets resolved
|
851
|
+
/**
|
852
|
+
* @param {string} optionsText option to be checked for the correct icon
|
853
|
+
* @description This function verifies the correct icon in the preview tab for an option in horizontal option orientation
|
854
|
+
*/
|
855
|
+
verifyCorrectOptionIconHorizontalOrientation: (optionsText) => {
|
856
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
857
|
+
.contains(optionsText)
|
858
|
+
.parents('[id*="choice"][role]')
|
859
|
+
.prev('.tick-icon-wrapper')
|
860
|
+
.then(($element) => {
|
861
|
+
expect($element[0].className.includes('icon-correct')).to.be.true;
|
862
|
+
});
|
863
|
+
},
|
864
|
+
|
865
|
+
/**
|
866
|
+
* @param {string} optionsText option to be checked for the correct icon
|
867
|
+
* @description This function verifies the correct icon in the preview tab for an option in horizontal option orientation
|
868
|
+
*/
|
869
|
+
verifyIncorrectOptionIconHorizontalOrientation: (optionsText) => {
|
870
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
871
|
+
.contains(optionsText)
|
872
|
+
.parents('[id*="choice"][role]')
|
873
|
+
.prev('.tick-icon-wrapper')
|
874
|
+
.then(($element) => {
|
875
|
+
expect($element[0].className.includes('icon-incorrect')).to.be.true;
|
876
|
+
});
|
877
|
+
},
|
878
|
+
|
879
|
+
verifyCorrectOptionIconsCorrectAnswerSection: () => {
|
880
|
+
listOrderingPage.correctAnswerSectionIconWrapper()
|
740
881
|
.each(($element) => {
|
741
|
-
cy.wrap($element)
|
742
|
-
.
|
743
|
-
|
744
|
-
|
745
|
-
|
882
|
+
cy.wrap($element).within(() => {
|
883
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
884
|
+
});
|
885
|
+
});
|
886
|
+
},
|
887
|
+
|
888
|
+
clickOnSetPointsButton: () => {
|
889
|
+
listOrderingPage.setPointsButton()
|
890
|
+
.click()
|
891
|
+
},
|
892
|
+
|
893
|
+
/**
|
894
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
895
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
896
|
+
*/
|
897
|
+
verifyImageOptionInSetPointsPopup: (optionIndex) => {
|
898
|
+
listOrderingPage.optionWrapperSetPointsPopup()
|
899
|
+
.eq(optionIndex)
|
900
|
+
.find('img')
|
901
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
902
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
903
|
+
},
|
904
|
+
|
905
|
+
/**
|
906
|
+
* @description Verifies that the bold text in the Preview tab is correct.
|
907
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
908
|
+
*/
|
909
|
+
verifyBoldTextOptionInSetPointsPopup: (optionIndex) => {
|
910
|
+
listOrderingPage.optionWrapperSetPointsPopup()
|
911
|
+
.eq(optionIndex)
|
912
|
+
.find('strong')
|
913
|
+
.should('have.text', 'This is a bold option');
|
914
|
+
},
|
915
|
+
|
916
|
+
/**
|
917
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
918
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
919
|
+
*/
|
920
|
+
verifyEquationOptionInSetPointsPopup: (optionIndex) => {
|
921
|
+
listOrderingPage.optionWrapperSetPointsPopup()
|
922
|
+
.eq(optionIndex)
|
923
|
+
.find('[role="math"]')
|
924
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
925
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
926
|
+
},
|
927
|
+
|
928
|
+
/**
|
929
|
+
* Verifies the text content of a specified option in the "Set Points" popup.
|
930
|
+
* @param {number} optionIndex - The index of the option to verify (0-based).
|
931
|
+
* @param {string} textContent - The expected text content of the option.
|
932
|
+
*/
|
933
|
+
verifyTextContentOfOptionInSetPointsPopup: (optionIndex, textContent) => {
|
934
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.optionWrapperSetPointsPopup(), optionIndex), textContent);
|
935
|
+
},
|
936
|
+
|
937
|
+
/**
|
938
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
939
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
940
|
+
*/
|
941
|
+
verifyHorizontalOptionWithImageInPreviewTab: (optionIndex) => {
|
942
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
943
|
+
.eq(optionIndex)
|
944
|
+
.find('img')
|
945
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
946
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
947
|
+
},
|
948
|
+
|
949
|
+
/**
|
950
|
+
* @description Verifies that the bold text in the Preview tab is correct.
|
951
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
952
|
+
*/
|
953
|
+
verifyHorizontalOptionWithBoldTextInPreviewTab: (optionIndex) => {
|
954
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
955
|
+
.eq(optionIndex)
|
956
|
+
.find('strong')
|
957
|
+
.should('have.text', 'This is a bold option');
|
958
|
+
},
|
959
|
+
|
960
|
+
/**
|
961
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
962
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
963
|
+
*/
|
964
|
+
verifyHorizontalOptionWithEquationTextInPreviewTab: (optionIndex) => {
|
965
|
+
listOrderingPage.horizontalOptionPreviewTab()
|
966
|
+
.eq(optionIndex)
|
967
|
+
.find('[role="math"]')
|
968
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
969
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
970
|
+
},
|
971
|
+
|
972
|
+
/**
|
973
|
+
* @param {string[]} optionsTextArray options array for preview tab options
|
974
|
+
* @description this function verifies options text content
|
975
|
+
*/
|
976
|
+
verifyTextContentOfHorizontalOptionInPreviewTab: (optionsText, index) => {
|
977
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.horizontalOptionPreviewTab(), index), optionsText);
|
746
978
|
}
|
747
979
|
}
|
748
980
|
|
@@ -760,11 +992,13 @@ const tests = {
|
|
760
992
|
...additionalSettingsPanel.tests,
|
761
993
|
...additionalSettingsAccessibilitySectionComponent.tests,
|
762
994
|
...createQuestionBasePage.tests,
|
995
|
+
...enableOuterBorderComponent.tests,
|
763
996
|
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
764
997
|
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
765
998
|
utilities.verifyElementCount(listOrderingPage.optionSpecifyCorrectAnswerSection(), 4);
|
766
999
|
options.forEach((optionText, index) => {
|
767
1000
|
listOrderingPage.steps.verifyTextContentOfOptionInSpecifyCorrectAnswerSection(optionText, index);
|
1001
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(listOrderingPage.draggableOptionDragIcon(), index * 2), 'visible');
|
768
1002
|
});
|
769
1003
|
});
|
770
1004
|
},
|
@@ -777,6 +1011,16 @@ const tests = {
|
|
777
1011
|
});
|
778
1012
|
});
|
779
1013
|
},
|
1014
|
+
|
1015
|
+
verifyContentsOfSpecifyCorrectAnswerSectionHorizontalOrientation: () => {
|
1016
|
+
it('By default, 4 options in horizontal orientation in the specify correct answer section', () => {
|
1017
|
+
utilities.verifyElementCount(listOrderingPage.horizontalOptionSpecifyCorrectAnswerSection(), 4);
|
1018
|
+
options.forEach((optionText, index) => {
|
1019
|
+
listOrderingPage.steps.verifyTextContentOfHorizontalOptionInSpecifyCorrectAnswerSection(optionText, index);
|
1020
|
+
utilities.verifyElementVisibilityState(listOrderingPage.draggableOptionDragIcon(), 'visible');
|
1021
|
+
});
|
1022
|
+
});
|
1023
|
+
},
|
780
1024
|
}
|
781
1025
|
|
782
1026
|
export const listOrderingPage = {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import constants from "../fixtures/constants";
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
|
-
import { createQuestionBasePage, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, questionInstructionsComponent, autoScoredStudentViewSettings, correctIncorrectAnswerLabelComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, setPointsPopupBase, commonComponents, ckEditorToolbar, equationEditorFlyout, studentViewSettingsLabelComponent, enableOuterBorderComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, colorPopupComponent } from "./components";
|
3
|
+
import { createQuestionBasePage, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, questionInstructionsComponent, autoScoredStudentViewSettings, correctIncorrectAnswerLabelComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, setPointsPopupBase, commonComponents, ckEditorToolbar, equationEditorFlyout, studentViewSettingsLabelComponent, enableOuterBorderComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, colorPopupComponent, showAvailableOptionsToStudents, showStudentMaximumNumberOfPossibleSelections } from "./components";
|
4
4
|
import { dialogBoxBase } from "./dialogBoxBase";
|
5
5
|
const css = Cypress.env('css');
|
6
6
|
const colorLibrary = css.textSelectionColorLibrary;
|
@@ -17,6 +17,8 @@ const selectors = {
|
|
17
17
|
...additionalSettingsPanel,
|
18
18
|
...correctIncorrectAnswerLabelComponent,
|
19
19
|
...colorPopupComponent,
|
20
|
+
...showAvailableOptionsToStudents,
|
21
|
+
...showStudentMaximumNumberOfPossibleSelections,
|
20
22
|
questionLabel: () => cy.get('[class*="Highlightstyles__QuestionComponentWrapper"] .title-casing'),
|
21
23
|
questionInputField: () => cy.get('[class*="Highlightstyles__QuestionComponentWrapper"] [title="Question"]'),
|
22
24
|
specifyPossibleOptionsTextFieldWrapper: () => cy.get('[class*="Highlightstyles__HighLightWrapper"] .question-text-wrapper'),
|
@@ -52,20 +54,8 @@ const selectors = {
|
|
52
54
|
specifyCorrectAnswerTextParagraphs: () => cy.get('[class*="Highlightstyles__Wrapper"] p'),
|
53
55
|
optionSpecifyCorrectAnswer: () => cy.get('[class*="Highlightstyles__Wrapper"] .highlighted'),
|
54
56
|
setPointsButton: () => cy.get('[class*="SetPointsPopupWrapper"] button'),
|
55
|
-
maximumOptionsCanBeSelectedErrorMessage: () => cy.get('[class*="Highlightstyles__AuthoringErrorMsg"]'),
|
56
|
-
maximumOptionsCanBeSelectedErrorMessagePreviewTab: () => cy.get('[class*="Highlightstyles__ErrorMessage"]'),
|
57
|
-
maximumOptionsCanBeSelectedErrorMessageWrapperPreviewTab: () => cy.get('.preview-selection-limit-error-wrapper'),
|
58
57
|
partialEqualWeightsPointsPerResponseScore: () => cy.get('[class*="Highlightstyles__PartialPointsPerResponseValue"]'),
|
59
58
|
specifyCorrectAnswerErrorMessage: () => cy.get('[class*="ErrorMessageContainer"]').eq(1),
|
60
|
-
//Student view settings
|
61
|
-
showAvailableOptionsToStudentsLabel: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] [class*="label"]'),
|
62
|
-
showAvailableOptionsToStudentsCheckbox: () => cy.get('[data-ngie-testid="show-the-available-options-to-students-checkbox"] input'),
|
63
|
-
maxNumberOfPossibleSelectionsLabel: () => cy.get('#Maximum-number-of-possible-selections-dropdown-label'),
|
64
|
-
maxNumberOfPossibleSelectionsDropdown: () => cy.get('#Maximum-number-of-possible-selections-select'),
|
65
|
-
showStudentMaximumNumberOfPossibleSelectionsCheckbox: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] input'),
|
66
|
-
showStudentMaximumNumberOfPossibleSelectionsLabel: () => cy.get('[data-ngie-testid="show-student-the-maximum-number-of-possible-selections-checkbox"] [class*="label"]'),
|
67
|
-
maximumNumberOfSelectionsHelpText: () => cy.get('[class*="Highlightstyles__LimitWrapper"]'),
|
68
|
-
|
69
59
|
//Style and customization layout
|
70
60
|
filledInStyleLabel: () => cy.get('.text-selection-style-title'),
|
71
61
|
fillColorLabel: () => cy.get('[class*="StyleAndLayoutCustomizationstyles__SubSectionLabel"]'),
|
@@ -106,6 +96,8 @@ const steps = {
|
|
106
96
|
...additionalSettingsPanel.steps,
|
107
97
|
...styleAndLayoutCustomizationAccordionComponent.steps,
|
108
98
|
...colorPopupComponent.steps,
|
99
|
+
...showAvailableOptionsToStudents.steps,
|
100
|
+
...showStudentMaximumNumberOfPossibleSelections.steps,
|
109
101
|
addInputToQuestionInputField: (text) => {
|
110
102
|
textSelectionPage.questionInputField()
|
111
103
|
.type(text);
|
@@ -899,64 +891,6 @@ const steps = {
|
|
899
891
|
});
|
900
892
|
},
|
901
893
|
|
902
|
-
verifyShowAvailableOptionsToStudentsCheckboxIsUnchecked: () => {
|
903
|
-
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
904
|
-
.should('not.be.checked');
|
905
|
-
},
|
906
|
-
|
907
|
-
verifyShowAvailableOptionsToStudentsCheckboxIsChecked: () => {
|
908
|
-
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
909
|
-
.should('be.checked');
|
910
|
-
},
|
911
|
-
|
912
|
-
uncheckShowAvailableOptionsToStudentsCheckbox: () => {
|
913
|
-
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
914
|
-
.click()
|
915
|
-
.should('not.be.checked');
|
916
|
-
},
|
917
|
-
|
918
|
-
checkShowAvailableOptionsToStudentsCheckbox: () => {
|
919
|
-
textSelectionPage.showAvailableOptionsToStudentsCheckbox()
|
920
|
-
.click()
|
921
|
-
.should('be.checked');
|
922
|
-
},
|
923
|
-
|
924
|
-
expandMaxNumberOfPossibleSelectionsDropdown: () => {
|
925
|
-
textSelectionPage.maxNumberOfPossibleSelectionsDropdown()
|
926
|
-
.click();
|
927
|
-
},
|
928
|
-
|
929
|
-
/**
|
930
|
-
* Verify maximum number of possible selections dropdown options
|
931
|
-
* @param {string[]} options array of dropdown options
|
932
|
-
*/
|
933
|
-
verifyMaxNumberOfPossibleSelectionsDropdownListOptions: (options) => {
|
934
|
-
options.forEach((option, count) => {
|
935
|
-
utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.dropdownListOption(), count), option);
|
936
|
-
});
|
937
|
-
},
|
938
|
-
|
939
|
-
/**
|
940
|
-
* @param {string} listOption - The option to be selected from the maximum number of possible selections dropdown
|
941
|
-
* @description Selects an option from the maximum number of possible selections dropdown. The dropdown options are dependent on the number of available options.
|
942
|
-
*/
|
943
|
-
selectOptionFromMaxNumberOfPossibleSelectionsDropdown: (listOption) => {
|
944
|
-
textSelectionPage.dropdownListOption()
|
945
|
-
.contains(listOption)
|
946
|
-
.click();
|
947
|
-
},
|
948
|
-
|
949
|
-
verifyShowStudentTheMaxNumberOfSelectionsCheckboxIsUnchecked: () => {
|
950
|
-
textSelectionPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
|
951
|
-
.should('not.be.checked');
|
952
|
-
},
|
953
|
-
|
954
|
-
checkShowStudentTheMaxNumberOfSelectionsCheckbox: () => {
|
955
|
-
textSelectionPage.showStudentMaximumNumberOfPossibleSelectionsCheckbox()
|
956
|
-
.click()
|
957
|
-
.should('be.checked');
|
958
|
-
},
|
959
|
-
|
960
894
|
clickOnEditColorButton: () => {
|
961
895
|
textSelectionPage.editColorButton()
|
962
896
|
.click();
|
@@ -1037,6 +971,7 @@ const tests = {
|
|
1037
971
|
...additionalSettingsPanel.tests,
|
1038
972
|
...additionalSettingsAccessibilitySectionComponent.tests,
|
1039
973
|
...styleAndLayoutCustomizationAccordionComponent.tests,
|
974
|
+
...showAvailableOptionsToStudents.tests,
|
1040
975
|
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
1041
976
|
it('When user selects a scoring type, then in the \'Correct\' accordion all the contents should be displayed', () => {
|
1042
977
|
textSelectionPage.specifyCorrectAnswerTextSpans()
|