itemengine-cypress-automation 1.0.564-IEI-7011-cf323ce.0 → 1.0.564-IEI-6998-Add-coverage-for-image-hightlight-question-type-f372002.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 +1 -2
- package/cypress/config-files/ilqa.json +1 -2
- package/cypress/config-files/ilstage.json +1 -2
- package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +86 -0
- package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +60 -9
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +14 -12
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +12 -3
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +65 -2
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +15 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -168
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +0 -86
- package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +0 -91
- package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +0 -79
- package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +0 -130
- package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +0 -16
- package/cypress/pages/components/index.js +0 -1
- package/cypress/pages/imageHighlightPage.js +184 -7
- package/cypress/pages/itemPreviewPage.js +1 -0
- package/cypress/pages/multipleSelectionPage.js +1 -3
- package/cypress/pages/singleSelectionPage.js +1 -5
- package/cypress/support/helpers/utilities.js +16 -0
- package/package.json +1 -1
- package/service.yaml +1 -9
- package/cypress/pages/components/showAlternativeAnswersComponent.js +0 -169
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Show Alternative Answers Component
|
|
3
|
-
* Common functionality for managing and verifying alternative answers toggle and content
|
|
4
|
-
* across different question types (Single Selection, Multiple Selection, etc.)
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const showAlternativeAnswersComponent = {
|
|
8
|
-
// Selectors for the alternative answers toggle
|
|
9
|
-
showAlternativeAnswersToggleWrapper: () => cy.get('[class*="ShowAlternativeAnswerSwitch"][class*="SwitchWrapper"]'),
|
|
10
|
-
showAlternativeAnswersToggleInput: () => cy.get('[class*="ShowAlternativeAnswerSwitch"][class*="SwitchWrapper"] input[type="checkbox"]'),
|
|
11
|
-
showAlternativeAnswersToggleLabel: () => cy.get('[class*="ShowAlternativeAnswerSwitch"][class*="SwitchWrapper"] [class*="SwitchLabelWrapper"]'),
|
|
12
|
-
showAlternativeAnswersToggleButton: () => cy.get('[class*="ShowAlternativeAnswerSwitch"][class*="SwitchWrapper"] .MuiButtonBase-root'),
|
|
13
|
-
|
|
14
|
-
// Selectors for the alternative answers content section
|
|
15
|
-
alternativeAnswersSection: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').contains('Alternative answer'),
|
|
16
|
-
alternativeAnswerLabelWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]:contains("Alternative answer")'),
|
|
17
|
-
alternativeAnswerGridWrapper: () => cy.get('[class*="CorrectAnswerGridWrapper"]'),
|
|
18
|
-
alternativeAnswerSelectionGrid: () => cy.get('.correct-ans-selection-grid'),
|
|
19
|
-
|
|
20
|
-
steps: {
|
|
21
|
-
/**
|
|
22
|
-
* Verifies that the "Show alternative answers" toggle is present and visible
|
|
23
|
-
*/
|
|
24
|
-
verifyShowAlternativeAnswersToggleExists: () => {
|
|
25
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleWrapper()
|
|
26
|
-
.should('be.visible');
|
|
27
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleLabel()
|
|
28
|
-
.should('contain.text', 'Show alternative answers');
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Verifies that the "Show alternative answers" toggle does not exist
|
|
33
|
-
*/
|
|
34
|
-
verifyShowAlternativeAnswersToggleNotExists: () => {
|
|
35
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleWrapper()
|
|
36
|
-
.should('not.exist');
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Verifies that the "Show alternative answers" toggle is in the checked (enabled) state
|
|
41
|
-
*/
|
|
42
|
-
verifyShowAlternativeAnswersToggleChecked: () => {
|
|
43
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleInput()
|
|
44
|
-
.should('be.checked')
|
|
45
|
-
.and('have.attr', 'aria-pressed', 'true');
|
|
46
|
-
// Verify the checked state visual indicator (tick icon)
|
|
47
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleWrapper()
|
|
48
|
-
.find('.icon-ILC-tick-icon')
|
|
49
|
-
.should('be.visible');
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Verifies that the "Show alternative answers" toggle is in the unchecked (disabled) state
|
|
54
|
-
*/
|
|
55
|
-
verifyShowAlternativeAnswersToggleUnchecked: () => {
|
|
56
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleInput()
|
|
57
|
-
.should('not.be.checked')
|
|
58
|
-
.and('have.attr', 'aria-pressed', 'false');
|
|
59
|
-
// Verify the unchecked state visual indicator (x-circle icon)
|
|
60
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleWrapper()
|
|
61
|
-
.find('.icon-x-circle')
|
|
62
|
-
.should('be.visible');
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Clicks the "Show alternative answers" toggle to change its state
|
|
67
|
-
*/
|
|
68
|
-
clickShowAlternativeAnswersToggle: () => {
|
|
69
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleButton()
|
|
70
|
-
.click();
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Enables the "Show alternative answers" toggle (clicks it if it's currently unchecked)
|
|
75
|
-
*/
|
|
76
|
-
enableShowAlternativeAnswersToggle: () => {
|
|
77
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleInput()
|
|
78
|
-
.then(($input) => {
|
|
79
|
-
if (!$input.prop('checked')) {
|
|
80
|
-
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Disables the "Show alternative answers" toggle (clicks it if it's currently checked)
|
|
87
|
-
*/
|
|
88
|
-
disableShowAlternativeAnswersToggle: () => {
|
|
89
|
-
showAlternativeAnswersComponent.showAlternativeAnswersToggleInput()
|
|
90
|
-
.then(($input) => {
|
|
91
|
-
if ($input.prop('checked')) {
|
|
92
|
-
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Verifies that the alternative answers section is visible
|
|
99
|
-
* @param {number} index - The index of the alternative answer (e.g., 1 for "Alternative answer 1")
|
|
100
|
-
* @param {number} points - The expected points for the alternative answer
|
|
101
|
-
*/
|
|
102
|
-
verifyAlternativeAnswersSectionVisible: (index, points) => {
|
|
103
|
-
cy.get('[class*="CorrectAnswerLabelWrapper"]')
|
|
104
|
-
.contains(`Alternative answer ${index}`)
|
|
105
|
-
.should('be.visible');
|
|
106
|
-
|
|
107
|
-
if (points) {
|
|
108
|
-
cy.get('[class*="CorrectAnswerLabelWrapper"]')
|
|
109
|
-
.contains(`Alternative answer ${index}`)
|
|
110
|
-
.parent()
|
|
111
|
-
.find('p')
|
|
112
|
-
.should('contain.text', `(${points} points)`);
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Verifies that the alternative answers section does not exist
|
|
118
|
-
*/
|
|
119
|
-
verifyAlternativeAnswersSectionNotExist: () => {
|
|
120
|
-
cy.get('[class*="CorrectAnswerLabelWrapper"]')
|
|
121
|
-
.contains('Alternative answer')
|
|
122
|
-
.should('not.exist');
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Verifies the complete alternative answers section including content and grid
|
|
127
|
-
* @param {number} index - The index of the alternative answer (e.g., 1 for "Alternative answer 1")
|
|
128
|
-
* @param {number} points - The expected points for the alternative answer
|
|
129
|
-
*/
|
|
130
|
-
verifyAlternativeAnswersSectionComplete: (index = 1, points) => {
|
|
131
|
-
// Verify the alternative answer label is visible
|
|
132
|
-
showAlternativeAnswersComponent.steps.verifyAlternativeAnswersSectionVisible(index, points);
|
|
133
|
-
|
|
134
|
-
// Verify the selection grid is visible
|
|
135
|
-
showAlternativeAnswersComponent.alternativeAnswerSelectionGrid()
|
|
136
|
-
.should('be.visible');
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Comprehensive test that verifies the complete toggle functionality
|
|
141
|
-
* @param {number} index - The index of the alternative answer to verify
|
|
142
|
-
* @param {number} points - The expected points for the alternative answer
|
|
143
|
-
*/
|
|
144
|
-
verifyShowAlternativeAnswersToggleFunctionality: (index, points) => {
|
|
145
|
-
// Start with ensuring toggle exists
|
|
146
|
-
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
147
|
-
|
|
148
|
-
// Test unchecked state
|
|
149
|
-
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
150
|
-
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
151
|
-
|
|
152
|
-
// Verify the alternative answers section does not exist
|
|
153
|
-
showAlternativeAnswersComponent.steps.verifyAlternativeAnswersSectionNotExist();
|
|
154
|
-
|
|
155
|
-
// Test checked state
|
|
156
|
-
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
157
|
-
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleChecked();
|
|
158
|
-
|
|
159
|
-
// Verify the alternative answers section is visible
|
|
160
|
-
showAlternativeAnswersComponent.steps.verifyAlternativeAnswersSectionVisible(index, points);
|
|
161
|
-
|
|
162
|
-
// Test toggle back to unchecked
|
|
163
|
-
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
164
|
-
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export { showAlternativeAnswersComponent };
|