itemengine-cypress-automation 1.0.177-contentBlocksScript-b1350d4.0 → 1.0.177-contentBlocksScript-8f6c76a.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.
@@ -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
|
|