itemengine-cypress-automation 1.0.564-IEI-6998-Add-coverage-for-image-hightlight-question-type-f372002.0 → 1.0.564-IEI-7011-3998a1c.0
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/config-files/ilprod.json +2 -1
- package/cypress/config-files/ilqa.json +2 -1
- package/cypress/config-files/ilstage.json +2 -1
- package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +0 -86
- package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +9 -60
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +12 -14
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +3 -12
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -65
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +1 -15
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +353 -0
- package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +464 -1
- package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +379 -0
- package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +130 -0
- package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +16 -0
- package/cypress/pages/components/index.js +1 -0
- package/cypress/pages/components/showAlternativeAnswersComponent.js +145 -0
- package/cypress/pages/imageHighlightPage.js +7 -184
- package/cypress/pages/itemPreviewPage.js +0 -1
- package/cypress/pages/multipleSelectionPage.js +35 -1
- package/cypress/pages/singleSelectionPage.js +5 -1
- package/cypress/support/helpers/utilities.js +0 -16
- package/package.json +1 -1
- package/service.yaml +9 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import constants from "../fixtures/constants";
|
|
2
2
|
import utilities from "../support/helpers/utilities"
|
|
3
|
-
import { autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, additionalSettingsPanel, ckEditorToolbar, equationEditorFlyout, mcqAdditionalSettingsBase, randomizeOptionsComponent, lockUnlockOptionComponent, additionalSettingsAccessibilitySectionComponent } from "./components"
|
|
3
|
+
import { autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, additionalSettingsPanel, ckEditorToolbar, equationEditorFlyout, mcqAdditionalSettingsBase, randomizeOptionsComponent, lockUnlockOptionComponent, additionalSettingsAccessibilitySectionComponent, showAlternativeAnswersComponent } from "./components"
|
|
4
4
|
import { ckEditorAudioPlayerComponent } from "../pages/components/ckEditorAudioPlayerComponent"
|
|
5
5
|
import { ckEditorEquationEditorComponent } from "../pages/components/ckEditorEquationEditorComponent"
|
|
6
6
|
import { ckEditorInsertTableComponent } from "../pages/components/ckEditorInsertTableComponent"
|
|
@@ -35,6 +35,7 @@ const selectors = {
|
|
|
35
35
|
...ckEditorLinkComponent,
|
|
36
36
|
...createItemPage,
|
|
37
37
|
...audioPlayerPage,
|
|
38
|
+
...showAlternativeAnswersComponent,
|
|
38
39
|
//Specify correct answer section
|
|
39
40
|
optionWrapperSpecifyCorrectAnswerSection: () => cy.get('.mcq-option-wrapper'),
|
|
40
41
|
optionsText: () => cy.get('.mcq-label'),
|
|
@@ -78,6 +79,8 @@ const selectors = {
|
|
|
78
79
|
correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="CorrectAnswerLabel"]'),
|
|
79
80
|
correctAnswerSectionWrapper: () => cy.get('[class*="question-preview-wrapper"] .mcq-checkbox-control.mcq-answer-checked').eq(1),
|
|
80
81
|
optionWrapperCorrectAnswerSection: () => cy.get('.mcq-option-wrapper'),
|
|
82
|
+
alternativeAnswerSectionWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(1).next(),
|
|
83
|
+
optionWrapperAlternativeAnswerSection: () => cy.get('.mcq-option-wrapper'),
|
|
81
84
|
answerStatusBanner: () => cy.get('[class*="StatusContainer"]'),
|
|
82
85
|
cancelButton: () => cy.get('.save-action-btn-wrapper .MuiButtonBase-root').eq(1),
|
|
83
86
|
optionsInputFieldInQuestionPreviewTab: () => cy.get('.mcq-option-wrapper [data-testid="question-instruction-element"]'),
|
|
@@ -111,6 +114,7 @@ const steps = {
|
|
|
111
114
|
...ckEditorAudioPlayerComponent.steps,
|
|
112
115
|
...ckEditorEquationEditorComponent.steps,
|
|
113
116
|
...ckEditorInsertTableComponent.steps,
|
|
117
|
+
...showAlternativeAnswersComponent.steps,
|
|
114
118
|
...ckEditorInsertImageComponent.steps,
|
|
115
119
|
...ckEditorLinkComponent.steps,
|
|
116
120
|
...createItemPage.steps,
|
|
@@ -859,6 +863,36 @@ const steps = {
|
|
|
859
863
|
.should('exist');
|
|
860
864
|
},
|
|
861
865
|
|
|
866
|
+
/**
|
|
867
|
+
* Verifies correct option icon in alternative answer section
|
|
868
|
+
* @param {number} optionIndex - The index of the option to verify
|
|
869
|
+
*/
|
|
870
|
+
verifyCorrectOptionIconAlternativeAnswerSection: (optionIndex) => {
|
|
871
|
+
multipleSelectionPage.alternativeAnswerSectionWrapper()
|
|
872
|
+
.within(() => {
|
|
873
|
+
multipleSelectionPage.optionWrapperAlternativeAnswerSection()
|
|
874
|
+
.eq(optionIndex)
|
|
875
|
+
.within(() => {
|
|
876
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
|
877
|
+
});
|
|
878
|
+
});
|
|
879
|
+
},
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Verifies that correct/incorrect icon is not visible in alternative answer section
|
|
883
|
+
* @param {number} optionIndex - The index of the option to verify
|
|
884
|
+
*/
|
|
885
|
+
verifyCorrectIncorrectIconNotVisibleAlternativeAnswerSection: (optionIndex) => {
|
|
886
|
+
multipleSelectionPage.alternativeAnswerSectionWrapper()
|
|
887
|
+
.within(() => {
|
|
888
|
+
multipleSelectionPage.optionWrapperAlternativeAnswerSection()
|
|
889
|
+
.eq(optionIndex)
|
|
890
|
+
.within(() => {
|
|
891
|
+
autoScoredScoringPreviewTab.steps.verifyCorrectIncorrectIconsNotExist();
|
|
892
|
+
});
|
|
893
|
+
});
|
|
894
|
+
},
|
|
895
|
+
|
|
862
896
|
verifyAnswerBannerNotExist: () => {
|
|
863
897
|
multipleSelectionPage.answerStatusBanner()
|
|
864
898
|
.should('not.exist');
|
|
@@ -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, optionsWrapperComponent, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, lockUnlockOptionComponent, questionInstructionsComponent, additionalSettingsAccessibilitySectionComponent } from "./components";
|
|
3
|
+
import { additionalSettingsPanel, createQuestionBasePage, mcqAdditionalSettingsBase, scoringSectionBaseEditTab, autoScoredSpecifyCorrectAnswerSection, optionsWrapperComponent, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, lockUnlockOptionComponent, questionInstructionsComponent, additionalSettingsAccessibilitySectionComponent, showAlternativeAnswersComponent } from "./components";
|
|
4
4
|
import { createItemPage } from "./createItemPage";
|
|
5
5
|
import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
|
|
6
6
|
const css = Cypress.env('css');
|
|
@@ -21,6 +21,7 @@ const selectors = {
|
|
|
21
21
|
...randomizeOptionsComponent,
|
|
22
22
|
...lockUnlockOptionComponent,
|
|
23
23
|
...createItemPage,
|
|
24
|
+
...showAlternativeAnswersComponent,
|
|
24
25
|
optionsRadioButton: () => cy.get('input[type="radio"]'),
|
|
25
26
|
optionsRadioButtonForSpecifyCorrectAnswer: () => cy.get('.radio-option-wrapper:visible input[type="radio"]'),
|
|
26
27
|
editTabOptionsWrapper: () => cy.get('.edit-mcq-option-wrapper'),
|
|
@@ -61,6 +62,7 @@ const steps = {
|
|
|
61
62
|
...lockUnlockOptionComponent.steps,
|
|
62
63
|
...createItemPage.steps,
|
|
63
64
|
...selectQuestionResourceToolPage.steps,
|
|
65
|
+
...showAlternativeAnswersComponent.steps,
|
|
64
66
|
/**
|
|
65
67
|
* Verifies the contents of an option wrapper in the 'Specify correct answer' section for single selection questions.
|
|
66
68
|
* @param {number} optionIndex - The index of the option wrapper to be verified.
|
|
@@ -728,6 +730,8 @@ const steps = {
|
|
|
728
730
|
singleSelectionPage.steps.setCorrectAnswer(correctAnswer);
|
|
729
731
|
singleSelectionPage.saveQuestionButton().click();
|
|
730
732
|
},
|
|
733
|
+
|
|
734
|
+
|
|
731
735
|
};
|
|
732
736
|
|
|
733
737
|
const tests = {
|
|
@@ -295,22 +295,6 @@ const utilities = {
|
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
297
|
},
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Verifies the selected/not selected state of an element.
|
|
301
|
-
* @param {Cypress.Chainable} selector - The element containing the image
|
|
302
|
-
* @param {string} state - 'selected' | 'notSelected'
|
|
303
|
-
*/
|
|
304
|
-
verifiedElementSelectedNotSelectedState: (selector, state) => {
|
|
305
|
-
switch (state) {
|
|
306
|
-
case 'selected':
|
|
307
|
-
selector.should('have.attr', 'aria-pressed', 'true');
|
|
308
|
-
break;
|
|
309
|
-
case 'notSelected':
|
|
310
|
-
selector.should('have.attr', 'aria-pressed', 'false');
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
298
|
}
|
|
315
299
|
|
|
316
300
|
export default utilities
|
package/package.json
CHANGED
package/service.yaml
CHANGED
|
@@ -102,21 +102,29 @@ namespaces:
|
|
|
102
102
|
value: "dev"
|
|
103
103
|
- name: FILE_CONFIG
|
|
104
104
|
value: "dev"
|
|
105
|
+
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
106
|
+
value: "false"
|
|
105
107
|
qa:
|
|
106
108
|
env:
|
|
107
109
|
- name: STAGE
|
|
108
110
|
value: "qa"
|
|
109
111
|
- name: FILE_CONFIG
|
|
110
112
|
value: "qa"
|
|
113
|
+
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
114
|
+
value: "true"
|
|
111
115
|
staging:
|
|
112
116
|
env:
|
|
113
117
|
- name: STAGE
|
|
114
118
|
value: "stage"
|
|
115
119
|
- name: FILE_CONFIG
|
|
116
120
|
value: "stage"
|
|
121
|
+
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
122
|
+
value: "false"
|
|
117
123
|
prod:
|
|
118
124
|
env:
|
|
119
125
|
- name: STAGE
|
|
120
126
|
value: "prod"
|
|
121
127
|
- name: FILE_CONFIG
|
|
122
|
-
value: "prod"
|
|
128
|
+
value: "prod"
|
|
129
|
+
- name: ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT
|
|
130
|
+
value: "false"
|