itemengine-cypress-automation 1.0.579-IEI-7193-main-6a7df51.0 → 1.0.580-IEI-7040-1e744fc.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/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +136 -9
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +7 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +116 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +136 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +21 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +190 -2
- package/cypress/e2e/ILC/dataApi/fetchQuestion.js +0 -39
- package/cypress/e2e/ILC/dataApi/saveQuestions.js +0 -53
- package/cypress/pages/fillInTheGapsDropdownPage.js +47 -2
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import utilities from "../support/helpers/utilities";
|
|
|
2
2
|
import { autoScoredScoringPreviewTab, createQuestionBasePage, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, questionInputFieldComponent, commonComponents, additionalSettingsPanel, optionsWrapperComponent, randomizeOptionsComponent, studentViewSettingsLabelComponent, responseAreaSettingsPopupComponent, gradingViewEnumerationComponent, additionalSettingsAccessibilitySectionComponent, ariaLabelSectionComponent, placeholderTextSectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
5
6
|
|
|
6
7
|
const selectors = {
|
|
7
8
|
...questionInstructionsComponent,
|
|
@@ -25,8 +26,8 @@ const selectors = {
|
|
|
25
26
|
...figCommonStyleAndLayoutComponent,
|
|
26
27
|
dropdownWrapperPreviewTab: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper'),
|
|
27
28
|
correctAnswerSectionWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
|
|
28
|
-
correctAnswerResponseWrapper: () => cy.get('.answer-block'),
|
|
29
|
-
correctAnswerResponse: () => cy.get('.numeration-wrapper'),
|
|
29
|
+
correctAnswerResponseWrapper: () => alternativeAnswerCheck ? cy.get('[class*="ClozeWithTextResponsestyles__AnswerCell"]') : cy.get('.answer-block'),
|
|
30
|
+
correctAnswerResponse: () => alternativeAnswerCheck ? cy.get('[class*="AnswerWrapperForLabel"]') : cy.get('.numeration-wrapper'),
|
|
30
31
|
setForAllDropdownsLabel: () => cy.get('[data-ngie-testid="set-for-all-dropdowns-checkbox"] .MuiFormControlLabel-label'),
|
|
31
32
|
setForAllDropdownsCheckbox: () => cy.get('[data-ngie-testid="set-for-all-dropdowns-checkbox"] input'),
|
|
32
33
|
correctAnswerSectionWithoutEnumerationWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper .preview-question-text-wrapper'),
|
|
@@ -41,6 +42,8 @@ const selectors = {
|
|
|
41
42
|
alternateAnswerPopupSaveButton: () => cy.get('[class*="AlternateOptionstyle__ButtonWrapper"] button').eq(1),
|
|
42
43
|
selectedAlternateAnswerCountSpecifyCorrectAnswer: () => cy.get('.selected-option-wrapper'),
|
|
43
44
|
answerStatusBanner: () => cy.get('[class*="AnswerStatusWrapper"]'),
|
|
45
|
+
correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
|
|
46
|
+
alternativeAnswersSection: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(4), // Alternative answer is typically the second wrapper
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
const steps = {
|
|
@@ -128,6 +131,41 @@ const steps = {
|
|
|
128
131
|
});
|
|
129
132
|
},
|
|
130
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Verify correct answer section with alternate answers.
|
|
136
|
+
*
|
|
137
|
+
* @param {Object[]} correctAnswerArray - An array of objects representing the expected correct answers and their corresponding points.
|
|
138
|
+
* @param {string[][]} correctAnswerArray[].correctAnswers - A nested array of correct answer text values.
|
|
139
|
+
* Each inner array represents a group of alternate correct answers for a particular text container.
|
|
140
|
+
* @param {string[]} correctAnswerArray[].points - An array of point label strings associated with each correct answer group.
|
|
141
|
+
*
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
verifyCorrectAnswerSectionWithAlternateAnswer: (correctAnswerArray) => {
|
|
145
|
+
let responseIndex = 0;
|
|
146
|
+
let pointsLabelIndex = 0;
|
|
147
|
+
correctAnswerArray.forEach(({correctAnswers, points}) => {
|
|
148
|
+
correctAnswers.forEach((textContainers, index) => {
|
|
149
|
+
textContainers.forEach((correctAnswer) => {
|
|
150
|
+
fillInTheGapsDropdownPage.correctAnswerResponseWrapper()
|
|
151
|
+
.eq(responseIndex)
|
|
152
|
+
.within(() => {
|
|
153
|
+
utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
|
|
154
|
+
fillInTheGapsDropdownPage.correctAnswerResponse()
|
|
155
|
+
.should('have.text', correctAnswer);
|
|
156
|
+
});
|
|
157
|
+
responseIndex += 1;
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
points.forEach((pointsText) => {
|
|
161
|
+
fillInTheGapsDropdownPage.correctAnswerPointsLabel()
|
|
162
|
+
.eq(pointsLabelIndex)
|
|
163
|
+
.should('have.text', pointsText);
|
|
164
|
+
pointsLabelIndex += 1;
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
|
|
131
169
|
verifyCorrectAnswerSectionNotExists: () => {
|
|
132
170
|
utilities.verifyElementVisibilityState(fillInTheGapsDropdownPage.correctAnswerSectionWrapper(), 'notExist');
|
|
133
171
|
},
|
|
@@ -334,6 +372,13 @@ const steps = {
|
|
|
334
372
|
fillInTheGapsDropdownPage.answerStatusBanner()
|
|
335
373
|
.should('be.visible');
|
|
336
374
|
},
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Verifies that the alternative answers section does not exist
|
|
378
|
+
*/
|
|
379
|
+
verifyAlternativeAnswersSectionNotExist: () => {
|
|
380
|
+
fillInTheGapsDropdownPage.alternativeAnswersSection().should('not.exist');
|
|
381
|
+
},
|
|
337
382
|
}
|
|
338
383
|
|
|
339
384
|
const tests = {
|