itemengine-cypress-automation 1.0.120 → 1.0.122-updateILCRepo28Feb-2c3e0e3.0
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/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/package.json +2 -2
- 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,4 +1,4 @@
|
|
1
|
-
import { additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredScoringSection, autoScoredScoringSectionMultipleResponsesType, autoScoredSetCorrectAnswerSection, commonComponents, createQuestionBasePage,
|
1
|
+
import { additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredScoringSection, autoScoredScoringSectionMultipleResponsesType, autoScoredSetCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, previewScoringAndShowCorrectAnswerComponent, questionInstructionsComponent, scoringSectionBase } from "./components";
|
2
2
|
import { gridCommonComponents } from "./components/gridCommonComponents";
|
3
3
|
import { studentResponseAndLayoutComponent } from "./components/studentResponseAreaAndLayoutComponent";
|
4
4
|
const css = Cypress.env('css');
|
@@ -254,7 +254,6 @@ const tests = {
|
|
254
254
|
...autoScoredSetCorrectAnswerSection.tests,
|
255
255
|
...autoScoredScoringSection.tests,
|
256
256
|
...scoringSectionBase.tests,
|
257
|
-
...mcqScoringComponent.tests,
|
258
257
|
...commonComponents.tests,
|
259
258
|
...previewScoringAndShowCorrectAnswerComponent.tests,
|
260
259
|
...gridCommonComponents.tests,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import constants from "../fixtures/constants";
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
|
-
import { additionalSettingsPanel, createQuestionBasePage, mcqAdditionalSettingsBase, scoringSectionBaseEditTab, autoScoredSpecifyCorrectAnswerSection,
|
3
|
+
import { additionalSettingsPanel, createQuestionBasePage, mcqAdditionalSettingsBase, scoringSectionBaseEditTab, autoScoredSpecifyCorrectAnswerSection, optionsWrapperComponent, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, lockUnlockOptionComponent, questionInstructionsComponent } from "./components";
|
4
4
|
const css = Cypress.env('css');
|
5
5
|
|
6
6
|
const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
|
@@ -37,7 +37,6 @@ const steps = {
|
|
37
37
|
...additionalSettingsPanel.steps,
|
38
38
|
...scoringSectionBaseEditTab.steps,
|
39
39
|
...autoScoredSpecifyCorrectAnswerSection.steps,
|
40
|
-
...autoScoredScoringSection.steps,
|
41
40
|
...commonComponents.steps,
|
42
41
|
...optionsWrapperComponent.steps,
|
43
42
|
...autoScoredScoringPreviewTab.steps,
|
@@ -48,9 +47,9 @@ const steps = {
|
|
48
47
|
...randomizeOptionsComponent.steps,
|
49
48
|
...lockUnlockOptionComponent.steps,
|
50
49
|
/**
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
* Verifies the contents of an option wrapper in the 'Specify correct answer' section for single selection questions.
|
51
|
+
* @param {number} optionIndex - The index of the option wrapper to be verified.
|
52
|
+
*/
|
54
53
|
verifyOptionWrapperContentsSpecifyCorrectAnswerSection: (optionIndex) => {
|
55
54
|
singleSelectionPage.optionWrapperSpecifyCorrectAnswerSection()
|
56
55
|
.eq(optionIndex)
|
@@ -452,10 +451,10 @@ const tests = {
|
|
452
451
|
...additionalSettingsPanel.tests,
|
453
452
|
...scoringSectionBaseEditTab.tests,
|
454
453
|
...autoScoredSpecifyCorrectAnswerSection.tests,
|
455
|
-
...autoScoredScoringSection.tests,
|
456
454
|
...autoScoredScoringPreviewTab.tests,
|
457
455
|
...optionsWrapperComponent.tests,
|
458
456
|
...commonComponents.tests,
|
457
|
+
...autoScoredStudentViewSettings.tests,
|
459
458
|
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
460
459
|
it('In the \'Correct\' accordion, all options with checkboxes should be displayed', () => {
|
461
460
|
utilities.verifyElementCount(singleSelectionPage.optionWrapperSpecifyCorrectAnswerSection(), 4);
|
@@ -118,6 +118,7 @@ const steps = {
|
|
118
118
|
verifyResponseAccordionIsCollapsed: (responseIndex) => {
|
119
119
|
utilities.getNthElement(textEntryMathPage.responseAccordion(), responseIndex)
|
120
120
|
.find('.ngie-accordion-summary')
|
121
|
+
.eq(0)
|
121
122
|
.should('have.attr', 'aria-expanded', 'false');
|
122
123
|
},
|
123
124
|
|
@@ -128,6 +129,7 @@ const steps = {
|
|
128
129
|
verifyResponseAccordionIsExpanded: (responseIndex) => {
|
129
130
|
utilities.getNthElement(textEntryMathPage.responseAccordion(), responseIndex)
|
130
131
|
.find('.ngie-accordion-summary')
|
132
|
+
.eq(0)
|
131
133
|
.should('have.attr', 'aria-expanded', 'true');
|
132
134
|
},
|
133
135
|
|
@@ -159,6 +161,8 @@ const steps = {
|
|
159
161
|
*/
|
160
162
|
collapseResponseAccordionSpecifyCorrectAnswer: (responseIndex) => {
|
161
163
|
utilities.getNthElement(textEntryMathPage.responseAccordion(), responseIndex)
|
164
|
+
.find('[class*= "expandIconWrapper"]')
|
165
|
+
.eq(0)
|
162
166
|
.click();
|
163
167
|
textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(responseIndex);
|
164
168
|
},
|
@@ -694,23 +698,29 @@ const steps = {
|
|
694
698
|
},
|
695
699
|
|
696
700
|
/**
|
697
|
-
|
698
|
-
|
699
|
-
|
701
|
+
* This function verifies the correct icon for the response field
|
702
|
+
* @param {number} index of the response field
|
703
|
+
*/
|
700
704
|
verifyCorrectResponseIcon: (index) => {
|
701
|
-
textEntryMathPage.
|
705
|
+
textEntryMathPage.responseFieldWrapperPreviewTab()
|
702
706
|
.eq(index)
|
703
|
-
.
|
707
|
+
.within(() => {
|
708
|
+
textEntryMathPage.tickIcon()
|
709
|
+
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
710
|
+
});
|
704
711
|
},
|
705
712
|
|
706
713
|
/**
|
707
|
-
|
708
|
-
|
709
|
-
|
714
|
+
* This function verifies the incorrect icon for the response field
|
715
|
+
* @param {number} index of the response field
|
716
|
+
*/
|
710
717
|
verifyIncorrectResponseIcon: (index) => {
|
711
|
-
textEntryMathPage.
|
718
|
+
textEntryMathPage.responseFieldWrapperPreviewTab()
|
712
719
|
.eq(index)
|
713
|
-
.
|
720
|
+
.within(() => {
|
721
|
+
textEntryMathPage.tickIcon()
|
722
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
723
|
+
});
|
714
724
|
},
|
715
725
|
|
716
726
|
/**
|
@@ -746,6 +756,10 @@ const steps = {
|
|
746
756
|
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'visible');
|
747
757
|
}
|
748
758
|
});
|
759
|
+
},
|
760
|
+
|
761
|
+
verifyAlternativeAnswerAccordionNotExists: () => {
|
762
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.alternativeAnswerAccordion().contains('Alternative 2'), 'notExist');
|
749
763
|
}
|
750
764
|
}
|
751
765
|
|
@@ -764,19 +778,33 @@ const tests = {
|
|
764
778
|
* @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
765
779
|
*/
|
766
780
|
verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
781
|
+
if (accordionName === 'Correct') {
|
782
|
+
it(`By default, no response accordions should be displayed in the ${accordionName} accordion`, () => {
|
783
|
+
utilities.verifyElementCount(textEntryMathPage.responseAccordion(), 0);
|
784
|
+
});
|
785
|
+
|
786
|
+
it('When user adds response tokens in the question section they should be displayed in the \'Specify correct answer\' section in collapsed state', () => {
|
787
|
+
textEntryMathPage.steps.addResponseToken();
|
788
|
+
textEntryMathPage.steps.addResponseToken();
|
789
|
+
utilities.verifyElementCount(textEntryMathPage.responseAccordion(), 2);
|
790
|
+
textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(0);
|
791
|
+
textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(1);
|
792
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.responseAccordionLabel(), 0), 'Response 1');
|
793
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.responseAccordionLabel(), 1), 'Response 2');
|
794
|
+
});
|
795
|
+
}
|
774
796
|
|
775
|
-
it('
|
797
|
+
it('User should be able to expand and collapse the accordions', () => {
|
776
798
|
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
799
|
+
textEntryMathPage.steps.verifyResponseAccordionIsExpanded(0);
|
800
|
+
textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(1);
|
801
|
+
textEntryMathPage.steps.collapseResponseAccordionSpecifyCorrectAnswer(0);
|
802
|
+
textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(0);
|
803
|
+
textEntryMathPage.steps.verifyResponseAccordionIsCollapsed(1);
|
777
804
|
});
|
778
805
|
|
779
806
|
it('When user focuses in and out of the response accordion \'Answer\' input field, \'Error: Answer is required.\' error message should be displayed', () => {
|
807
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
780
808
|
textEntryMathPage.steps.focusInAndFocusOutOfResponseAnswerInputFieldSpecifyCorrectAnswer(0, 0);
|
781
809
|
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
782
810
|
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Answer is required.');
|
@@ -792,10 +820,6 @@ const tests = {
|
|
792
820
|
textEntryMathPage.steps.verifyResponseAccordionIsExpanded(0);
|
793
821
|
});
|
794
822
|
|
795
|
-
it('User should be able to collapse response accordion', () => {
|
796
|
-
textEntryMathPage.steps.collapseResponseAccordionSpecifyCorrectAnswer(1);
|
797
|
-
});
|
798
|
-
|
799
823
|
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
|
800
824
|
|
801
825
|
it(`CSS of ${accordionName} accordion contents`, { tags: 'css' }, () => {
|
@@ -0,0 +1,212 @@
|
|
1
|
+
import { imageCanvasComponent, backgroundImageUploadComponent, questionInstructionsComponent, autoScoredScoringPreviewTab } from "./components"
|
2
|
+
import { textEntryMathPage } from "./textEntryMathPage";
|
3
|
+
import { dialogBoxBase } from "./dialogBoxBase";
|
4
|
+
import utilities from "../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
const selectors = {
|
8
|
+
...backgroundImageUploadComponent,
|
9
|
+
...imageCanvasComponent,
|
10
|
+
...textEntryMathPage,
|
11
|
+
...dialogBoxBase,
|
12
|
+
|
13
|
+
addBackgroundButton: () => cy.get('[data-ngie-testid="add-background-tab"]'),
|
14
|
+
responseFieldPreviewTab: () => cy.get('.image-container .response-input-field'),
|
15
|
+
canvasInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] .image-container'),
|
16
|
+
textAreaPreviewTab: () => cy.get('.label-image-with-text-preview [class*="TextBoxContainer"]'),
|
17
|
+
tickIcon: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
|
18
|
+
responseFieldWrapperPreviewTab: () => cy.get('.cloze-response-wrapper'),
|
19
|
+
responseFieldNumerationPreviewTab: () => cy.get('.image-container .response-input-adornment')
|
20
|
+
}
|
21
|
+
|
22
|
+
const steps = {
|
23
|
+
...backgroundImageUploadComponent.steps,
|
24
|
+
...imageCanvasComponent.steps,
|
25
|
+
...questionInstructionsComponent.steps,
|
26
|
+
...textEntryMathPage.steps,
|
27
|
+
|
28
|
+
addBackground: () => {
|
29
|
+
textEntryMathWithImagePage.addBackgroundButton()
|
30
|
+
.click();
|
31
|
+
},
|
32
|
+
|
33
|
+
verifyResponsePointerStyleInPreviewTab: (style, responseIndex) => {
|
34
|
+
const getPosition = (option) => {
|
35
|
+
switch (option) {
|
36
|
+
case 'Bottom':
|
37
|
+
return { bottom: '50px', left: '-60px' };
|
38
|
+
case 'Bottom right':
|
39
|
+
return { top: '-48px', right: '45px' };
|
40
|
+
case 'Right':
|
41
|
+
return { top: '-24px', right: '53px' };
|
42
|
+
case 'Top right':
|
43
|
+
return { top: '13px', right: '45px' };
|
44
|
+
case 'Top':
|
45
|
+
return { top: '28px', left: '-60px' };
|
46
|
+
case 'Top left':
|
47
|
+
return { top: '12px', left: '23px' };
|
48
|
+
case 'Left':
|
49
|
+
return { top: '-19px', left: '28px' };
|
50
|
+
case 'Bottom left':
|
51
|
+
return { top: '-44px', left: '18px' };
|
52
|
+
}
|
53
|
+
}
|
54
|
+
const expectedPosition = getPosition(style);
|
55
|
+
if (style == 'Bottom') {
|
56
|
+
textEntryMathWithImagePage.responseFieldWrapperPreviewTab()
|
57
|
+
.eq(responseIndex)
|
58
|
+
.should('have.css', 'bottom', expectedPosition.bottom)
|
59
|
+
.and('have.css', 'left', expectedPosition.left);
|
60
|
+
}
|
61
|
+
else if (style == 'Bottom right' || style == 'Right' || style == 'Top right') {
|
62
|
+
textEntryMathWithImagePage.responseFieldWrapperPreviewTab()
|
63
|
+
.eq(responseIndex)
|
64
|
+
.should('have.css', 'top', expectedPosition.top)
|
65
|
+
.and('have.css', 'right', expectedPosition.right);
|
66
|
+
}
|
67
|
+
else if (style == 'None') {
|
68
|
+
textEntryMathWithImagePage.responseFieldPreviewTab()
|
69
|
+
.eq(responseIndex)
|
70
|
+
.should('not.have.css', 'bottom')
|
71
|
+
.and('not.have.css', 'left');
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
textEntryMathWithImagePage.responseFieldWrapperPreviewTab()
|
75
|
+
.eq(responseIndex)
|
76
|
+
.should('have.css', 'top', expectedPosition.top)
|
77
|
+
.and('have.css', 'left', expectedPosition.left);
|
78
|
+
}
|
79
|
+
},
|
80
|
+
|
81
|
+
/**
|
82
|
+
* @param {*} width width of canvas
|
83
|
+
* @description this function verifies width of canvas
|
84
|
+
*/
|
85
|
+
verifyCanvasWidthInPreviewTab: (width) => {
|
86
|
+
textEntryMathWithImagePage.canvasInPreviewTab()
|
87
|
+
.should('have.attr', 'width', width);
|
88
|
+
},
|
89
|
+
|
90
|
+
/**
|
91
|
+
* @param {*} height height of canvas
|
92
|
+
* @description this function verifies height of canvas
|
93
|
+
*/
|
94
|
+
verifyCanvasHeightInPreviewTab: (height) => {
|
95
|
+
textEntryMathWithImagePage.canvasInPreviewTab()
|
96
|
+
.should('have.css', 'height', `${height}px`);
|
97
|
+
},
|
98
|
+
|
99
|
+
|
100
|
+
verifyDropzoneNotExistInPreviewTab: () => {
|
101
|
+
utilities.verifyElementVisibilityState(textEntryMathWithImagePage.dropzonePreviewTab(), 'notExist');
|
102
|
+
},
|
103
|
+
|
104
|
+
verifyDropzoneExistInPreviewTab: () => {
|
105
|
+
textEntryMathWithImagePage.dropzonePreviewTab()
|
106
|
+
.should('be.visible');
|
107
|
+
},
|
108
|
+
|
109
|
+
verifyTextContainerNotExistInPreviewTab: () => {
|
110
|
+
utilities.verifyElementVisibilityState(textEntryMathWithImagePage.responseFieldPreviewTab(), 'notExist');
|
111
|
+
},
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Focus in the answer input fields of the preview tab
|
115
|
+
* @param {number} responseIndex indx of the response to add input
|
116
|
+
*/
|
117
|
+
focusInResponseAnswerInputFieldPreviewTab: (responseIndex) => {
|
118
|
+
textEntryMathWithImagePage.responseFieldPreviewTab()
|
119
|
+
.eq(responseIndex)
|
120
|
+
.click();
|
121
|
+
},
|
122
|
+
|
123
|
+
/**
|
124
|
+
* This function verifies the input field text of response area
|
125
|
+
* @param {number} index index of response field
|
126
|
+
* @param {string} inputFieldText input field text in the preview tab
|
127
|
+
*/
|
128
|
+
verifyResponseAreaTextContentPreviewTab: (index, inputFieldText) => {
|
129
|
+
utilities.verifyTextContent(utilities.getNthElement(textEntryMathWithImagePage.responseFieldPreviewTab(), index), inputFieldText);
|
130
|
+
},
|
131
|
+
|
132
|
+
/**
|
133
|
+
* This function verifies the aria label entered in the response field
|
134
|
+
* @param {string} ariaLabel of the equation entered
|
135
|
+
*/
|
136
|
+
verifyResponseFieldEquationAriaLabel: (responseIndex, ariaLabel) => {
|
137
|
+
textEntryMathWithImagePage.responseFieldPreviewTab()
|
138
|
+
.eq(responseIndex)
|
139
|
+
.find('[role="math"]')
|
140
|
+
.should('have.attr', 'aria-label', ariaLabel);
|
141
|
+
},
|
142
|
+
|
143
|
+
/**
|
144
|
+
* @param {string} text text to be verified in the preview tab text area
|
145
|
+
* @description this function verifies input in the text area
|
146
|
+
*/
|
147
|
+
verifyTextInTextAreaPreviewTab: (text) => {
|
148
|
+
textEntryMathWithImagePage.textAreaPreviewTab()
|
149
|
+
.should('have.text', text);
|
150
|
+
},
|
151
|
+
|
152
|
+
/**
|
153
|
+
* This function verifies the correct/incorrect icon does not exist
|
154
|
+
* @param {number} index of the response field
|
155
|
+
*/
|
156
|
+
verifyCorrectIncorrectIconNotExist: (index) => {
|
157
|
+
textEntryMathWithImagePage.responseFieldWrapperPreviewTab()
|
158
|
+
.eq(index)
|
159
|
+
.within(() => {
|
160
|
+
utilities.verifyElementVisibilityState(textEntryMathWithImagePage.tickIcon(), 'notExist');
|
161
|
+
});
|
162
|
+
},
|
163
|
+
|
164
|
+
/**
|
165
|
+
* This function verifies the correct icon for the response field
|
166
|
+
* @param {number} index of the response field
|
167
|
+
*/
|
168
|
+
verifyCorrectResponseIcon: (index) => {
|
169
|
+
textEntryMathWithImagePage.responseFieldWrapperPreviewTab()
|
170
|
+
.eq(index)
|
171
|
+
.within(() => {
|
172
|
+
utilities.verifyCSS(textEntryMathWithImagePage.tickIcon(), {
|
173
|
+
'fill': css.color.correctAnswer
|
174
|
+
});
|
175
|
+
});
|
176
|
+
},
|
177
|
+
|
178
|
+
/**
|
179
|
+
* This function verifies the incorrect icon for the response field
|
180
|
+
* @param {number} index of the response field
|
181
|
+
*/
|
182
|
+
verifyIncorrectResponseIcon: (index) => {
|
183
|
+
textEntryMathWithImagePage.responseFieldWrapperPreviewTab()
|
184
|
+
.eq(index)
|
185
|
+
.within(() => {
|
186
|
+
utilities.verifyCSS(textEntryMathWithImagePage.tickIcon(), {
|
187
|
+
'fill': css.color.incorrectAnswer
|
188
|
+
});
|
189
|
+
});
|
190
|
+
},
|
191
|
+
|
192
|
+
verifyResponseFieldNumerationPreviewTab: () => {
|
193
|
+
textEntryMathWithImagePage.responseFieldNumerationPreviewTab()
|
194
|
+
.each(($element, index) => {
|
195
|
+
cy.wrap($element)
|
196
|
+
.should('have.text', `${index + 1}`)
|
197
|
+
});
|
198
|
+
},
|
199
|
+
}
|
200
|
+
|
201
|
+
const tests = {
|
202
|
+
...backgroundImageUploadComponent.tests,
|
203
|
+
...imageCanvasComponent.tests,
|
204
|
+
...questionInstructionsComponent.tests,
|
205
|
+
...autoScoredScoringPreviewTab.tests
|
206
|
+
}
|
207
|
+
|
208
|
+
export const textEntryMathWithImagePage = {
|
209
|
+
...selectors,
|
210
|
+
steps,
|
211
|
+
tests
|
212
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { commonComponents, questionInstructionsComponent,
|
1
|
+
import { commonComponents, questionInstructionsComponent, scoringSectionBaseEditTab, createQuestionBasePage, additionalSettingsPanel, autoScoredScoringPreviewTab } from "./components";
|
2
2
|
import { dialogBoxBase } from ".";
|
3
3
|
import utilities from "../support/helpers/utilities";
|
4
4
|
const css = Cypress.env('css');
|
@@ -8,12 +8,13 @@ let fileTypeList = ['Access', 'Assembly', 'C', 'C++', 'CSV', 'Excel', 'GIF', 'H'
|
|
8
8
|
|
9
9
|
const selectors = {
|
10
10
|
...dialogBoxBase,
|
11
|
-
...
|
11
|
+
...scoringSectionBaseEditTab,
|
12
12
|
...createQuestionBasePage,
|
13
13
|
...additionalSettingsPanel,
|
14
|
-
...commonComponents
|
14
|
+
...commonComponents,
|
15
15
|
...questionInstructionsComponent,
|
16
16
|
...commonComponents,
|
17
|
+
maximumNumberOfFilesInputField: () => cy.get('.input-stepper-wrapper input'),
|
17
18
|
//Supported file accordion
|
18
19
|
supportedFileTypesAccordion: () => cy.get('.freeresponse-accordian-label'),
|
19
20
|
selectedFileTypeCount: () => cy.get('.supported-file-types-count'),
|
@@ -48,7 +49,7 @@ const selectors = {
|
|
48
49
|
uploadedFilesSectionWrapper: () => cy.get('.uploaded-document-wrapper'),
|
49
50
|
uploadedFileWrapper: () => cy.get('.uploaded-document'),
|
50
51
|
editDisplayTextIcon: () => cy.get('.icon-pencil'),
|
51
|
-
|
52
|
+
fileName: () => cy.get('.studentResponse'),
|
52
53
|
addFileDescriptionInput: () => cy.get('[placeholder="Add file description"]'),
|
53
54
|
addFileDescriptionIcon: () => cy.get('.icon-File-description'),
|
54
55
|
scanningForVirusPreLoader: () => cy.get('img[alt="loader"]'),
|
@@ -56,15 +57,36 @@ const selectors = {
|
|
56
57
|
uploadedFileLink: () => cy.get('a[href*="/files/document?key=freeResponse/"]'),
|
57
58
|
editDisplayTextPopupInputField: () => cy.get('.inline-text-question-prefix-wrapper .update-display-text-input'),
|
58
59
|
deleteButton: () => cy.get('.icon-Delete.upload-response-state'),
|
59
|
-
deletePopupContent: () => cy.get('.delete-document-popup-message-wrapper')
|
60
|
+
deletePopupContent: () => cy.get('.delete-document-popup-message-wrapper'),
|
61
|
+
warningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
62
|
+
warningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
63
|
+
deleteFileButton: () => cy.get('.popup-button-wrapper button').eq(1),
|
64
|
+
cancelButton: () => cy.get('.popup-button-wrapper button').eq(0),
|
65
|
+
questionWrapperPreviewTab: () => cy.get('[class*="UploadQuestionPreviewstyle__UploadQuestionPreviewWrapper"]')
|
60
66
|
}
|
61
67
|
|
62
68
|
const steps = {
|
63
69
|
...createQuestionBasePage.steps,
|
64
70
|
...questionInstructionsComponent.steps,
|
65
|
-
...
|
71
|
+
...scoringSectionBaseEditTab.steps,
|
66
72
|
...additionalSettingsPanel.steps,
|
67
73
|
...commonComponents.steps,
|
74
|
+
...dialogBoxBase.steps,
|
75
|
+
...autoScoredScoringPreviewTab.steps,
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @param {number} maxValue value of maximum number of files
|
79
|
+
*/
|
80
|
+
setMaximumNumberOfFiles: (maxValue) => {
|
81
|
+
uploadResponsePage.maximumNumberOfFilesInputField()
|
82
|
+
.clear()
|
83
|
+
.type('{selectall}')
|
84
|
+
.type(maxValue)
|
85
|
+
.blur();
|
86
|
+
uploadResponsePage.maximumNumberOfFilesInputField()
|
87
|
+
.should('have.value', maxValue);
|
88
|
+
},
|
89
|
+
|
68
90
|
checkCapturePhotosCheckbox: () => {
|
69
91
|
uploadResponsePage.allowStudentsToCapturePhotosCheckbox()
|
70
92
|
.click()
|
@@ -106,30 +128,36 @@ const steps = {
|
|
106
128
|
* Verifies the displayed uploaded file count against a specified limit.
|
107
129
|
*/
|
108
130
|
verifyUploadedFileLimitCount: (uploadedFileCount, fileLimit) => {
|
109
|
-
utilities.verifyInnerText(uploadResponsePage.uploadedFileCount(), `${uploadedFileCount}/${fileLimit} File Limit`)
|
131
|
+
utilities.verifyInnerText(uploadResponsePage.uploadedFileCount(), `${uploadedFileCount}/${fileLimit} File Limit`);
|
110
132
|
},
|
111
133
|
|
112
134
|
/**
|
113
135
|
* Verifies the visibility state of elements for the preview tab of a specific uploaded file.
|
114
136
|
* @param {number} uploadedFileIndex - The index of the uploaded file to check within the list.
|
115
137
|
*/
|
116
|
-
uploadedFileContentsPreviewTab: (uploadedFileIndex) => {
|
138
|
+
uploadedFileContentsPreviewTab: (uploadedFileIndex, fileName) => {
|
117
139
|
uploadResponsePage.uploadedFileWrapper()
|
118
140
|
.eq(uploadedFileIndex)
|
119
141
|
.within(() => {
|
120
142
|
utilities.verifyElementVisibilityState(uploadResponsePage.editDisplayTextIcon(), 'visible');
|
121
143
|
utilities.verifyElementVisibilityState(uploadResponsePage.addFileDescriptionIcon(), 'visible');
|
122
144
|
utilities.verifyElementVisibilityState(uploadResponsePage.deleteButton(), 'visible');
|
145
|
+
utilities.verifyInnerText(uploadResponsePage.fileName(), fileName);
|
146
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.fileName(), 'visible');
|
123
147
|
});
|
124
148
|
},
|
125
149
|
|
150
|
+
uploadedFileContentsNotExistPreviewTab: () => {
|
151
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.uploadedFileWrapper(), 'notExist');
|
152
|
+
},
|
153
|
+
|
126
154
|
/**
|
155
|
+
* @param {string} fileIndex - Index of file name
|
127
156
|
* @param {string} fileName - The expected name of the uploaded file.
|
128
|
-
*
|
129
|
-
* Verifies the displayed name of an uploaded file at a specific index within the list.
|
157
|
+
* Verifies the displayed name of an uploaded file
|
130
158
|
*/
|
131
|
-
verifyUploadedFileName: (
|
132
|
-
utilities.verifyInnerText(uploadResponsePage.
|
159
|
+
verifyUploadedFileName: (fileIndex, fileName) => {
|
160
|
+
utilities.verifyInnerText(utilities.getNthElement(uploadResponsePage.fileName(), fileIndex), fileName);
|
133
161
|
},
|
134
162
|
|
135
163
|
stopUploadingFile: () => {
|
@@ -144,7 +172,7 @@ const steps = {
|
|
144
172
|
* Verifies that a file with the specified name does not exist in the uploaded files section.
|
145
173
|
*/
|
146
174
|
verifyFileNotExistsInUploadedFileSection: (fileName) => {
|
147
|
-
uploadResponsePage.
|
175
|
+
uploadResponsePage.fileName()
|
148
176
|
.should('not.have.text', fileName)
|
149
177
|
},
|
150
178
|
|
@@ -180,9 +208,13 @@ const steps = {
|
|
180
208
|
});
|
181
209
|
},
|
182
210
|
|
183
|
-
clickOnEditDisplayTextIcon: () => {
|
184
|
-
uploadResponsePage.
|
185
|
-
.
|
211
|
+
clickOnEditDisplayTextIcon: (index) => {
|
212
|
+
uploadResponsePage.uploadedFileWrapper()
|
213
|
+
.eq(index)
|
214
|
+
.within(() => {
|
215
|
+
uploadResponsePage.editDisplayTextIcon()
|
216
|
+
.click({ force: true });
|
217
|
+
});
|
186
218
|
},
|
187
219
|
|
188
220
|
verifyEditDisplayTextPopupInputFieldAndSelectedText: () => {
|
@@ -209,6 +241,7 @@ const steps = {
|
|
209
241
|
*/
|
210
242
|
enterTextInEditDisplayTextPopupInputField: (text) => {
|
211
243
|
uploadResponsePage.editDisplayTextPopupInputField()
|
244
|
+
.clear()
|
212
245
|
.type(text);
|
213
246
|
},
|
214
247
|
|
@@ -321,12 +354,13 @@ const steps = {
|
|
321
354
|
},
|
322
355
|
|
323
356
|
/**
|
324
|
-
|
325
|
-
|
326
|
-
|
357
|
+
* @param {string} file name of the file in fixtures/upload folder
|
358
|
+
* @description this function uploads a file
|
359
|
+
*/
|
327
360
|
uploadFile: (file) => {
|
328
361
|
uploadResponsePage.inputTypeFile()
|
329
362
|
.attachFile(file);
|
363
|
+
cy.wait(2000);
|
330
364
|
},
|
331
365
|
|
332
366
|
verifyDefaultSelectedFileTypes: () => {
|
@@ -363,6 +397,25 @@ const steps = {
|
|
363
397
|
uploadResponsePage.stopUploadingButton().find('svg')
|
364
398
|
.should('have.css', 'color', css.color.successBtn);
|
365
399
|
});
|
400
|
+
},
|
401
|
+
|
402
|
+
/**
|
403
|
+
* @description this function verifies warning text
|
404
|
+
* @param {string} warningText warning message displayed
|
405
|
+
*/
|
406
|
+
verifyWarningMessage: (warningText) => {
|
407
|
+
utilities.verifyElementVisibilityState(uploadResponsePage.warningMessage(), 'visible');
|
408
|
+
utilities.verifyInnerText(uploadResponsePage.warningMessage(), warningText);
|
409
|
+
},
|
410
|
+
|
411
|
+
cancelButtonInDeleteFilePopup: () => {
|
412
|
+
uploadResponsePage.cancelButton()
|
413
|
+
.click();
|
414
|
+
},
|
415
|
+
|
416
|
+
deleteFileButtonInDeleteFilePopup: () => {
|
417
|
+
uploadResponsePage.deleteFileButton()
|
418
|
+
.click();
|
366
419
|
}
|
367
420
|
}
|
368
421
|
|
@@ -370,8 +423,8 @@ const tests = {
|
|
370
423
|
...createQuestionBasePage.tests,
|
371
424
|
...questionInstructionsComponent.tests,
|
372
425
|
...additionalSettingsPanel.tests,
|
373
|
-
...
|
374
|
-
...
|
426
|
+
...scoringSectionBaseEditTab.tests,
|
427
|
+
...autoScoredScoringPreviewTab.tests,
|
375
428
|
...commonComponents.tests,
|
376
429
|
verifyErrorMessageDisappear: () => {
|
377
430
|
it('The error message should disappear if the user clicks anywhere in the upload file content wrapper', () => {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.122-updateILCRepo28Feb-2c3e0e3.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -35,4 +35,4 @@
|
|
35
35
|
"node-fetch": "^3.3.2",
|
36
36
|
"react-uuid": "^2.0.0"
|
37
37
|
}
|
38
|
-
}
|
38
|
+
}
|