itemengine-cypress-automation 1.0.177-contentBlocksScript-b1350d4.0 → 1.0.177-contentBlocksScript-333ddc9.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
|
|
1
1
|
import { migrationScript } from "../../support/migrationHelpers/migrationScript"
|
2
2
|
|
3
|
-
let referenceIds =
|
3
|
+
let referenceIds = ['#182 RL.6.1 RL.6.3 RL.6.4 RL.6.6 Reading Literature Craft and Structure Key Ideas and Details ELA-Literacy 06',
|
4
|
+
'#307 RL.4.1 Reading Literature Key Ideas and Details ELA-Literacy 04',
|
5
|
+
'#309 RI.4.9 RL.4.9 W.4.2 W.4.4 Reading Literature Reading Informational Text Writing Integration of Knowledge and Ideas Production and Distribution of',
|
6
|
+
'#310 RL.5.1 RL.5.2 Reading Literature Key Ideas and Details ELA-Literacy 05',
|
7
|
+
'#311 RL.5.3 Reading Literature Key Ideas and Details ELA-Literacy 05']//JSON.parse(Cypress.env('referenceIds')).slice(50, 100);
|
4
8
|
|
5
9
|
migrationScript(referenceIds);
|
@@ -636,27 +636,11 @@ export const extractLrnQuestionData = {
|
|
636
636
|
cy.log(`Extracting the passage from question ${index}`);
|
637
637
|
obj.questionIndex = index;
|
638
638
|
obj.questionType = 'contentBlocks';
|
639
|
-
const passageArray = [];
|
640
639
|
lrnPage.contentBlocksQuestion()
|
641
|
-
.
|
642
|
-
.
|
643
|
-
let
|
644
|
-
|
645
|
-
});
|
646
|
-
obj.passageArray = passageArray;
|
647
|
-
lrnPage.contentBlocksQuestion()
|
648
|
-
.then(($element) => {
|
649
|
-
if ($element[0].innerHTML.includes('passage-next-btn')) {
|
650
|
-
obj.pagination = true;
|
651
|
-
cy.get('.lrn-sharedpassage-index')
|
652
|
-
.then(($element) => {
|
653
|
-
let innerText = $element[0].innerText;
|
654
|
-
let pageCount = innerText.trim().replace(/\s+/g, '');
|
655
|
-
obj.pageCount = pageCount;
|
656
|
-
});
|
657
|
-
} else {
|
658
|
-
obj.pagination = false;
|
659
|
-
}
|
640
|
+
.eq(index)
|
641
|
+
.then(($question) => {
|
642
|
+
let text = $question[0].innerText;
|
643
|
+
obj.passageText = text;
|
660
644
|
});
|
661
645
|
lrnQuestionDataArr.push(obj);
|
662
646
|
}
|
@@ -606,24 +606,9 @@ export const verifyIeQuestionData = {
|
|
606
606
|
contentBlocks: (expectedQuestionData, index) => {
|
607
607
|
cy.get('[class*="ContentBlocksPreviewstyles__ContentBlocksPreviewWrapper"]')
|
608
608
|
.eq(index)
|
609
|
-
.
|
610
|
-
|
611
|
-
|
612
|
-
.each(($element, index) => {
|
613
|
-
let innerText = $element[0].innerText;
|
614
|
-
expect(innerText).to.be.eq(expectedQuestionData.passageArray[index]);
|
615
|
-
});
|
616
|
-
if (expectedQuestionData.pagination) {
|
617
|
-
cy.get('.content-blocks-pagination')
|
618
|
-
.should('exist');
|
619
|
-
//Unable to check the passage on all pages, checked only for first page
|
620
|
-
contentBlocksPage.paginationText()
|
621
|
-
.then(($element) => {
|
622
|
-
let pageCount = $element[0].innerText;
|
623
|
-
let pageCountText = pageCount.trim().replace(/\s+/g, '');
|
624
|
-
expect(pageCountText).to.be.eq(expectedQuestionData.pageCount);
|
625
|
-
});
|
626
|
-
}
|
609
|
+
.then(($element) => {
|
610
|
+
let passageText = $element[0].innerText
|
611
|
+
expect(passageText).to.be.eq(expectedQuestionData.passageText)
|
627
612
|
});
|
628
613
|
}
|
629
614
|
|