itemengine-cypress-automation 1.0.344-graph-and-chart-r2-8153722.0 → 1.0.345-IEI-5793-aaaf0cf.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/GradingGridView/gradingGridView.js +156 -0
- package/cypress/e2e/ILC/ThinkSphere/createReviewItem.js +1 -1
- package/cypress/e2e/ILC/ThinkSphere/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/ThinkSphere/editThinkSphereQuestion.smoke.js +145 -54
- package/cypress/e2e/ILC/ThinkSphere/equationEditorEditCategoryFlyOut.js +2 -0
- package/cypress/e2e/ILC/ThinkSphere/planPhase.js +45 -5
- package/cypress/e2e/ILC/ThinkSphere/previewTabPlanSection.js +8 -8
- package/cypress/e2e/ILC/ThinkSphere/previewTabReviewSection.js +97 -0
- package/cypress/e2e/ILC/ThinkSphere/solvePhase.js +3 -3
- package/cypress/e2e/ILC/ThinkSphere/studentViewPlanTabSection.js +393 -0
- package/cypress/e2e/ILC/ThinkSphere/studentViewReviewTabSection.js +141 -0
- package/cypress/pages/components/defaultToolDropdown.js +1 -1
- package/cypress/pages/gradingGridViewPage.js +64 -0
- package/cypress/pages/index.js +1 -0
- package/cypress/pages/singleSelectionPage.js +30 -1
- package/cypress/pages/thinkSpherePage.js +316 -5
- package/cypress/support/helpers/createItem.js +22 -3
- package/cypress/support/helpers/utilities.js +13 -0
- package/package.json +1 -1
@@ -0,0 +1,64 @@
|
|
1
|
+
import utilities from "../support/helpers/utilities";
|
2
|
+
import { verifyIeQuestionData } from "../support/migrationHelpers/verifyIeQuestionData";
|
3
|
+
|
4
|
+
const selectors = {
|
5
|
+
sessionIdField: () => cy.get('[data-testid="SessionId"]'),
|
6
|
+
responseIdField: () => cy.get('[data-testid="ResponseId"]'),
|
7
|
+
itemIdField: () => cy.get('[data-testid="ItemId"]'),
|
8
|
+
studentIdField: () => cy.get('[data-testid="StudentId"]'),
|
9
|
+
launchGradingButton: () => cy.get('[data-testid="launchGrading"]'),
|
10
|
+
getgradingViewContainer: (sessionId, itemId, questionNo) =>
|
11
|
+
cy.get(`[data-reference="${sessionId}"] [data-reference="${itemId}_${sessionId}"] [class*="GradingViewstyles__SingleQuestionContainer"]`)
|
12
|
+
.eq(questionNo),
|
13
|
+
getGradingViewforResponseId: (responseId) =>
|
14
|
+
cy.get(`[data-reference="${responseId}"]`),
|
15
|
+
getquestionInstruction: () => cy.get('[data-testid = "question-instruction-element"]').eq(0),
|
16
|
+
getAnswerStatus: () => cy.get('[class*="indexstyle__AnswerTextWrapper"]'),
|
17
|
+
};
|
18
|
+
|
19
|
+
const steps = {
|
20
|
+
/**
|
21
|
+
* Adds session data and launches the grading view.
|
22
|
+
*
|
23
|
+
* @param {Object} params - Parameters for session setup and grading.
|
24
|
+
* @param {Array<string>} params.studentIds - Array of studentIds to be graded.
|
25
|
+
* @param {Array<string>} params.sessionIds - Array of sessionIds to be graded.
|
26
|
+
* @param {Array<string>} params.itemIds - Array of item IDs involved in the session.
|
27
|
+
* @param {Array<string>} params.responseIds - Array of response IDs corresponding to each student/item.
|
28
|
+
*/
|
29
|
+
addSessionDataAndLaunchGrading: ({studentIds = [], sessionIds = [], itemIds = [], responseIds = []}) => {
|
30
|
+
const students = studentIds.join(", ");
|
31
|
+
const sessions = sessionIds.join(", ");
|
32
|
+
const items = itemIds.join(", ");
|
33
|
+
const responses = responseIds.join(", ");
|
34
|
+
sessions && gradingGridViewPage.sessionIdField().clear().type(sessions);
|
35
|
+
students && gradingGridViewPage.studentIdField().clear().type(students);
|
36
|
+
items && gradingGridViewPage.itemIdField().clear().type(items);
|
37
|
+
responses && gradingGridViewPage.responseIdField().clear().type(responses);
|
38
|
+
gradingGridViewPage.launchGradingButton().click();
|
39
|
+
},
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Verifies the session data displayed in the grading view container for a specific question.
|
43
|
+
*
|
44
|
+
* @param {string} sessionId - The unique identifier for the session.
|
45
|
+
* @param {string} itemId - The unique identifier for the item within the session.
|
46
|
+
* @param {number} questionNo - The zero-based index of the question to verify.
|
47
|
+
* @param {string} questionInstruction - The expected instruction text for the question.
|
48
|
+
* @param {string} answerStatus - The expected answer status (e.g., "Answered", "Not Answered").
|
49
|
+
*/
|
50
|
+
verifySessionData: (sessionId, itemId, questionNo, questionInstruction, answerStatus) => {
|
51
|
+
gradingGridViewPage.getgradingViewContainer(sessionId, itemId, questionNo)
|
52
|
+
.within(() => {
|
53
|
+
gradingGridViewPage.getquestionInstruction()
|
54
|
+
.should('contain.text', questionInstruction);
|
55
|
+
gradingGridViewPage.getAnswerStatus()
|
56
|
+
.should('contain.text', answerStatus);
|
57
|
+
});
|
58
|
+
},
|
59
|
+
};
|
60
|
+
|
61
|
+
export const gradingGridViewPage = {
|
62
|
+
...selectors,
|
63
|
+
steps
|
64
|
+
};
|
package/cypress/pages/index.js
CHANGED
@@ -704,7 +704,36 @@ const steps = {
|
|
704
704
|
optionsTextArray.forEach((option, optionIndex) => {
|
705
705
|
utilities.verifyTextContent(utilities.getNthElement(singleSelectionPage.optionsInputFieldInQuestionPreviewTab(), optionIndex), option);
|
706
706
|
});
|
707
|
-
}
|
707
|
+
},
|
708
|
+
|
709
|
+
/**
|
710
|
+
* @description. Checks the options checkbox in the 'Specify correct answer' section for multiple selection questions.
|
711
|
+
* @param {number} optionIndex - The index of the option checkbox to be checked.
|
712
|
+
* @throws {Error} Will throw an error if the checkbox is not checked after the operation.
|
713
|
+
* @example - checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
|
714
|
+
*/
|
715
|
+
setCorrectAnswer: (optionIndex) => {
|
716
|
+
singleSelectionPage.optionWrapperCorrectAnswerSection()
|
717
|
+
.eq(optionIndex)
|
718
|
+
.click()
|
719
|
+
},
|
720
|
+
|
721
|
+
/**
|
722
|
+
* Creates a basic single selection question
|
723
|
+
* @param {Object} params - Parameters for the question.
|
724
|
+
* @param {string} params.questionInstruction - The question text.
|
725
|
+
* @param {Array<string>} params.options - The list of options.
|
726
|
+
* @param {number} params.points - The points allotted for the question.
|
727
|
+
* @param {number} params.correctAnswer - Index of the correct answer.
|
728
|
+
*/
|
729
|
+
createBasicSingleSelectionQuestion: ({questionInstruction, options, points, correctAnswer}) => {
|
730
|
+
cy.barsPreLoaderWait();
|
731
|
+
singleSelectionPage.steps.addTextInQuestionInstructionsInputField(questionInstruction);
|
732
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
733
|
+
singleSelectionPage.steps.allotPoints(points);
|
734
|
+
singleSelectionPage.steps.setCorrectAnswer(correctAnswer);
|
735
|
+
singleSelectionPage.saveQuestionButton().click();
|
736
|
+
},
|
708
737
|
};
|
709
738
|
|
710
739
|
const tests = {
|
@@ -80,7 +80,7 @@ const selectors = {
|
|
80
80
|
planStrategyListResetToDefault: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="Planstyles__DefaultResetWrapper"]'),
|
81
81
|
planStrategyAddItemButton: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="ListOptionsComponentstyles__AddItemWrapper"] [role="button"]'),
|
82
82
|
planStrategyCheckbox: () => cy.get('[class*="Planstyles__StrategiesWrapper"] .thinksphere-option-text-field-wrapper [data-ngie-testid*="-checkbox"]'),
|
83
|
-
videoLinkComponent: () => utilities.getNthElement(cy.get('[class*="ListOptionsComponentstyles__UploadVideoWrapper"]'),
|
83
|
+
videoLinkComponent: (nthElement = 0) => utilities.getNthElement(cy.get('[class*="ListOptionsComponentstyles__UploadVideoWrapper"]'), nthElement),
|
84
84
|
uploadVideoLinkButton: () => cy.get('[class*="ListOptionsComponentstyles__UploadVideoTextWrapper"]'),
|
85
85
|
planSentenceStarterSection: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"]'),
|
86
86
|
planSentenceStarterListHeader: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="Planstyles__HeadingTextWrapper"]'),
|
@@ -98,7 +98,7 @@ const selectors = {
|
|
98
98
|
editVideoButton: () => cy.get('[aria-label*="Change video"]'),
|
99
99
|
deleteVideoButton: () => cy.get('[aria-label*="Delete video"]'),
|
100
100
|
listInputField: () => cy.get('.option-component textarea[placeholder]'),
|
101
|
-
deleteButton: () => cy.get('button[aria-label*="Delete"]'),
|
101
|
+
deleteButton: () => cy.get('button[aria-label*="Delete"].ngie-icon-btn-cls'),
|
102
102
|
optionNumeration: () => cy.get('[class*="MuiInputAdornment-positionStart"]'),
|
103
103
|
iconPencil: () => cy.get('div[class*="icon-pencil"]'),
|
104
104
|
iconXCircle: () => cy.get('div[class*="icon-x-circle"]'),
|
@@ -212,6 +212,16 @@ const selectors = {
|
|
212
212
|
cardWrapper: () => cy.get('.card-wrapper'),
|
213
213
|
cardLabel: () => cy.get('.widget-card-label'),
|
214
214
|
thinkSphereQuestionInstructionCKEditor: () => cy.get('div.cke_editable[contenteditable="true"]'),
|
215
|
+
reviewTab: () => cy.get('div[aria-label="Review tab"]'),
|
216
|
+
planTab: () => cy.get('div[aria-label="Plan tab"]'),
|
217
|
+
checkYourMathHeading: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__CheckYourMathTextWrapper"]'), 0),
|
218
|
+
problemAskingToMeTextWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ProblemAskingToMeTextWrapper"]'), 0),
|
219
|
+
reviewQuestionWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__QuestionWrapper"]'), 0),
|
220
|
+
reviewComponentWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ComponentWrapper"]'), 0),
|
221
|
+
problemStatementWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ProblemStatementWrapper"]'), 0),
|
222
|
+
gradingViewRadioButton: () => cy.get('label[aria-label="Grading View"]'),
|
223
|
+
studentViewRadioButton: () => cy.get('label[aria-label="Student View"]'),
|
224
|
+
correctAnswerLabelWrapper: () => cy.get('div[class*="CorrectAnswerLabelWrapper"]'),
|
215
225
|
};
|
216
226
|
|
217
227
|
const steps = {
|
@@ -620,14 +630,14 @@ const steps = {
|
|
620
630
|
.within(() => {
|
621
631
|
utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
|
622
632
|
.clear()
|
623
|
-
.type(text);
|
633
|
+
.type(text, { delay: 500 });
|
624
634
|
});
|
625
635
|
} else {
|
626
636
|
thinkSpherePage.planSentenceStarterSection()
|
627
637
|
.within(() => {
|
628
638
|
utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
|
629
639
|
.clear()
|
630
|
-
.type(text);
|
640
|
+
.type(text, { delay: 500 });
|
631
641
|
});
|
632
642
|
}
|
633
643
|
},
|
@@ -775,10 +785,11 @@ const steps = {
|
|
775
785
|
clickOnEditQuestionIcon: () => {
|
776
786
|
utilities.getNthElement(thinkSpherePage.editQuestionPencil(), 0)
|
777
787
|
.click();
|
788
|
+
cy.wait(1000);
|
778
789
|
},
|
779
790
|
|
780
791
|
clickOnQuestionInstructionExpandImageButton: () => {
|
781
|
-
thinkSpherePage.questionInstructionPreviewImageExpandButton()
|
792
|
+
utilities.getNthElement(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 0)
|
782
793
|
.click();
|
783
794
|
},
|
784
795
|
|
@@ -1104,6 +1115,243 @@ const steps = {
|
|
1104
1115
|
expect(scrollWidth).to.be.greaterThan(clientWidth);
|
1105
1116
|
});
|
1106
1117
|
},
|
1118
|
+
|
1119
|
+
verifyQuestionImagePopup: () => {
|
1120
|
+
thinkSpherePage.dialogBoxRoot()
|
1121
|
+
.within(() => {
|
1122
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionImagePopup(), 'visible');
|
1123
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.closeExpandImagePopupButton(), 'visible');
|
1124
|
+
});
|
1125
|
+
},
|
1126
|
+
|
1127
|
+
verifyAddNewStrategyPopupCloseFunctionality: () => {
|
1128
|
+
let countBeforeOpeningPopup, countAfterClosingPopup;
|
1129
|
+
cy.get(thinkSpherePage.strategiesBoxPreviewTab())
|
1130
|
+
.its('length')
|
1131
|
+
.then((count) => {
|
1132
|
+
countBeforeOpeningPopup = count;
|
1133
|
+
cy.log('Count before opening popup:', countBeforeOpeningPopup);
|
1134
|
+
});
|
1135
|
+
thinkSpherePage.addNewStrategyButton().click();
|
1136
|
+
thinkSpherePage.addStrategyPopupCancelButton().click();
|
1137
|
+
cy.get(thinkSpherePage.strategiesBoxPreviewTab())
|
1138
|
+
.its('length')
|
1139
|
+
.then((count) => {
|
1140
|
+
countAfterClosingPopup = count;
|
1141
|
+
cy.log('Count after closing popup:', countAfterClosingPopup);
|
1142
|
+
expect(countAfterClosingPopup).to.equal(countBeforeOpeningPopup);
|
1143
|
+
});
|
1144
|
+
},
|
1145
|
+
|
1146
|
+
verifyAddNewStrategyPopupSaveFunctionality: () => {
|
1147
|
+
let countBeforeOpeningPopup, countAfterClosingPopup;
|
1148
|
+
thinkSpherePage.strategiesBoxPreviewTab()
|
1149
|
+
.its('length')
|
1150
|
+
.then((count) => {
|
1151
|
+
countBeforeOpeningPopup = count;
|
1152
|
+
cy.log('Count before opening popup:', countBeforeOpeningPopup);
|
1153
|
+
});
|
1154
|
+
thinkSpherePage.addNewStrategyButton().click();
|
1155
|
+
thinkSpherePage.strategyNameInputField().type('Test Strategy');
|
1156
|
+
thinkSpherePage.addStrategyPopupSaveButton().click();
|
1157
|
+
thinkSpherePage.strategiesBoxPreviewTab()
|
1158
|
+
.its('length')
|
1159
|
+
.then((count) => {
|
1160
|
+
countAfterClosingPopup = count;
|
1161
|
+
cy.log('Count after closing popup:', countAfterClosingPopup);
|
1162
|
+
expect(countAfterClosingPopup).to.equal(countBeforeOpeningPopup + 1);
|
1163
|
+
});
|
1164
|
+
},
|
1165
|
+
|
1166
|
+
verifyVideoPopupDialogBox: () => {
|
1167
|
+
thinkSpherePage.dialogBoxRoot()
|
1168
|
+
.within(() => {
|
1169
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.dialogBoxTitle(), 'visible');
|
1170
|
+
utilities.verifyInnerText(thinkSpherePage.dialogBoxTitle(), 'Create_a_model');
|
1171
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.buttonClose(), 'visible');
|
1172
|
+
});
|
1173
|
+
},
|
1174
|
+
|
1175
|
+
verifySentenceStartersDropdown: () => {
|
1176
|
+
thinkSpherePage.chooseStarterTextIconWrapper()
|
1177
|
+
.within(() => {
|
1178
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.starterIocn(), 'visible');
|
1179
|
+
utilities.verifyInnerText(thinkSpherePage.starterTextWrapper(), 'Starters');
|
1180
|
+
});
|
1181
|
+
thinkSpherePage.chooseStarterDropdown()
|
1182
|
+
.verifyPseudoClassBeforeProperty('content', '""');
|
1183
|
+
},
|
1184
|
+
|
1185
|
+
verifySentenceStartersDropdownOptions: (sentenceStartersTextDefault) => {
|
1186
|
+
sentenceStartersTextDefault.forEach((label, index) => {
|
1187
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
1188
|
+
});
|
1189
|
+
},
|
1190
|
+
|
1191
|
+
verifySentenceStartersDropdownFunctionality: () => {
|
1192
|
+
thinkSpherePage.writePlanWrapper()
|
1193
|
+
.within(() => {
|
1194
|
+
thinkSpherePage.contentEditableDiv().clear();
|
1195
|
+
});
|
1196
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
1197
|
+
utilities.getNthElement(thinkSpherePage.chooseStartersListOptions(), 1).click();
|
1198
|
+
thinkSpherePage.writePlanWrapper()
|
1199
|
+
.within(() => {
|
1200
|
+
thinkSpherePage.contentEditableDiv().should('have.value', 'First, I will ');
|
1201
|
+
thinkSpherePage.contentEditableDiv().clear();
|
1202
|
+
});
|
1203
|
+
},
|
1204
|
+
|
1205
|
+
verifyProblemAskingHeading: () => {
|
1206
|
+
thinkSpherePage.problemAskingWrapper()
|
1207
|
+
.within(() => {
|
1208
|
+
utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'The problem is asking me to');
|
1209
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
|
1210
|
+
});
|
1211
|
+
},
|
1212
|
+
|
1213
|
+
verifyProblemAskingTextArea: () => {
|
1214
|
+
thinkSpherePage.problemAskingWrapper()
|
1215
|
+
.within(() => {
|
1216
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.contentEditableDiv(), 'visible');
|
1217
|
+
utilities.verifyElementAttribute(thinkSpherePage.contentEditableDiv(), 'placeholder', 'Enter your text here');
|
1218
|
+
});
|
1219
|
+
},
|
1220
|
+
|
1221
|
+
verifyProblemAskingMicSection: () => {
|
1222
|
+
thinkSpherePage.problemAskingWrapper()
|
1223
|
+
.within(() => {
|
1224
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
|
1225
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
|
1226
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
|
1227
|
+
});
|
1228
|
+
},
|
1229
|
+
|
1230
|
+
verifyProblemAskingTextAreaFunctionality: (textToEnter) => {
|
1231
|
+
thinkSpherePage.problemAskingWrapper()
|
1232
|
+
.within(() => {
|
1233
|
+
thinkSpherePage.contentEditableDiv().type(textToEnter);
|
1234
|
+
thinkSpherePage.contentEditableDiv().should('have.value', textToEnter);
|
1235
|
+
});
|
1236
|
+
},
|
1237
|
+
|
1238
|
+
verifyStrategiesToPlanHeading: () => {
|
1239
|
+
thinkSpherePage.strategiesToPlanWrapper()
|
1240
|
+
.within(() => {
|
1241
|
+
utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'Add strategies to plan');
|
1242
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
|
1243
|
+
});
|
1244
|
+
},
|
1245
|
+
|
1246
|
+
verifyWritePlanHeading: () => {
|
1247
|
+
thinkSpherePage.writePlanWrapper()
|
1248
|
+
.within(() => {
|
1249
|
+
utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'Write your plan');
|
1250
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
|
1251
|
+
});
|
1252
|
+
},
|
1253
|
+
|
1254
|
+
verifyWritePlanTextArea: () => {
|
1255
|
+
thinkSpherePage.writePlanWrapper()
|
1256
|
+
.within(() => {
|
1257
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.contentEditableDiv(), 'visible');
|
1258
|
+
utilities.verifyElementAttribute(thinkSpherePage.contentEditableDiv(), 'placeholder', 'Enter your plan here');
|
1259
|
+
});
|
1260
|
+
},
|
1261
|
+
|
1262
|
+
verifyWritePlanMicSection: () => {
|
1263
|
+
thinkSpherePage.writePlanWrapper()
|
1264
|
+
.within(() => {
|
1265
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
|
1266
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
|
1267
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
|
1268
|
+
});
|
1269
|
+
},
|
1270
|
+
|
1271
|
+
verifyWritePlanTextAreaFunctionality: (planTextToEnter) => {
|
1272
|
+
thinkSpherePage.writePlanWrapper()
|
1273
|
+
.within(() => {
|
1274
|
+
thinkSpherePage.contentEditableDiv().type(planTextToEnter);
|
1275
|
+
thinkSpherePage.contentEditableDiv().should('have.value', planTextToEnter);
|
1276
|
+
thinkSpherePage.contentEditableDiv().clear();
|
1277
|
+
});
|
1278
|
+
},
|
1279
|
+
|
1280
|
+
verifyStrategyChipClickFunctionality: () => {
|
1281
|
+
thinkSpherePage.writePlanWrapper()
|
1282
|
+
.within(() => {
|
1283
|
+
thinkSpherePage.contentEditableDiv().clear();
|
1284
|
+
});
|
1285
|
+
thinkSpherePage.strategyChip().click();
|
1286
|
+
thinkSpherePage.writePlanWrapper()
|
1287
|
+
.within(() => {
|
1288
|
+
thinkSpherePage.contentEditableDiv().should('have.value', 'look for a pattern ');
|
1289
|
+
});
|
1290
|
+
},
|
1291
|
+
clickUploadVideoButton: () => {
|
1292
|
+
thinkSpherePage.uploadVideoLinkButton()
|
1293
|
+
.click();
|
1294
|
+
},
|
1295
|
+
|
1296
|
+
verifyPreAuthoredVideoTitles: (defaultStrategyTexts) => {
|
1297
|
+
defaultStrategyTexts.forEach((text,index) => {
|
1298
|
+
thinkSpherePage.videoLinkComponent(index)
|
1299
|
+
.within(() => {
|
1300
|
+
utilities.verifyInnerText(thinkSpherePage.uploadVideoLinkButton(), text);
|
1301
|
+
})
|
1302
|
+
});
|
1303
|
+
},
|
1304
|
+
|
1305
|
+
verifyPreAuthoredVideos: (preAuthoredVideos) => {
|
1306
|
+
preAuthoredVideos.forEach(({duration}, optionIndex) => {
|
1307
|
+
thinkSpherePage.videoLinkComponent(optionIndex)
|
1308
|
+
.within(thinkSpherePage.steps.clickUploadVideoButton);
|
1309
|
+
thinkSpherePage.steps.startPlayback();
|
1310
|
+
thinkSpherePage.steps.waitForPlaybackToBegin();
|
1311
|
+
thinkSpherePage.playerTimer()
|
1312
|
+
.should('contain', `/${duration}`);
|
1313
|
+
thinkSpherePage.steps.closeVideoPopup();
|
1314
|
+
})
|
1315
|
+
},
|
1316
|
+
|
1317
|
+
clickOnReviewTab: () => {
|
1318
|
+
thinkSpherePage.reviewTab()
|
1319
|
+
.click();
|
1320
|
+
},
|
1321
|
+
|
1322
|
+
clickOnPlanTab: () => {
|
1323
|
+
thinkSpherePage.planTab()
|
1324
|
+
.click();
|
1325
|
+
},
|
1326
|
+
|
1327
|
+
switchToGradingView: () => {
|
1328
|
+
thinkSpherePage.gradingViewRadioButton()
|
1329
|
+
.click();
|
1330
|
+
},
|
1331
|
+
|
1332
|
+
switchToStudentView: () => {
|
1333
|
+
thinkSpherePage.studentViewRadioButton()
|
1334
|
+
.click();
|
1335
|
+
},
|
1336
|
+
|
1337
|
+
verifyCorrectAnswerLabel: () => {
|
1338
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.correctAnswerLabelWrapper(), 'visible');
|
1339
|
+
},
|
1340
|
+
|
1341
|
+
addImageAlternativeTextInputFieldText: (alternateTextForImage) => {
|
1342
|
+
thinkSpherePage.imageAlternativeTextInputField().type(alternateTextForImage);
|
1343
|
+
cy.wait(2000);
|
1344
|
+
},
|
1345
|
+
|
1346
|
+
verifyQuestionInstructionPreviewTexWrapperVisibility: (instructionText) => {
|
1347
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'visible');
|
1348
|
+
utilities.verifyInnerText(thinkSpherePage.questionInstructionPreviewTexWrapper(), instructionText);
|
1349
|
+
},
|
1350
|
+
|
1351
|
+
verifyQuestionInstructionPreviewImageWrapperVisibility: () => {
|
1352
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageWrapper(), 'visible');
|
1353
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 'visible');
|
1354
|
+
},
|
1107
1355
|
};
|
1108
1356
|
|
1109
1357
|
const tests = {
|
@@ -1865,6 +2113,69 @@ const tests = {
|
|
1865
2113
|
thinkSpherePage.editTab().should('have.class', 'Mui-selected');
|
1866
2114
|
});
|
1867
2115
|
},
|
2116
|
+
|
2117
|
+
/**
|
2118
|
+
* Verifies the functionality of editing, selecting, and unselecting strategies and sentence starters.
|
2119
|
+
* Ensures that changes are saved successfully and reflected in the preview section.
|
2120
|
+
*
|
2121
|
+
* @param {Object} sentenceStartersObject - The object containing strategies and sentence starters data.
|
2122
|
+
* @param {Array<string>} sentenceStartersObject.editedStrategies - The list of edited strategies to verify.
|
2123
|
+
* @param {Array<string>} sentenceStartersObject.editedSentenceStarters - The list of edited sentence starters to verify.
|
2124
|
+
* @param {Array<string>} sentenceStartersObject.selectStrategies - The list of strategies to select and verify.
|
2125
|
+
* @param {Array<string>} sentenceStartersObject.selectSentenceStarters - The list of sentence starters to select and verify.
|
2126
|
+
*/
|
2127
|
+
verifyStrategiesAndSentenceStartersSection: (sentenceStartersObject) => {
|
2128
|
+
const {
|
2129
|
+
editedStrategies, editedSentenceStarters, selectStrategies, selectSentenceStarters
|
2130
|
+
} = sentenceStartersObject || {};
|
2131
|
+
it('When user edits the strategies and sentence starers, then the changes should be saved successfully and edited strategies and sentence starers should get displayed in preview side', () => {
|
2132
|
+
thinkSpherePage.steps.switchToEditTab();
|
2133
|
+
thinkSpherePage.steps.clickOnEditQuestionIcon();
|
2134
|
+
editedStrategies.forEach((strategy, index) => {
|
2135
|
+
thinkSpherePage.steps.addOptionText('strategy', index, strategy);
|
2136
|
+
});
|
2137
|
+
editedSentenceStarters.forEach((sentenceStarter, index) => {
|
2138
|
+
thinkSpherePage.steps.addOptionText('sentenceStarter', index, sentenceStarter);
|
2139
|
+
});
|
2140
|
+
thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
|
2141
|
+
thinkSpherePage.steps.switchToPreviewTab();
|
2142
|
+
editedStrategies.forEach((label, index) => {
|
2143
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
|
2144
|
+
});
|
2145
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
2146
|
+
editedSentenceStarters.forEach((label, index) => {
|
2147
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
2148
|
+
});
|
2149
|
+
utilities.clickOnBody();
|
2150
|
+
});
|
2151
|
+
|
2152
|
+
it('When user select unselect the strategies and sentence starers, then the changes should be saved successfully and selected strategies and sentence starers should get displayed in preview side', () => {
|
2153
|
+
thinkSpherePage.steps.switchToEditTab();
|
2154
|
+
thinkSpherePage.steps.clickOnEditQuestionIcon();
|
2155
|
+
editedStrategies.forEach((strategy, index) => {
|
2156
|
+
if(!selectStrategies.includes(strategy)){
|
2157
|
+
thinkSpherePage.steps.selectOption('strategy', index);
|
2158
|
+
}
|
2159
|
+
});
|
2160
|
+
cy.wait(2000);
|
2161
|
+
editedSentenceStarters.forEach((sentenceStarter, index) => {
|
2162
|
+
if(!selectSentenceStarters.includes(sentenceStarter)){
|
2163
|
+
thinkSpherePage.steps.selectOption('sentenceStarter', index);
|
2164
|
+
}
|
2165
|
+
});
|
2166
|
+
cy.wait(2000);
|
2167
|
+
thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
|
2168
|
+
thinkSpherePage.steps.switchToPreviewTab();
|
2169
|
+
selectStrategies.forEach((label, index) => {
|
2170
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
|
2171
|
+
});
|
2172
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
2173
|
+
selectSentenceStarters.forEach((label, index) => {
|
2174
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
2175
|
+
});
|
2176
|
+
utilities.clickOnBody();
|
2177
|
+
});
|
2178
|
+
},
|
1868
2179
|
};
|
1869
2180
|
|
1870
2181
|
export const thinkSpherePage = {
|
@@ -437,7 +437,7 @@ Cypress.Commands.add('deleteItems', () => {
|
|
437
437
|
});
|
438
438
|
});
|
439
439
|
|
440
|
-
Cypress.Commands.add('createThinkSphereItem', (itemName) => {
|
440
|
+
Cypress.Commands.add('createThinkSphereItem', (itemName, studentView) => {
|
441
441
|
const token = window.localStorage.getItem('ngie_accessToken');
|
442
442
|
const firstName = window.localStorage.getItem('ngie_firstName');
|
443
443
|
const lastName = window.localStorage.getItem('ngie_lastName');
|
@@ -828,7 +828,17 @@ Cypress.Commands.add('createThinkSphereItem', (itemName) => {
|
|
828
828
|
{
|
829
829
|
"text": "Create a model",
|
830
830
|
"selected": true,
|
831
|
-
"videoData": {
|
831
|
+
"videoData": studentView ? {
|
832
|
+
"description": "",
|
833
|
+
"error": false,
|
834
|
+
"fileKey": "thinkSphere/resources/ngie_predefined_strategy_1.mp4",
|
835
|
+
"fileName": "Create_a_model",
|
836
|
+
"mediaCredits": "",
|
837
|
+
"originalName": "ngie_predefined_strategy_1.mp4",
|
838
|
+
"size": "",
|
839
|
+
"type": "video/mp4",
|
840
|
+
"uploadUrl": "https://itemengine-file-management.itemengine-qa.il-apps.com/api/files/document?key=thinkSphere/resources/ngie_predefined_strategy_1.mp4"
|
841
|
+
} : {
|
832
842
|
"fileName": "",
|
833
843
|
"size": "",
|
834
844
|
"type": "",
|
@@ -906,7 +916,16 @@ Cypress.Commands.add('createThinkSphereItem', (itemName) => {
|
|
906
916
|
"id": "5"
|
907
917
|
}
|
908
918
|
],
|
909
|
-
"backgroundImg": {
|
919
|
+
"backgroundImg": studentView ? {
|
920
|
+
"description": "",
|
921
|
+
"fileKey": "prompt/document/195e9660-d2ff-44c1-ab7b-f257b3804d8d.png",
|
922
|
+
"mediaCredits": "",
|
923
|
+
"name": "testtest.png",
|
924
|
+
"originalName": "testtest.png",
|
925
|
+
"size": 10235,
|
926
|
+
"type": "image/png",
|
927
|
+
"uploadUrl": "https://itemengine-file-management.itemengine-qa.il-apps.com/api/files/document?key=prompt/document/195e9660-d2ff-44c1-ab7b-f257b3804d8d.png"
|
928
|
+
} : {
|
910
929
|
"type": "",
|
911
930
|
"uploadUrl": "",
|
912
931
|
"width": "",
|
@@ -156,6 +156,11 @@ const utilities = {
|
|
156
156
|
.realHover({ position: 'topRight' });
|
157
157
|
},
|
158
158
|
|
159
|
+
clickOnBody: () => {
|
160
|
+
cy.get('body')
|
161
|
+
.click();
|
162
|
+
},
|
163
|
+
|
159
164
|
/**
|
160
165
|
* @description trigger a mouseover event on an element
|
161
166
|
* @param {*} selector cy.get selector
|
@@ -255,6 +260,14 @@ const utilities = {
|
|
255
260
|
cy.get('body')
|
256
261
|
.click();
|
257
262
|
},
|
263
|
+
|
264
|
+
/**
|
265
|
+
* Simulates pressing the Escape key.
|
266
|
+
* @returns {null} - Returns null after the action is performed.
|
267
|
+
*/
|
268
|
+
pressEscapeKey: () => {
|
269
|
+
cy.get('body').type('{esc}');
|
270
|
+
},
|
258
271
|
}
|
259
272
|
|
260
273
|
export default utilities
|