itemengine-cypress-automation 1.0.573-IEI-7080-f70315e.0 → 1.0.573-IEI-7065-Improve-test-coverage-for-essay-response-c25d1ee.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/ILC/EssayResponse/additionalSettings.js +8 -2
- package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +15 -0
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +14 -1
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +155 -5
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +116 -4
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +93 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +114 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +11 -1
- package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +29 -2
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +11 -1
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +75 -0
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +13 -0
- package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +71 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +181 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +37 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsForAnswerInputFields.js +72 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +19 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +56 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +57 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +15 -18
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +54 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +12 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomizationAllViews.js +156 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +0 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +9 -124
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +6 -93
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +2 -23
- package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +86 -0
- package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +60 -9
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +14 -12
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +12 -3
- package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +65 -2
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +15 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -168
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +284 -17
- package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +397 -25
- package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +320 -20
- package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +0 -130
- package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +97 -10
- package/cypress/e2e/ILC/dataApi/saveItems.js +1 -1
- package/cypress/e2e/ILC/dataApi/saveQuestions.js +7 -7
- package/cypress/e2e/ILC/dataApi/saveQuestionsMCQAlternateAnswers.js +6 -6
- package/cypress/pages/components/additionalSettingsPanel.js +9 -0
- package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
- package/cypress/pages/components/colorPopupComponent.js +1 -1
- package/cypress/pages/components/equationEditorSectionCommonComponent.js +21 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +20 -1
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +4 -10
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +14 -37
- package/cypress/pages/components/gradingViewEnumerationComponent.js +5 -0
- package/cypress/pages/components/imageCanvasComponent.js +0 -3
- package/cypress/pages/components/placeholderTextSectionComponent.js +10 -0
- package/cypress/pages/components/showAlternativeAnswersComponent.js +41 -65
- package/cypress/pages/essayResponsePage.js +2 -0
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +21 -1
- package/cypress/pages/imageHighlightPage.js +184 -7
- package/cypress/pages/itemPreviewPage.js +1 -0
- package/cypress/pages/multipleSelectionPage.js +32 -0
- package/cypress/pages/singleSelectionPage.js +17 -0
- package/cypress/support/helpers/utilities.js +16 -0
- package/package.json +1 -1
- package/scripts/sorry-cypress.mjs +47 -53
- package/service.yaml +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
|
2
2
|
import { additionalSettingsAccessibilitySectionComponent, additionalSettingsPanel, autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, backgroundImageUploadComponent, commonComponents, createQuestionBasePage, enableOuterBorderComponent, gradingViewEnumerationComponent, imageActionsComponent, imageCanvasComponent, questionInstructionsComponent, scoringSectionBaseEditTab, showAvailableOptionsToStudents, showStudentMaximumNumberOfPossibleSelections, singleMultipleSelectionModeComponent, colorPopupComponent } from "./components";
|
|
3
3
|
import { createItemPage } from "./createItemPage";
|
|
4
|
+
import { itemPreviewPage } from "./itemPreviewPage";
|
|
4
5
|
const css = Cypress.env('css');
|
|
5
6
|
let imageWidth = 768;
|
|
6
7
|
let imageHeight = 432;
|
|
@@ -18,6 +19,7 @@ const selectors = {
|
|
|
18
19
|
...imageActionsComponent,
|
|
19
20
|
...additionalSettingsPanel,
|
|
20
21
|
...gradingViewEnumerationComponent,
|
|
22
|
+
...itemPreviewPage,
|
|
21
23
|
|
|
22
24
|
//Image selection style section.
|
|
23
25
|
imageSelectionStyleLabel: () => cy.get('.options-label'),
|
|
@@ -110,6 +112,12 @@ const selectors = {
|
|
|
110
112
|
saturationPointer: () => cy.get('.react-colorful__pointer.react-colorful__saturation-pointer'),
|
|
111
113
|
huePointer: () => cy.get('.react-colorful__pointer.react-colorful__hue-pointer'),
|
|
112
114
|
alphaPointer: () => cy.get('.react-colorful__pointer.react-colorful__alpha-pointer'),
|
|
115
|
+
enumerationPlacementLabel: () => cy.get('[class*="options-container-cls dropzone-identifiers-wrapper"] .options-label').eq(1),
|
|
116
|
+
enumerationToggleButtonContainer: () => cy.get('[aria-label="Enumeration placement"]'),
|
|
117
|
+
enumerationPlacementTopToggleButton: () => cy.get('[data-ngie-testid="top-toggle-button"]'),
|
|
118
|
+
enumerationPlacementCenterToggleButton: () => cy.get('[data-ngie-testid="center-toggle-button"]').eq(1),
|
|
119
|
+
enumerationPlacementBottomToggleButton: () => cy.get('[data-ngie-testid="bottom-toggle-button"]'),
|
|
120
|
+
enumerationForHighlightsPreviewTab: () => cy.get('[class*="highlight-svg-responseive"] circle'),
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
const steps = {
|
|
@@ -312,7 +320,7 @@ const steps = {
|
|
|
312
320
|
* @description this function verifies height of canvas
|
|
313
321
|
*/
|
|
314
322
|
verifyCanvasHeight: (height) => {
|
|
315
|
-
const tolerance =
|
|
323
|
+
const tolerance = 10
|
|
316
324
|
imageHighlightPage.specifyPossibleOptionsImageCanvas()
|
|
317
325
|
.should('have.css', 'height')
|
|
318
326
|
.then(($cssHeight) => {
|
|
@@ -659,20 +667,20 @@ const steps = {
|
|
|
659
667
|
|
|
660
668
|
verifyCanvasImageTopLeftAlignedInPreviewTab: () => {
|
|
661
669
|
imageHighlightPage.imagePreviewTab()
|
|
662
|
-
.should('have.
|
|
663
|
-
.and('have.
|
|
670
|
+
.should('have.attr', 'x', '0')
|
|
671
|
+
.and('have.attr', 'y', '0');
|
|
664
672
|
},
|
|
665
673
|
|
|
666
674
|
verifyCanvasImageCenterAlignedInPreviewTab: () => {
|
|
667
675
|
imageHighlightPage.imagePreviewTab()
|
|
668
|
-
.should('
|
|
669
|
-
.and('
|
|
676
|
+
.should('have.attr', 'x', '100')
|
|
677
|
+
.and('have.attr', 'y', '100');
|
|
670
678
|
},
|
|
671
679
|
|
|
672
680
|
verifyCanvasImageTopRightAlignedInPreviewTab: () => {
|
|
673
681
|
imageHighlightPage.imagePreviewTab()
|
|
674
|
-
.should('have.
|
|
675
|
-
.and('not.have.
|
|
682
|
+
.should('have.attr', 'x', '100')
|
|
683
|
+
.and('not.have.attr', 'y', '200');
|
|
676
684
|
},
|
|
677
685
|
|
|
678
686
|
/**
|
|
@@ -1144,6 +1152,20 @@ const steps = {
|
|
|
1144
1152
|
});
|
|
1145
1153
|
},
|
|
1146
1154
|
|
|
1155
|
+
/**
|
|
1156
|
+
* @param {number} index of highlight region
|
|
1157
|
+
* @description this function verifies the outLineHighlight of selected highlight in item preview tab.
|
|
1158
|
+
*/
|
|
1159
|
+
verifyOutlineHighlightRegionItemPreviewTabSection: (index) => {
|
|
1160
|
+
imageHighlightPage.itemPreviewPageWrapper()
|
|
1161
|
+
.within(() => {
|
|
1162
|
+
utilities.verifyCSS(imageHighlightPage.specifyCorrectAnswerSectionHighlightPolygon().eq(index), {
|
|
1163
|
+
'stroke-width': '2px',
|
|
1164
|
+
'stroke': css.color.activeHighlightBorder
|
|
1165
|
+
});
|
|
1166
|
+
});
|
|
1167
|
+
},
|
|
1168
|
+
|
|
1147
1169
|
/**
|
|
1148
1170
|
* @param {number} index of highlight region
|
|
1149
1171
|
* @description this function verifies the patternHighlight of selected highlight in preview tab.
|
|
@@ -1705,6 +1727,161 @@ const steps = {
|
|
|
1705
1727
|
Math.abs(ag - eg) <= tolerance &&
|
|
1706
1728
|
Math.abs(ab - eb) <= tolerance
|
|
1707
1729
|
);
|
|
1730
|
+
},
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* @param {number} width index for the border style.
|
|
1734
|
+
* @param {number} height index for the border style.
|
|
1735
|
+
* @description Verifies the height and width of image in preview tab.
|
|
1736
|
+
*/
|
|
1737
|
+
verifyImageDimensionsPreviewTab: (width, height) => {
|
|
1738
|
+
imageHighlightPage.imagePreviewTab()
|
|
1739
|
+
.should('have.css', 'width', `${width}px`)
|
|
1740
|
+
.and('have.css', 'height', `${height}px`);
|
|
1741
|
+
},
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* @description Clicks on the bottom enumeration placement button.
|
|
1745
|
+
*/
|
|
1746
|
+
selectBottomEnumerationPlacementToggle: () => {
|
|
1747
|
+
imageHighlightPage.enumerationPlacementBottomToggleButton()
|
|
1748
|
+
.click();
|
|
1749
|
+
},
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* @description Clicks on the center enumeration placement button.
|
|
1753
|
+
*/
|
|
1754
|
+
selectCenterEnumerationPlacementToggle: () => {
|
|
1755
|
+
imageHighlightPage.enumerationPlacementCenterToggleButton()
|
|
1756
|
+
.click();
|
|
1757
|
+
},
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* @param {string} enumerationPlacement placement of the enumeration.
|
|
1761
|
+
* @param {number} index index of highlight region
|
|
1762
|
+
* @description Verifies the enumeration placement for highlight regions in the preview tab.
|
|
1763
|
+
*/
|
|
1764
|
+
verifyNumerationPlacementForHighlightRegionInPreviewTab: (enumerationPlacement, index) => {
|
|
1765
|
+
const tolerance = 1
|
|
1766
|
+
switch (enumerationPlacement) {
|
|
1767
|
+
case 'Top':
|
|
1768
|
+
switch (index) {
|
|
1769
|
+
case 0:
|
|
1770
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1771
|
+
.invoke('attr', 'cx')
|
|
1772
|
+
.then(actualCx => {
|
|
1773
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1774
|
+
expect(roundedCx).to.equal('307.80');
|
|
1775
|
+
});
|
|
1776
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1777
|
+
.invoke('attr', 'cy')
|
|
1778
|
+
.then(actualCx => {
|
|
1779
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1780
|
+
expect(roundedCx).to.equal('59.03');
|
|
1781
|
+
});
|
|
1782
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1783
|
+
.should('have.attr', 'r', '12');
|
|
1784
|
+
break;
|
|
1785
|
+
case 1:
|
|
1786
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1787
|
+
.invoke('attr', 'cx')
|
|
1788
|
+
.then(actualCx => {
|
|
1789
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1790
|
+
expect(roundedCx).to.equal('200.52');
|
|
1791
|
+
});
|
|
1792
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1793
|
+
.invoke('attr', 'cy')
|
|
1794
|
+
.then(actualCx => {
|
|
1795
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1796
|
+
expect(roundedCx).to.equal('213.11');
|
|
1797
|
+
});
|
|
1798
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1799
|
+
.should('have.attr', 'r', '12');
|
|
1800
|
+
break;
|
|
1801
|
+
default:
|
|
1802
|
+
throw new Error(`Unsupported index ${index} for placement 'Top'`);
|
|
1803
|
+
}
|
|
1804
|
+
break;
|
|
1805
|
+
case 'Center':
|
|
1806
|
+
switch (index) {
|
|
1807
|
+
case 0:
|
|
1808
|
+
// Match cx only up to 2 decimal places to allow minor rendering variance.
|
|
1809
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1810
|
+
.invoke('attr', 'cx')
|
|
1811
|
+
.then(actualCx => {
|
|
1812
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1813
|
+
expect(roundedCx).to.equal('365.45');
|
|
1814
|
+
});
|
|
1815
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1816
|
+
.invoke('attr', 'cy')
|
|
1817
|
+
.then(actualCy => {
|
|
1818
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1819
|
+
expect(roundedCy).to.equal('100.06');
|
|
1820
|
+
});
|
|
1821
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1822
|
+
.should('have.attr', 'r', '12');
|
|
1823
|
+
break;
|
|
1824
|
+
case 1:
|
|
1825
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1826
|
+
.invoke('attr', 'cx')
|
|
1827
|
+
.then(actualCx => {
|
|
1828
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1829
|
+
expect(roundedCx).to.equal('284.74');
|
|
1830
|
+
});
|
|
1831
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1832
|
+
.invoke('attr', 'cy')
|
|
1833
|
+
.then(actualCy => {
|
|
1834
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1835
|
+
expect(roundedCy).to.equal('238.14');
|
|
1836
|
+
});
|
|
1837
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1838
|
+
.should('have.attr', 'r', '12');
|
|
1839
|
+
break;
|
|
1840
|
+
default:
|
|
1841
|
+
throw new Error(`Unsupported index ${index} for placement 'Center'`);
|
|
1842
|
+
}
|
|
1843
|
+
break;
|
|
1844
|
+
case 'Bottom':
|
|
1845
|
+
switch (index) {
|
|
1846
|
+
case 0:
|
|
1847
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1848
|
+
.invoke('attr', 'cx')
|
|
1849
|
+
.then(actualCx => {
|
|
1850
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1851
|
+
expect(roundedCx).to.equal('307.80');
|
|
1852
|
+
});
|
|
1853
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1854
|
+
.invoke('attr', 'cy')
|
|
1855
|
+
.then(actualCy => {
|
|
1856
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1857
|
+
expect(roundedCy).to.equal('167.09');
|
|
1858
|
+
});
|
|
1859
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1860
|
+
.should('have.attr', 'r', '12');
|
|
1861
|
+
break;
|
|
1862
|
+
case 1:
|
|
1863
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1864
|
+
.invoke('attr', 'cx')
|
|
1865
|
+
.then(actualCx => {
|
|
1866
|
+
const roundedCx = Number(actualCx).toFixed(2); // keep two decimals
|
|
1867
|
+
expect(roundedCx).to.equal('200.52');
|
|
1868
|
+
});
|
|
1869
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1870
|
+
.invoke('attr', 'cy')
|
|
1871
|
+
.then(actualCy => {
|
|
1872
|
+
const roundedCy = Number(actualCy).toFixed(2); // keep two decimals
|
|
1873
|
+
expect(roundedCy).to.equal('289.16');
|
|
1874
|
+
});
|
|
1875
|
+
imageHighlightPage.enumerationForHighlightsPreviewTab().eq(index)
|
|
1876
|
+
.should('have.attr', 'r', '12');
|
|
1877
|
+
break;
|
|
1878
|
+
default:
|
|
1879
|
+
throw new Error(`Unsupported index ${index} for placement 'Bottom'`);
|
|
1880
|
+
}
|
|
1881
|
+
break;
|
|
1882
|
+
default:
|
|
1883
|
+
throw new Error(`Invalid enumeration placement '${enumerationPlacement}'`);
|
|
1884
|
+
}
|
|
1708
1885
|
}
|
|
1709
1886
|
}
|
|
1710
1887
|
|
|
@@ -2,6 +2,7 @@ import { createQuestionBasePage, autoScoredScoringPreviewTab } from "./component
|
|
|
2
2
|
|
|
3
3
|
const selectors = {
|
|
4
4
|
referenceID: () => cy.get('.edit-item-reference-id'),
|
|
5
|
+
itemPreviewPageWrapper: () => cy.get('.item-layout-columns-wrapper-without-scroll'),
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
const steps = {
|
|
@@ -79,6 +79,8 @@ const selectors = {
|
|
|
79
79
|
correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="CorrectAnswerLabel"]'),
|
|
80
80
|
correctAnswerSectionWrapper: () => cy.get('[class*="question-preview-wrapper"] .mcq-checkbox-control.mcq-answer-checked').eq(1),
|
|
81
81
|
optionWrapperCorrectAnswerSection: () => cy.get('.mcq-option-wrapper'),
|
|
82
|
+
alternativeAnswerSectionWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(1).next(),
|
|
83
|
+
optionWrapperAlternativeAnswerSection: () => cy.get('.mcq-option-wrapper'),
|
|
82
84
|
answerStatusBanner: () => cy.get('[class*="StatusContainer"]'),
|
|
83
85
|
cancelButton: () => cy.get('.save-action-btn-wrapper .MuiButtonBase-root').eq(1),
|
|
84
86
|
optionsInputFieldInQuestionPreviewTab: () => cy.get('.mcq-option-wrapper [data-testid="question-instruction-element"]'),
|
|
@@ -861,6 +863,36 @@ const steps = {
|
|
|
861
863
|
.should('exist');
|
|
862
864
|
},
|
|
863
865
|
|
|
866
|
+
/**
|
|
867
|
+
* Verifies correct option icon in alternative answer section
|
|
868
|
+
* @param {number} optionIndex - The index of the option to verify
|
|
869
|
+
*/
|
|
870
|
+
verifyCorrectOptionIconAlternativeAnswerSection: (optionIndex) => {
|
|
871
|
+
multipleSelectionPage.alternativeAnswerSectionWrapper()
|
|
872
|
+
.within(() => {
|
|
873
|
+
multipleSelectionPage.optionWrapperAlternativeAnswerSection()
|
|
874
|
+
.eq(optionIndex)
|
|
875
|
+
.within(() => {
|
|
876
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
|
877
|
+
});
|
|
878
|
+
});
|
|
879
|
+
},
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Verifies that correct/incorrect icon is not visible in alternative answer section
|
|
883
|
+
* @param {number} optionIndex - The index of the option to verify
|
|
884
|
+
*/
|
|
885
|
+
verifyCorrectIncorrectIconNotVisibleAlternativeAnswerSection: (optionIndex) => {
|
|
886
|
+
multipleSelectionPage.alternativeAnswerSectionWrapper()
|
|
887
|
+
.within(() => {
|
|
888
|
+
multipleSelectionPage.optionWrapperAlternativeAnswerSection()
|
|
889
|
+
.eq(optionIndex)
|
|
890
|
+
.within(() => {
|
|
891
|
+
autoScoredScoringPreviewTab.steps.verifyCorrectIncorrectIconsNotExist();
|
|
892
|
+
});
|
|
893
|
+
});
|
|
894
|
+
},
|
|
895
|
+
|
|
864
896
|
verifyAnswerBannerNotExist: () => {
|
|
865
897
|
multipleSelectionPage.answerStatusBanner()
|
|
866
898
|
.should('not.exist');
|
|
@@ -43,6 +43,8 @@ const selectors = {
|
|
|
43
43
|
correctIncorrectAnswerLabel: () => cy.get('[class*="style"][class*="__Status"]'),
|
|
44
44
|
answerStatusBanner: () => cy.get('[class*="StatusContainer"]'),
|
|
45
45
|
optionsInputFieldInQuestionPreviewTab: () => cy.get('.mcq-radio-control [data-testid="question-instruction-element"]'),
|
|
46
|
+
//alternate answer section
|
|
47
|
+
alternativeAnswerSectionWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(1).next(),
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
const steps = {
|
|
@@ -226,6 +228,21 @@ const steps = {
|
|
|
226
228
|
});
|
|
227
229
|
},
|
|
228
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Verifies the presence of the correct option icon in the alternate answer section
|
|
233
|
+
* @param {number} optionIndex - The index of the option to verify in the alternate answer section
|
|
234
|
+
*/
|
|
235
|
+
verifyAlternateAnswerOptionIconCorrectAnswerSection: (optionIndex) => {
|
|
236
|
+
singleSelectionPage.alternativeAnswerSectionWrapper()
|
|
237
|
+
.within(() => {
|
|
238
|
+
singleSelectionPage.optionWrapperCorrectAnswerSection()
|
|
239
|
+
.eq(optionIndex)
|
|
240
|
+
.within(() => {
|
|
241
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
},
|
|
245
|
+
|
|
229
246
|
/**
|
|
230
247
|
* Verifies that the correct and incorrect icons are not visible in the correct answer section
|
|
231
248
|
* @param {number} optionIndex - The index of the option to verify in the correct answer section
|
|
@@ -295,6 +295,22 @@ const utilities = {
|
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
297
|
},
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Verifies the selected/not selected state of an element.
|
|
301
|
+
* @param {Cypress.Chainable} selector - The element containing the image
|
|
302
|
+
* @param {string} state - 'selected' | 'notSelected'
|
|
303
|
+
*/
|
|
304
|
+
verifiedElementSelectedNotSelectedState: (selector, state) => {
|
|
305
|
+
switch (state) {
|
|
306
|
+
case 'selected':
|
|
307
|
+
selector.should('have.attr', 'aria-pressed', 'true');
|
|
308
|
+
break;
|
|
309
|
+
case 'notSelected':
|
|
310
|
+
selector.should('have.attr', 'aria-pressed', 'false');
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
},
|
|
298
314
|
}
|
|
299
315
|
|
|
300
316
|
export default utilities
|
package/package.json
CHANGED
|
@@ -173,21 +173,20 @@ export async function runSorryCypressSpinnaker() {
|
|
|
173
173
|
console.log(`command: ${command}`);
|
|
174
174
|
try {
|
|
175
175
|
execSync(command, { stdio: "inherit" });
|
|
176
|
-
if (isOtkv2) {
|
|
177
|
-
const status = await checkRunStatus(ciBuildId);
|
|
178
|
-
process.exit(status);
|
|
179
|
-
}
|
|
180
176
|
} catch (error) {
|
|
181
|
-
console.error("
|
|
177
|
+
console.error("cy2 exited non-zero; polling Sorry-Cypress before exit…");
|
|
182
178
|
console.error("Cypress run error details:", {
|
|
183
179
|
status: error.status,
|
|
184
180
|
message: error.message,
|
|
185
181
|
stack: error.stack
|
|
186
182
|
});
|
|
187
|
-
|
|
188
|
-
console.log("Exiting process with code: 1");
|
|
189
|
-
process.exit(1);
|
|
190
183
|
}
|
|
184
|
+
|
|
185
|
+
if (isOtkv2) {
|
|
186
|
+
const finalStatus = await checkRunStatus(ciBuildId);
|
|
187
|
+
process.exit(finalStatus);
|
|
188
|
+
}
|
|
189
|
+
|
|
191
190
|
console.log("Cypress tests all passed successfully. Exiting process with code: 0");
|
|
192
191
|
process.exit(0);
|
|
193
192
|
}
|
|
@@ -219,21 +218,20 @@ export async function runSorryCypressSpinnakerSmoke() {
|
|
|
219
218
|
const isOtkv2 = process.env.OTK_VERSION === '2';
|
|
220
219
|
try {
|
|
221
220
|
execSync(command, { stdio: "inherit" });
|
|
222
|
-
if (isOtkv2) {
|
|
223
|
-
const status = await checkRunStatus(ciBuildId);
|
|
224
|
-
process.exit(status);
|
|
225
|
-
}
|
|
226
221
|
} catch (error) {
|
|
227
|
-
console.error("
|
|
222
|
+
console.error("cy2 exited non-zero; polling Sorry-Cypress before exit…");
|
|
228
223
|
console.error("Cypress run error details:", {
|
|
229
224
|
status: error.status,
|
|
230
225
|
message: error.message,
|
|
231
226
|
stack: error.stack
|
|
232
227
|
});
|
|
233
|
-
|
|
234
|
-
console.log("Exiting process with code: 1");
|
|
235
|
-
process.exit(1);
|
|
236
228
|
}
|
|
229
|
+
|
|
230
|
+
if (isOtkv2) {
|
|
231
|
+
const finalStatus = await checkRunStatus(ciBuildId);
|
|
232
|
+
process.exit(finalStatus);
|
|
233
|
+
}
|
|
234
|
+
|
|
237
235
|
console.log("Cypress tests all passed successfully. Exiting process with code: 0");
|
|
238
236
|
process.exit(0);
|
|
239
237
|
}
|
|
@@ -257,21 +255,20 @@ export async function runSorryCypressSpinnakerMigration() {
|
|
|
257
255
|
const isOtkv2 = process.env.OTK_VERSION === '2';
|
|
258
256
|
try {
|
|
259
257
|
execSync(command, { stdio: "inherit" });
|
|
260
|
-
if (isOtkv2) {
|
|
261
|
-
const status = await checkRunStatus(ciBuildId);
|
|
262
|
-
process.exit(status);
|
|
263
|
-
}
|
|
264
258
|
} catch (error) {
|
|
265
|
-
console.error("
|
|
259
|
+
console.error("cy2 exited non-zero; polling Sorry-Cypress before exit…");
|
|
266
260
|
console.error("Cypress run error details:", {
|
|
267
261
|
status: error.status,
|
|
268
262
|
message: error.message,
|
|
269
263
|
stack: error.stack
|
|
270
264
|
});
|
|
271
|
-
|
|
272
|
-
console.log("Exiting process with code: 1");
|
|
273
|
-
process.exit(1);
|
|
274
265
|
}
|
|
266
|
+
|
|
267
|
+
if (isOtkv2) {
|
|
268
|
+
const finalStatus = await checkRunStatus(ciBuildId);
|
|
269
|
+
process.exit(finalStatus);
|
|
270
|
+
}
|
|
271
|
+
|
|
275
272
|
console.log("Cypress tests all passed successfully. Exiting process with code: 0");
|
|
276
273
|
process.exit(0);
|
|
277
274
|
}
|
|
@@ -287,16 +284,16 @@ export async function runSorryCypressSpinnakerSmokeCopy() {
|
|
|
287
284
|
|
|
288
285
|
// Define specific folders to run smoke tests from (subset of tests - approximately 60%)
|
|
289
286
|
const testFolders = [
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
287
|
+
"cypress/e2e/ILC/SingleSelection/**/*.smoke.js",
|
|
288
|
+
"cypress/e2e/ILC/MultipleSelection/**/*.smoke.js",
|
|
289
|
+
"cypress/e2e/ILC/ShortTextResponseNew/**/*.smoke.js",
|
|
290
|
+
"cypress/e2e/ILC/ThinkSphere/**/*.smoke.js",
|
|
294
291
|
|
|
295
292
|
"cypress/e2e/ILC/FillInTheGapsTextNew/**/*.smoke.js",
|
|
296
293
|
"cypress/e2e/ILC/FillInTheGapsDropdownNew/**/*.smoke.js",
|
|
297
294
|
"cypress/e2e/ILC/FillInTheGapsDragAndDropNew/**/*.smoke.js",
|
|
298
295
|
"cypress/e2e/ILC/Matching/**/*.smoke.js",
|
|
299
|
-
|
|
296
|
+
"cypress/e2e/ILC/ShortTextResponseNew/**/*.smoke.js"
|
|
300
297
|
].join(",");
|
|
301
298
|
|
|
302
299
|
let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs} --spec "${testFolders}"`;
|
|
@@ -305,21 +302,20 @@ export async function runSorryCypressSpinnakerSmokeCopy() {
|
|
|
305
302
|
const isOtkv2 = process.env.OTK_VERSION === '2';
|
|
306
303
|
try {
|
|
307
304
|
execSync(command, { stdio: "inherit" });
|
|
308
|
-
if (isOtkv2) {
|
|
309
|
-
const status = await checkRunStatus(ciBuildId);
|
|
310
|
-
process.exit(status);
|
|
311
|
-
}
|
|
312
305
|
} catch (error) {
|
|
313
|
-
console.error("
|
|
306
|
+
console.error("cy2 exited non-zero; polling Sorry-Cypress before exit…");
|
|
314
307
|
console.error("Cypress run error details:", {
|
|
315
308
|
status: error.status,
|
|
316
309
|
message: error.message,
|
|
317
310
|
stack: error.stack
|
|
318
311
|
});
|
|
319
|
-
|
|
320
|
-
console.log("Exiting process with code: 1");
|
|
321
|
-
process.exit(1);
|
|
322
312
|
}
|
|
313
|
+
|
|
314
|
+
if (isOtkv2) {
|
|
315
|
+
const finalStatus = await checkRunStatus(ciBuildId);
|
|
316
|
+
process.exit(finalStatus);
|
|
317
|
+
}
|
|
318
|
+
|
|
323
319
|
console.log("Cypress tests all passed successfully. Exiting process with code: 0");
|
|
324
320
|
process.exit(0);
|
|
325
321
|
}
|
|
@@ -372,21 +368,20 @@ export async function runSorryCypressQuestions() {
|
|
|
372
368
|
console.log(`Running Command: ${command}`);
|
|
373
369
|
try {
|
|
374
370
|
execSync(command, {stdio: "inherit"});
|
|
375
|
-
if (isOtkv2) {
|
|
376
|
-
const status = await checkRunStatus(ciBuildId);
|
|
377
|
-
process.exit(status);
|
|
378
|
-
}
|
|
379
371
|
} catch (error) {
|
|
380
|
-
console.error("
|
|
372
|
+
console.error("cy2 exited non-zero; polling Sorry-Cypress before exit…");
|
|
381
373
|
console.error("Cypress run error details:", {
|
|
382
374
|
status: error.status,
|
|
383
375
|
message: error.message,
|
|
384
376
|
stack: error.stack
|
|
385
377
|
});
|
|
386
|
-
|
|
387
|
-
console.log("Exiting process with code: 1");
|
|
388
|
-
process.exit(1);
|
|
389
378
|
}
|
|
379
|
+
|
|
380
|
+
if (isOtkv2) {
|
|
381
|
+
const finalStatus = await checkRunStatus(ciBuildId);
|
|
382
|
+
process.exit(finalStatus);
|
|
383
|
+
}
|
|
384
|
+
|
|
390
385
|
console.log("Cypress tests all passed successfully. Exiting process with code: 0");
|
|
391
386
|
process.exit(0);
|
|
392
387
|
}
|
|
@@ -404,21 +399,20 @@ export async function runSorryCypressSpinnakerDataApi() {
|
|
|
404
399
|
const isOtkv2 = process.env.OTK_VERSION === '2';
|
|
405
400
|
try {
|
|
406
401
|
execSync(command, { stdio: "inherit" });
|
|
407
|
-
if (isOtkv2) {
|
|
408
|
-
const status = await checkRunStatus(ciBuildId);
|
|
409
|
-
process.exit(status);
|
|
410
|
-
}
|
|
411
402
|
} catch (error) {
|
|
412
|
-
console.error("
|
|
403
|
+
console.error("cy2 exited non-zero; polling Sorry-Cypress before exit…");
|
|
413
404
|
console.error("Cypress run error details:", {
|
|
414
405
|
status: error.status,
|
|
415
406
|
message: error.message,
|
|
416
407
|
stack: error.stack
|
|
417
408
|
});
|
|
418
|
-
|
|
419
|
-
console.log("Exiting process with code: 1");
|
|
420
|
-
process.exit(1);
|
|
421
409
|
}
|
|
410
|
+
|
|
411
|
+
if (isOtkv2) {
|
|
412
|
+
const finalStatus = await checkRunStatus(ciBuildId);
|
|
413
|
+
process.exit(finalStatus);
|
|
414
|
+
}
|
|
415
|
+
|
|
422
416
|
console.log("Cypress tests all passed successfully. Exiting process with code: 0");
|
|
423
417
|
process.exit(0);
|
|
424
418
|
}
|