itemengine-cypress-automation 1.0.142-npmScriptsUpdate-6127061.0 → 1.0.142
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/migration/migration.js +3 -1
- package/cypress/e2e/migration/migration10.js +2 -0
- package/cypress/e2e/migration/migration2.js +2 -0
- package/cypress/e2e/migration/migration3.js +2 -0
- package/cypress/e2e/migration/migration4.js +2 -0
- package/cypress/e2e/migration/migration5.js +2 -0
- package/cypress/e2e/migration/migration6.js +2 -0
- package/cypress/e2e/migration/migration7.js +2 -0
- package/cypress/e2e/migration/migration8.js +2 -0
- package/cypress/e2e/migration/migration9.js +2 -0
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +77 -9
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +66 -2
- package/package.json +2 -2
@@ -13,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
|
|
13
13
|
let lrnQuestionDataArr = [];
|
14
14
|
let lrnGradingDataArr = [];
|
15
15
|
|
16
|
-
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100);//["c68472be-55b8-4367-a985-406789d948a1"
|
16
|
+
let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100);//["c68472be-55b8-4367-a985-406789d948a1", "49d213c7-2bea-42b8-a635-fc56b7f6e759", "42be7ec5-2023-434e-a114-3a019afe0e64", "47f298b2-58a0-49a1-b730-00e886520d91", "79186be1-3722-4786-9290-957f242f9473", "8a91a61c-7988-4422-a39b-b7f6ecd7fd8f"]
|
17
17
|
|
18
18
|
if (referenceIds.length > 0) {
|
19
19
|
describe('Migration item check for MCQ questions', () => {
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -102,6 +102,7 @@ if (referenceIds.length > 0) {
|
|
102
102
|
if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
|
103
103
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
|
104
104
|
else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
|
105
|
+
else if (currQuestionType === lrnQuestionTypesENUM.dndIntoCategories) extractLrnQuestionData.dndIntoCategoriesGrading(lrnGradingDataArr, index);
|
105
106
|
}
|
106
107
|
});
|
107
108
|
}
|
@@ -120,6 +121,7 @@ if (referenceIds.length > 0) {
|
|
120
121
|
case 'mcq': return verifyIeQuestionData.mcqGrading(questionData, index);
|
121
122
|
case 'textEntryMath': return verifyIeQuestionData.textEntryMathGrading(questionData, index);
|
122
123
|
case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImageGrading(questionData, index);
|
124
|
+
case 'dndIntoCategories': return verifyIeQuestionData.dndIntoCategoriesGrading(questionData, index);
|
123
125
|
default: throw new Error('Invalid ngie question type');
|
124
126
|
}
|
125
127
|
});
|
@@ -276,7 +276,7 @@ export const extractLrnQuestionData = {
|
|
276
276
|
|
277
277
|
essayResponse: (lrnQuestionDataArr, index) => {
|
278
278
|
let obj = {};
|
279
|
-
cy.log(`Extracting the question instructions
|
279
|
+
cy.log(`Extracting the question instructions, placeholder, toolbar options and word count/limit data from question ${index}`);
|
280
280
|
obj.questionIndex = index;
|
281
281
|
obj.questionType = 'essayResponse'
|
282
282
|
lrnPage.questionWrapper()
|
@@ -312,7 +312,7 @@ export const extractLrnQuestionData = {
|
|
312
312
|
|
313
313
|
essayResponseBasic: (lrnQuestionDataArr, index) => {
|
314
314
|
let obj = {};
|
315
|
-
cy.log(`Extracting the question instructions and
|
315
|
+
cy.log(`Extracting the question instructions, placeholder and word limit data from question ${index}`);
|
316
316
|
obj.questionIndex = index;
|
317
317
|
obj.questionType = 'essayResponseBasic';
|
318
318
|
lrnPage.questionWrapper()
|
@@ -339,7 +339,7 @@ export const extractLrnQuestionData = {
|
|
339
339
|
|
340
340
|
drawingResponse: (lrnQuestionDataArr, index) => {
|
341
341
|
let obj = {};
|
342
|
-
cy.log(`Extracting the question instructions
|
342
|
+
cy.log(`Extracting the question instructions, toolbar options and canvas background from question ${index}`);
|
343
343
|
obj.questionIndex = index;
|
344
344
|
obj.questionType = 'drawingResponse'
|
345
345
|
lrnPage.questionWrapper()
|
@@ -374,7 +374,7 @@ export const extractLrnQuestionData = {
|
|
374
374
|
|
375
375
|
dndIntoCategories: (lrnQuestionDataArr, index) => {
|
376
376
|
let obj = {};
|
377
|
-
cy.log(`Extracting the question instructions and options from question ${index}`);
|
377
|
+
cy.log(`Extracting the question instructions, rows columns text and draggable options from question ${index}`);
|
378
378
|
obj.questionIndex = index;
|
379
379
|
obj.questionType = 'dndIntoCategories'
|
380
380
|
lrnPage.questionWrapper()
|
@@ -426,14 +426,82 @@ export const extractLrnQuestionData = {
|
|
426
426
|
obj.options = options;
|
427
427
|
obj.optionImages = optionImages;
|
428
428
|
obj.optionEquations = optionEquations;
|
429
|
-
//droppable options innerText, if image then image alt text, dragHandle if lrn_icon...
|
430
|
-
//show drag handles
|
431
|
-
|
432
|
-
//grouped or standard
|
433
|
-
//correct answers options
|
434
429
|
});
|
435
430
|
lrnQuestionDataArr.push(obj);
|
436
431
|
},
|
432
|
+
|
433
|
+
dndIntoCategoriesGrading: (lrnGradingDataArr, index) => {
|
434
|
+
let obj = {};
|
435
|
+
cy.log(`Extracting the question instructions, rows columns text and correct answer options from question ${index}`);
|
436
|
+
obj.questionIndex = index;
|
437
|
+
obj.questionType = 'dndIntoCategories'
|
438
|
+
lrnPage.questionWrapper()
|
439
|
+
.eq(index)
|
440
|
+
.within(() => {
|
441
|
+
lrnPage.questionInstructions()
|
442
|
+
.then(($ins) => {
|
443
|
+
let text = $ins[0].innerText;
|
444
|
+
obj.previewQuestionInstructions = text;
|
445
|
+
});
|
446
|
+
let tableMatrix = [];
|
447
|
+
lrnPage.dndCategoriesTableRow()
|
448
|
+
.each(($tr) => {
|
449
|
+
let rowContents = [];
|
450
|
+
$tr[0].children.forEach(($th) => {
|
451
|
+
rowContents.push($th.innerText);
|
452
|
+
});
|
453
|
+
tableMatrix.push(rowContents);
|
454
|
+
});
|
455
|
+
obj.tableMatrix = tableMatrix;
|
456
|
+
let correctAnswers = [];
|
457
|
+
//correctAnswer
|
458
|
+
cy.get('.lrn_correctAnswerList li')
|
459
|
+
.each(($answers) => {
|
460
|
+
let answerData = {}
|
461
|
+
cy.wrap($answers)
|
462
|
+
.within(() => {
|
463
|
+
cy.get('.lrn_responseIndex')
|
464
|
+
.then(($element) => {
|
465
|
+
let answerNumeration = $element[0].innerText;
|
466
|
+
answerData.answerNumeration = answerNumeration;
|
467
|
+
});
|
468
|
+
let options = []
|
469
|
+
cy.get('.lrn_btn')
|
470
|
+
.each(($option, index) => {
|
471
|
+
let optionData = {}
|
472
|
+
let innerText = $option[0].innerText;
|
473
|
+
optionData.innerText = innerText;
|
474
|
+
let innerHTML = $option[0].innerHTML;
|
475
|
+
if (innerHTML.includes('<img')) {
|
476
|
+
cy.get('.lrn_btn')
|
477
|
+
.eq(index)
|
478
|
+
.find('img')
|
479
|
+
.then(($img) => {
|
480
|
+
let altText = $img[0].alt;
|
481
|
+
optionData.altText = altText;
|
482
|
+
});
|
483
|
+
}
|
484
|
+
if (innerHTML.includes('<math')) {
|
485
|
+
cy.get('.lrn_btn')
|
486
|
+
.eq(index)
|
487
|
+
.find('math')
|
488
|
+
.then(($element) => {
|
489
|
+
let outerHtml = $element[0].outerHTML;
|
490
|
+
optionData.equation = outerHtml;
|
491
|
+
});
|
492
|
+
}
|
493
|
+
options.push(optionData);
|
494
|
+
});
|
495
|
+
answerData.options = options
|
496
|
+
});
|
497
|
+
correctAnswers.push(answerData);
|
498
|
+
});
|
499
|
+
obj.correctAnswers = correctAnswers;
|
500
|
+
});
|
501
|
+
lrnGradingDataArr.push(obj);
|
502
|
+
},
|
503
|
+
|
504
|
+
|
437
505
|
/* singleSelection: (lrnQuestionDataArr, index) => {
|
438
506
|
let obj = {};
|
439
507
|
cy.log(`Extracting the question instructions and options from question ${index}`);
|
@@ -285,7 +285,7 @@ export const verifyIeQuestionData = {
|
|
285
285
|
}).then(() => {
|
286
286
|
expect(options).to.have.deep.members(expectedQuestionData.options);
|
287
287
|
});
|
288
|
-
if (expectedQuestionData.optionEquations) {
|
288
|
+
if (expectedQuestionData.optionEquations.length > 0) {
|
289
289
|
let optionEquations = [];
|
290
290
|
draggableOptionContainer.draggableOption()
|
291
291
|
.find('math')
|
@@ -295,7 +295,7 @@ export const verifyIeQuestionData = {
|
|
295
295
|
expect(optionEquations).to.have.deep.members(expectedQuestionData.optionEquations);
|
296
296
|
});
|
297
297
|
}
|
298
|
-
if (expectedQuestionData.optionImages) {
|
298
|
+
if (expectedQuestionData.optionImages.length > 0) {
|
299
299
|
let optionImages = [];
|
300
300
|
draggableOptionContainer.draggableOption()
|
301
301
|
.find('img')
|
@@ -308,6 +308,70 @@ export const verifyIeQuestionData = {
|
|
308
308
|
});
|
309
309
|
},
|
310
310
|
|
311
|
+
dndIntoCategoriesGrading: (expectedQuestionData, index) => {
|
312
|
+
cy.get('.ngie-drag-and-drop-into-categories')
|
313
|
+
.eq(index)
|
314
|
+
.within(() => {
|
315
|
+
utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.previewQuestionInstructions);
|
316
|
+
cy.get('.row')
|
317
|
+
.then(($rows) => {
|
318
|
+
expect($rows.length).to.be.eq(expectedQuestionData.tableMatrix.length);
|
319
|
+
expect($rows[0].children.length).to.be.eq(expectedQuestionData.tableMatrix[0].length);
|
320
|
+
});
|
321
|
+
/* cy.get('.row')
|
322
|
+
.each(($row, rowIndex) => {
|
323
|
+
$row[0].children.forEach(($cell, colIndex) => {
|
324
|
+
expect($cell.innerText).to.deep.eq(expectedQuestionData.tableMatrix[rowIndex][colIndex]);
|
325
|
+
});
|
326
|
+
}); */
|
327
|
+
cy.get('[class*="DragAndDropMatrixstyles__AnswerCell"]')
|
328
|
+
.then(($answerWrapper) => {
|
329
|
+
expect($answerWrapper.length).to.be.eq(expectedQuestionData.correctAnswers.length);
|
330
|
+
});
|
331
|
+
expectedQuestionData.correctAnswers.forEach((correctAnswerData, index) => {
|
332
|
+
cy.get('[class*="DragAndDropMatrixstyles__AnswerCell"]')
|
333
|
+
.eq(index)
|
334
|
+
.within(() => {
|
335
|
+
cy.get('.answer-numeration-number-box')
|
336
|
+
.then(($answerNumeration) => {
|
337
|
+
expect($answerNumeration[0].innerText).to.be.eq(correctAnswerData.answerNumeration);
|
338
|
+
});
|
339
|
+
cy.get('.answer-wrapper')
|
340
|
+
.then(($answerOption) => {
|
341
|
+
expect($answerOption.length).to.be.eq(correctAnswerData.options.length);
|
342
|
+
});
|
343
|
+
|
344
|
+
correctAnswerData.options.forEach((actualAnswerOption, index) => {
|
345
|
+
cy.get('.answer-wrapper')
|
346
|
+
.eq(index)
|
347
|
+
.then(($answerOption) => {
|
348
|
+
expect($answerOption[0].innerText).to.be.eq(actualAnswerOption.innerText);
|
349
|
+
if (actualAnswerOption.equation) {
|
350
|
+
cy.get('.answer-wrapper')
|
351
|
+
.eq(index)
|
352
|
+
.find('math')
|
353
|
+
.then(($math) => {
|
354
|
+
expect($math[0].outerHTML).to.be.eq(actualAnswerOption.equation);
|
355
|
+
});
|
356
|
+
}
|
357
|
+
if (actualAnswerOption.altText) {
|
358
|
+
cy.get('.answer-wrapper')
|
359
|
+
.eq(index)
|
360
|
+
.find('img')
|
361
|
+
.then(($img) => {
|
362
|
+
expect($img[0].alt).to.be.eq(actualAnswerOption.altText);
|
363
|
+
});
|
364
|
+
}
|
365
|
+
})
|
366
|
+
})
|
367
|
+
});
|
368
|
+
|
369
|
+
});
|
370
|
+
//cy.get('.answer-wrapper')
|
371
|
+
|
372
|
+
});
|
373
|
+
},
|
374
|
+
|
311
375
|
/* singleSelection: (expectedQuestionData, index) => {
|
312
376
|
cy.get('.ngie-single-select')
|
313
377
|
.eq(index)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.142
|
3
|
+
"version": "1.0.142",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -35,4 +35,4 @@
|
|
35
35
|
"node-fetch": "^3.3.2",
|
36
36
|
"react-uuid": "^2.0.0"
|
37
37
|
}
|
38
|
-
}
|
38
|
+
}
|