itemengine-cypress-automation 1.0.184-e2e-execution-crash-3b9d0d0.0 → 1.0.185-repoUpdate26April-b17eb46.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +79 -0
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +345 -0
- package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +429 -0
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +489 -0
- package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +313 -0
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -8
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +417 -28
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
- package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +11 -3
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +230 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +201 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +279 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +109 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +335 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +250 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +161 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +252 -0
- package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +118 -0
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
- package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +155 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +195 -0
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +78 -0
- package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
- package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +112 -0
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +244 -0
- package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/LayoutSection.js +181 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +57 -1
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +33 -0
- package/cypress/e2e/ILC/NumberLine/numberLineSection.js +46 -0
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +696 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +173 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +183 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +73 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +204 -0
- package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +288 -0
- package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +153 -0
- package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +164 -0
- package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
- package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
- package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +6 -7
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +179 -0
- package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
- package/cypress/fixtures/theme/ilc.json +20 -18
- package/cypress/pages/audioPlayerPage.js +274 -504
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
- package/cypress/pages/components/commonComponents.js +1 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/equationEditorFlyout.js +3 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
- package/cypress/pages/components/imageCanvasComponent.js +2 -1
- package/cypress/pages/components/index.js +3 -0
- package/cypress/pages/components/layoutSectionComponent.js +1191 -0
- package/cypress/pages/components/numberLineCommonComponent.js +36 -0
- package/cypress/pages/components/optionsWrapperComponent.js +13 -2
- package/cypress/pages/components/playbackControlsBaseComponent.js +20 -13
- package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
- package/cypress/pages/components/toolSettingsComponent.js +6 -0
- package/cypress/pages/contentBlocksPage.js +18 -2
- package/cypress/pages/createItemPage.js +75 -8
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/drawingResponsePage.js +24 -4
- package/cypress/pages/feedbackScalePage.js +3 -0
- package/cypress/pages/graphingPage.js +19 -1
- package/cypress/pages/gridFillPage.js +25 -8
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/itemPreviewSettingsPage.js +4 -0
- package/cypress/pages/listOrderingPage.js +435 -557
- package/cypress/pages/matchingPage.js +1 -1
- package/cypress/pages/multipleSelectionPage.js +23 -1
- package/cypress/pages/numberLineLabelPage.js +333 -0
- package/cypress/pages/numberLinePage.js +1370 -132
- package/cypress/pages/rulerPage.js +6 -2
- package/cypress/pages/textSelectionPage.js +461 -23
- package/package.json +1 -1
@@ -955,7 +955,7 @@ const steps = {
|
|
955
955
|
draggableOptionsSectionComponent.steps.addGroup();
|
956
956
|
draggableOptionsSectionComponent.steps.addGroupTitle(groupTitle);
|
957
957
|
for (let i = 0; i < numOptionsToAdd; i++) {
|
958
|
-
matchingPage.steps.
|
958
|
+
matchingPage.steps.addOption();
|
959
959
|
}
|
960
960
|
matchingPage.steps.enterTextInOptionInputField(optionArray);
|
961
961
|
},
|
@@ -25,6 +25,7 @@ const selectors = {
|
|
25
25
|
optionsText: () => cy.get('.mcq-label'),
|
26
26
|
optionsCheckboxWrapperSpecifyCorrectAnswerSection: () => cy.get('[data-ngie-testid="response-option-checkbox"]:visible'),
|
27
27
|
optionsCheckboxWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [data-ngie-testid="response-option-checkbox"]:visible'),
|
28
|
+
penaltyPointsForEachIncorrectOptionInputField: () => cy.get('.penlty-points-input-field input'),
|
28
29
|
//TODO: Need to update below selectors, once https://redmine.zeuslearning.com/issues/553983 gets resolved
|
29
30
|
optionsCheckbox: () => cy.get('[data-ngie-testid="response-option-checkbox"]:visible [type="checkbox"]'),
|
30
31
|
optionsCheckboxPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [data-ngie-testid="response-option-checkbox"] [type="checkbox"]'),
|
@@ -545,7 +546,28 @@ const steps = {
|
|
545
546
|
.eq(index)
|
546
547
|
.parents('.ngie-checkbox')
|
547
548
|
.should('have.class', 'checkbox-option-disabled');
|
548
|
-
}
|
549
|
+
},
|
550
|
+
|
551
|
+
/**
|
552
|
+
* Verifies the penalty points value for each incorrect option in the multiple selection question.
|
553
|
+
* @param {number} points - The expected penalty points value for each incorrect option.
|
554
|
+
*/
|
555
|
+
verifyPenaltyPointsForEachIncorrectOptionValue: (points) => {
|
556
|
+
multipleSelectionPage.penaltyPointsForEachIncorrectOptionInputField()
|
557
|
+
.should('have.value', points);
|
558
|
+
},
|
559
|
+
|
560
|
+
/**
|
561
|
+
* Allots penalty points for each incorrect option in the multiple selection question.
|
562
|
+
* @param {number} points - The penalty points to be allotted for each incorrect option.
|
563
|
+
*/
|
564
|
+
allotPenaltyPointsForEachIncorrectOption: (points) => {
|
565
|
+
multipleSelectionPage.penaltyPointsForEachIncorrectOptionInputField()
|
566
|
+
.clear()
|
567
|
+
.type(`${points}`)
|
568
|
+
.should('have.value', points)
|
569
|
+
.blur();
|
570
|
+
},
|
549
571
|
}
|
550
572
|
|
551
573
|
const tests = {
|
@@ -0,0 +1,333 @@
|
|
1
|
+
import constants from '../fixtures/constants';
|
2
|
+
import utilities from '../support/helpers/utilities';
|
3
|
+
import { createQuestionBasePage, questionInstructionsComponent, scoringSectionBaseEditTab, ckEditorToolbar, equationEditorFlyout, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, numberLineCommonComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType } from './components';
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const selectors = {
|
7
|
+
...questionInstructionsComponent,
|
8
|
+
...numberLineCommonComponent,
|
9
|
+
//Label section
|
10
|
+
labelInputField: () => cy.get('.edit-question-enter-option-form-element [role="textbox"]'),
|
11
|
+
addLabelButton: () => cy.get('.inline-add-option-button-wrapper button'),
|
12
|
+
labelNumberLineTab: () => cy.get('[data-ngie-testid="label-number-line-tab"]'),
|
13
|
+
//Specify correct answer section
|
14
|
+
draggableLabelsSpecifyCorrectAnswer: () => cy.get('.label-tool'),
|
15
|
+
|
16
|
+
//Preview tab
|
17
|
+
draggableLabelsPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .label-tool'),
|
18
|
+
labelContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .items-container'),
|
19
|
+
|
20
|
+
//Correct answer section
|
21
|
+
numberLineCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg').eq(2),
|
22
|
+
numberLinePointCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').last().find('svg ellipse[display="inline"]')
|
23
|
+
}
|
24
|
+
|
25
|
+
const steps = {
|
26
|
+
...createQuestionBasePage.steps,
|
27
|
+
...questionInstructionsComponent.steps,
|
28
|
+
...scoringSectionBaseEditTab.steps,
|
29
|
+
...ckEditorToolbar.steps,
|
30
|
+
...equationEditorFlyout.steps,
|
31
|
+
...autoScoredScoringPreviewTab.steps,
|
32
|
+
...autoScoredStudentViewSettings.steps,
|
33
|
+
...numberLineCommonComponent.steps,
|
34
|
+
...autoScoredSpecifyCorrectAnswerSection.steps,
|
35
|
+
...autoScoredScoringSectionMultiResponseType.steps,
|
36
|
+
|
37
|
+
navigateToLabelNumberLineTab: () => {
|
38
|
+
numberLineLabelPage.labelNumberLineTab()
|
39
|
+
.click();
|
40
|
+
},
|
41
|
+
|
42
|
+
addLabel: () => {
|
43
|
+
numberLineLabelPage.addLabelButton()
|
44
|
+
.click()
|
45
|
+
},
|
46
|
+
|
47
|
+
/**
|
48
|
+
* This function is used to focus in the label input field
|
49
|
+
* @param {number} index of the label input field
|
50
|
+
*/
|
51
|
+
focusInLabelInputField: (index) => {
|
52
|
+
utilities.getNthElement(numberLineLabelPage.labelInputField(), index)
|
53
|
+
.click();
|
54
|
+
},
|
55
|
+
|
56
|
+
/**
|
57
|
+
* @param {number} index of label input field
|
58
|
+
* @param {string} textContent to enter text in the label input field
|
59
|
+
*/
|
60
|
+
enterTextInLabelInputField: (index, textContent) => {
|
61
|
+
numberLineLabelPage.labelInputField()
|
62
|
+
.eq(index)
|
63
|
+
.type(textContent)
|
64
|
+
},
|
65
|
+
|
66
|
+
enterTextInMultipleLabelInputFields: (labelsArray) => {
|
67
|
+
labelsArray.forEach((label, index) => {
|
68
|
+
numberLineLabelPage.labelInputField()
|
69
|
+
.eq(index)
|
70
|
+
.type(label)
|
71
|
+
.blur()
|
72
|
+
.should('have.text', label)
|
73
|
+
});
|
74
|
+
},
|
75
|
+
|
76
|
+
//Specify correct answer section
|
77
|
+
/**
|
78
|
+
* This function clicks and drops label on the specify correct answer section line
|
79
|
+
* @param {string} label to be dropped on the number line
|
80
|
+
* @param {(horizontal|vertical)} orientation of the number line
|
81
|
+
* @param {number} range of the number line
|
82
|
+
* @param {number} coordinate of the number line to drop the label
|
83
|
+
*/
|
84
|
+
clickAndDropLabelOnNumberLineSpecifyCorrectAnswer: (label, orientation, range, coordinate) => {
|
85
|
+
numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
|
86
|
+
.contains(label)
|
87
|
+
.click();
|
88
|
+
numberLineLabelPage.numberLineSpecifyCorrectAnswer()
|
89
|
+
.then(($graphElement) => {
|
90
|
+
const graphWidth = $graphElement[0].clientWidth;
|
91
|
+
const graphHeight = 180;
|
92
|
+
const originX = graphWidth / 2;
|
93
|
+
const originY = graphHeight / 2;
|
94
|
+
if (orientation === 'horizontal') {
|
95
|
+
const xPixel = originX + coordinate * (graphWidth / range);
|
96
|
+
numberLineLabelPage.numberLineSpecifyCorrectAnswer()
|
97
|
+
.click(xPixel, originY, { force: true });
|
98
|
+
} else {
|
99
|
+
const yPixel = originY - coordinate * (graphWidth / range);
|
100
|
+
numberLineLabelPage.numberLineSpecifyCorrectAnswer()
|
101
|
+
.click(originX, yPixel, { force: true });
|
102
|
+
}
|
103
|
+
});
|
104
|
+
},
|
105
|
+
|
106
|
+
/**
|
107
|
+
* This function verifies plotted points on the number line on the Edit tab.
|
108
|
+
* @param {number} range - The range of x coordinates.
|
109
|
+
* @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
|
110
|
+
*/
|
111
|
+
verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer: (range, coordinates) => {
|
112
|
+
coordinates.forEach(x => {
|
113
|
+
numberLineLabelPage.numberLineSpecifyCorrectAnswer()
|
114
|
+
.then(($graphElement) => {
|
115
|
+
let graphWidth = $graphElement[0].clientWidth;
|
116
|
+
const originX = graphWidth / 2;
|
117
|
+
const xPixel = originX + x * (graphWidth / range);
|
118
|
+
cy.get(`.ngie-accordion .ngie-jxgbox svg ellipse[cx*="${Math.floor(xPixel)}"]`)
|
119
|
+
.should('exist');
|
120
|
+
});
|
121
|
+
});
|
122
|
+
},
|
123
|
+
|
124
|
+
/**
|
125
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
126
|
+
* @param {number} index - The index of the option in the Preview tab.
|
127
|
+
*/
|
128
|
+
verifyImageInPreviewTab: (index) => {
|
129
|
+
numberLineLabelPage.draggableLabelsPreviewTab()
|
130
|
+
.eq(index)
|
131
|
+
.find('img')
|
132
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
133
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
134
|
+
},
|
135
|
+
|
136
|
+
/**
|
137
|
+
* @description Verifies that the bold text in the Preview tab is correct.
|
138
|
+
* @param {number} index - The index of the option in the Preview tab.
|
139
|
+
*/
|
140
|
+
verifyBoldTextInPreviewTab: (index) => {
|
141
|
+
numberLineLabelPage.draggableLabelsPreviewTab()
|
142
|
+
.eq(index)
|
143
|
+
.find('strong')
|
144
|
+
.should('have.text', 'This is a bold option');
|
145
|
+
},
|
146
|
+
|
147
|
+
/**
|
148
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
149
|
+
* @param {number} index - The index of the option in the Preview tab.
|
150
|
+
*/
|
151
|
+
verifyEquationTextInPreviewTab: (index) => {
|
152
|
+
numberLineLabelPage.draggableLabelsPreviewTab()
|
153
|
+
.eq(index)
|
154
|
+
.find('[role="math"]')
|
155
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
156
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
157
|
+
},
|
158
|
+
|
159
|
+
/**
|
160
|
+
* This function verifies the text content of label
|
161
|
+
* @param {number} index of the draggable label
|
162
|
+
* @param {string} textContent of the label
|
163
|
+
*/
|
164
|
+
verifyLabelTextContentPreviewTab: (index, textContent) => {
|
165
|
+
utilities.verifyInnerText(utilities.getNthElement(numberLineLabelPage.draggableLabelsPreviewTab(), index), textContent)
|
166
|
+
},
|
167
|
+
|
168
|
+
//Preview tab
|
169
|
+
/**
|
170
|
+
* This function clicks and drops label on the specify correct answer section line
|
171
|
+
* @param {string} label to be dropped on the number line
|
172
|
+
* @param {(horizontal|vertical)} orientation of the number line
|
173
|
+
* @param {number} range of the number line
|
174
|
+
* @param {number} coordinate of the number line to drop the label
|
175
|
+
*/
|
176
|
+
clickAndDropLabelOnNumberLinePreviewTab: (label, orientation, range, coordinate) => {
|
177
|
+
numberLineLabelPage.draggableLabelsPreviewTab()
|
178
|
+
.contains(label)
|
179
|
+
.click();
|
180
|
+
numberLineLabelPage.numberLinePreviewTab()
|
181
|
+
.then(($graphElement) => {
|
182
|
+
const graphWidth = $graphElement[0].clientWidth;
|
183
|
+
const graphHeight = 120;
|
184
|
+
const originX = graphWidth / 2;
|
185
|
+
const originY = graphHeight / 2;
|
186
|
+
if (orientation === 'horizontal') {
|
187
|
+
const xPixel = originX + coordinate * (graphWidth / range);
|
188
|
+
numberLineLabelPage.numberLinePreviewTab()
|
189
|
+
.click(xPixel, originY, { force: true });
|
190
|
+
} else {
|
191
|
+
const yPixel = originY - coordinate * (graphWidth / range);
|
192
|
+
numberLineLabelPage.numberLinePreviewTab()
|
193
|
+
.click(originX, yPixel, { force: true });
|
194
|
+
}
|
195
|
+
});
|
196
|
+
},
|
197
|
+
|
198
|
+
/**
|
199
|
+
* This function verifies plotted points on the number line on the preview tab.
|
200
|
+
* @param {number} range - The range of x coordinates.
|
201
|
+
* @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
|
202
|
+
*/
|
203
|
+
verifyPointsPlottedOnNumberLinePreviewTab: (range, coordinates) => {
|
204
|
+
coordinates.forEach(x => {
|
205
|
+
numberLineLabelPage.numberLinePreviewTab()
|
206
|
+
.then(($graphElement) => {
|
207
|
+
const graphWidth = $graphElement[0].clientWidth;
|
208
|
+
const originX = graphWidth / 2;
|
209
|
+
const xPixel = originX + x * (graphWidth / range);
|
210
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
|
211
|
+
.should('exist');
|
212
|
+
});
|
213
|
+
});
|
214
|
+
},
|
215
|
+
|
216
|
+
/**
|
217
|
+
* This function verifies plotted points on the number line on the preview tab.
|
218
|
+
* @param {number} range - The range of x coordinates.
|
219
|
+
* @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
|
220
|
+
*/
|
221
|
+
verifyIncorrectResponseOnNumberLinePreviewTab: (label, range, coordinate) => {
|
222
|
+
numberLineLabelPage.numberLinePreviewTab()
|
223
|
+
.then(($graphElement) => {
|
224
|
+
const graphWidth = $graphElement[0].clientWidth;
|
225
|
+
const originX = graphWidth / 2;
|
226
|
+
const xPixel = originX + coordinate * (graphWidth / range);
|
227
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
|
228
|
+
.should('have.css', 'stroke', css.color.incorrectAnswer);
|
229
|
+
});
|
230
|
+
numberLineLabelPage.numberLinePreviewTab()
|
231
|
+
.parents('.ngie-jxgbox')
|
232
|
+
.within(() => {
|
233
|
+
numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
|
234
|
+
.contains(label)
|
235
|
+
.should('have.class', 'icon-incorrect-cross')
|
236
|
+
.should('have.css', 'border', `1px solid ${css.color.incorrectAnswer}`)
|
237
|
+
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
238
|
+
});
|
239
|
+
},
|
240
|
+
|
241
|
+
/**
|
242
|
+
* This function verifies plotted points on the number line on the preview tab.
|
243
|
+
* @param {number} range - The range of x coordinates.
|
244
|
+
* @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
|
245
|
+
*/
|
246
|
+
verifyCorrectResponseOnNumberLinePreviewTab: (label, range, coordinate) => {
|
247
|
+
numberLineLabelPage.numberLinePreviewTab()
|
248
|
+
.then(($graphElement) => {
|
249
|
+
const graphWidth = $graphElement[0].clientWidth;
|
250
|
+
const originX = graphWidth / 2;
|
251
|
+
const xPixel = originX + coordinate * (graphWidth / range);
|
252
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
|
253
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
254
|
+
});
|
255
|
+
numberLineLabelPage.numberLinePreviewTab()
|
256
|
+
.parents('.ngie-jxgbox')
|
257
|
+
.within(() => {
|
258
|
+
numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
|
259
|
+
.contains(label)
|
260
|
+
.should('have.class', 'icon-correct-tick')
|
261
|
+
.should('have.css', 'border', `1px solid ${css.color.correctAnswer}`)
|
262
|
+
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
263
|
+
});
|
264
|
+
},
|
265
|
+
|
266
|
+
/**
|
267
|
+
* This function verifies plotted points on the number line do not exist on the preview tab.
|
268
|
+
* @param {number} range - The range of x coordinates.
|
269
|
+
* @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
|
270
|
+
*/
|
271
|
+
verifyPointsNotExistOnNumberLinePreviewTab: (range, coordinates) => {
|
272
|
+
coordinates.forEach(x => {
|
273
|
+
numberLineLabelPage.numberLinePreviewTab()
|
274
|
+
.then(($graphElement) => {
|
275
|
+
const graphWidth = $graphElement[0].clientWidth;
|
276
|
+
const originX = graphWidth / 2;
|
277
|
+
const xPixel = originX + x * (graphWidth / range);
|
278
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
|
279
|
+
.should('not.exist');
|
280
|
+
});
|
281
|
+
});
|
282
|
+
},
|
283
|
+
|
284
|
+
//Correct answer section
|
285
|
+
/**
|
286
|
+
* This function verifies correct plotted points on the number line on c tab
|
287
|
+
* @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
|
288
|
+
* @param {number} range - range of x coordinate
|
289
|
+
*/
|
290
|
+
verifyCorrectResponseOnNumberLineCorrectAnswerSection: (label, range, coordinate) => {
|
291
|
+
numberLineLabelPage.numberLineCorrectAnswerSection()
|
292
|
+
.then(($graphElement) => {
|
293
|
+
const graphWidth = $graphElement[0].clientWidth;
|
294
|
+
const originX = graphWidth / 2;
|
295
|
+
const xPixel = originX + coordinate * (graphWidth / range);
|
296
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][display="inline"]`)
|
297
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
298
|
+
});
|
299
|
+
numberLineLabelPage.numberLineCorrectAnswerSection()
|
300
|
+
.parents('.ngie-jxgbox')
|
301
|
+
.within(() => {
|
302
|
+
numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
|
303
|
+
.contains(label)
|
304
|
+
.should('have.class', 'icon-correct-tick')
|
305
|
+
.should('have.css', 'border', `1px solid ${css.color.correctAnswer}`)
|
306
|
+
.verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
|
307
|
+
});
|
308
|
+
},
|
309
|
+
|
310
|
+
/**
|
311
|
+
* This function verifies the label in container and is disabled
|
312
|
+
* @param {string} label in the container
|
313
|
+
*/
|
314
|
+
verifyLabelIsDisabledForGradingView: (label) => {
|
315
|
+
numberLineLabelPage.draggableLabelsPreviewTab()
|
316
|
+
.contains(label)
|
317
|
+
.should('have.class', 'disable-label-tool');
|
318
|
+
},
|
319
|
+
|
320
|
+
verifyCorrectAnswerSectionNotExist: () => {
|
321
|
+
utilities.verifyElementVisibilityState(numberLineLabelPage.numberLineCorrectAnswerSection(), 'notExist');
|
322
|
+
}
|
323
|
+
}
|
324
|
+
|
325
|
+
const tests = {
|
326
|
+
...autoScoredScoringPreviewTab.tests
|
327
|
+
}
|
328
|
+
|
329
|
+
export const numberLineLabelPage = {
|
330
|
+
...selectors,
|
331
|
+
steps,
|
332
|
+
tests
|
333
|
+
}
|