itemengine-cypress-automation 1.0.122-updateILCRepo28Feb-2c3e0e3.0 → 1.0.123
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/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
 - package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
 - package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
 - package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +4 -2
 - package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -1
 - package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +11 -12
 - package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +1 -1
 - package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +4 -3
 - package/cypress/e2e/migration/migration.js +32 -19
 - package/cypress/e2e/migration/migration10.js +160 -0
 - package/cypress/e2e/migration/migration2.js +34 -19
 - package/cypress/e2e/migration/migration3.js +34 -19
 - package/cypress/e2e/migration/migration4.js +34 -19
 - package/cypress/e2e/migration/migration5.js +34 -19
 - package/cypress/e2e/migration/migration6.js +160 -0
 - package/cypress/e2e/migration/migration7.js +160 -0
 - package/cypress/e2e/migration/migration8.js +160 -0
 - package/cypress/e2e/migration/migration9.js +160 -0
 - package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +1 -1
 - package/cypress/pages/drawingResponsePage.js +6 -5
 - package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +1 -1
 - package/cypress/pages/textEntryMathPage.js +15 -7
 - package/cypress/pages/uploadResponsePage.js +10 -1
 - package/cypress/support/migrationHelpers/essayResponseToolbarOptionsENUM.js +30 -0
 - package/cypress/support/migrationHelpers/extractLrnQuestionData.js +24 -2
 - package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -1
 - package/cypress/support/migrationHelpers/verifyIeQuestionData.js +21 -5
 - package/deploy/migration/deploy.yaml +2 -2
 - package/package.json +2 -2
 
| 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            const essayResponseToolbarOptionsENUM = {
         
     | 
| 
      
 2 
     | 
    
         
            +
                "Bold": "Bold (Ctrl+B)",
         
     | 
| 
      
 3 
     | 
    
         
            +
                "Italic": "Italic (Ctrl+I)",
         
     | 
| 
      
 4 
     | 
    
         
            +
                "Underline": "Underline (Ctrl+U)",
         
     | 
| 
      
 5 
     | 
    
         
            +
                "Increase indent": "Increase Indent",
         
     | 
| 
      
 6 
     | 
    
         
            +
                "Decrease indent": "Decrease Indent",
         
     | 
| 
      
 7 
     | 
    
         
            +
                "Formula keypad": "Equation Editor",
         
     | 
| 
      
 8 
     | 
    
         
            +
                "Undo": "Undo (Ctrl+Z)",
         
     | 
| 
      
 9 
     | 
    
         
            +
                "Redo": "Redo (Ctrl+Y)",
         
     | 
| 
      
 10 
     | 
    
         
            +
                "Clear formatting": "Remove Format",
         
     | 
| 
      
 11 
     | 
    
         
            +
                "Code Inline": "Code Inline",
         
     | 
| 
      
 12 
     | 
    
         
            +
                "Code Editor": "Code Editor",
         
     | 
| 
      
 13 
     | 
    
         
            +
                "Align left": "Align Left",
         
     | 
| 
      
 14 
     | 
    
         
            +
                "Align center": "Align Center",
         
     | 
| 
      
 15 
     | 
    
         
            +
                "Align right": "Align Right",
         
     | 
| 
      
 16 
     | 
    
         
            +
                "Align justify": "Align Justify",
         
     | 
| 
      
 17 
     | 
    
         
            +
                "Bullet list": "Insert/Remove Bulleted List",
         
     | 
| 
      
 18 
     | 
    
         
            +
                "Numbered list": "Insert/Remove Numbered List",
         
     | 
| 
      
 19 
     | 
    
         
            +
                "Block quote": "Block Quote",
         
     | 
| 
      
 20 
     | 
    
         
            +
                "Superscript": "Superscript",
         
     | 
| 
      
 21 
     | 
    
         
            +
                "Subscript": "Subscript",
         
     | 
| 
      
 22 
     | 
    
         
            +
                "Text direction left to right": "Text direction left to right",
         
     | 
| 
      
 23 
     | 
    
         
            +
                "Text direction right to left": "Text direction right to left",
         
     | 
| 
      
 24 
     | 
    
         
            +
                "Insert horizontal rule": "Insert Horizontal Line",
         
     | 
| 
      
 25 
     | 
    
         
            +
                "Table": "Insert Table",
         
     | 
| 
      
 26 
     | 
    
         
            +
                "Special Characters": "Special characters",
         
     | 
| 
      
 27 
     | 
    
         
            +
                "Image (12 image limit)": "Insert Image"
         
     | 
| 
      
 28 
     | 
    
         
            +
            }
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            export default essayResponseToolbarOptionsENUM;
         
     | 
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            export const lrnPage = {
         
     | 
| 
      
 2 
     | 
    
         
            +
                authorItemToolbarControlsWrapper: () => cy.get('.lrn-author-item-toolbar-controls-alt'),
         
     | 
| 
       2 
3 
     | 
    
         
             
                questionTypeDiv: () => cy.get('.lrn-widget-drag-name'),
         
     | 
| 
       3 
4 
     | 
    
         
             
                questionInstructions: () => cy.get('.lrn_question'),
         
     | 
| 
       4 
5 
     | 
    
         
             
                questionWrapper: () => cy.get('.lrn-widget-drag-wrapper'),
         
     | 
| 
         @@ -11,6 +12,8 @@ export const lrnPage = { 
     | 
|
| 
       11 
12 
     | 
    
         
             
                clozeMathCorrectAnswerMathMl: () => cy.get('.lrn_correctAnswerList math'),
         
     | 
| 
       12 
13 
     | 
    
         
             
                correctAnswersResponseText: () => cy.get('.lrn_responseText'),
         
     | 
| 
       13 
14 
     | 
    
         
             
                backgroundCanvasImage: () => cy.get('.lrn_imagecloze_image'),
         
     | 
| 
      
 15 
     | 
    
         
            +
                essayResponseTextArea: () => cy.get('.lrn_texteditor_editable'),
         
     | 
| 
      
 16 
     | 
    
         
            +
                essayResponseToolbarButton: () => cy.get('[aria-label="Text controls"] button.lrn_btn'),
         
     | 
| 
       14 
17 
     | 
    
         
             
                steps: {
         
     | 
| 
       15 
18 
     | 
    
         
             
                    checkShowAnswersToggle: () => {
         
     | 
| 
       16 
19 
     | 
    
         
             
                        lrnPage.showAnswersToggle()
         
     | 
| 
         @@ -260,11 +263,17 @@ export const extractLrnQuestionData = { 
     | 
|
| 
       260 
263 
     | 
    
         
             
                    lrnGradingDataArr.push(obj);
         
     | 
| 
       261 
264 
     | 
    
         
             
                },
         
     | 
| 
       262 
265 
     | 
    
         | 
| 
       263 
     | 
    
         
            -
                 
     | 
| 
      
 266 
     | 
    
         
            +
                essayResponse: (lrnQuestionDataArr, index) => {
         
     | 
| 
      
 267 
     | 
    
         
            +
                    //instructions
         
     | 
| 
      
 268 
     | 
    
         
            +
                    //text in the input field
         
     | 
| 
      
 269 
     | 
    
         
            +
                    //placeholder
         
     | 
| 
      
 270 
     | 
    
         
            +
                    //wordlimit and stuff
         
     | 
| 
      
 271 
     | 
    
         
            +
                    //toolbar icons
         
     | 
| 
      
 272 
     | 
    
         
            +
                    //check with abhishek if we need to cover the grading view/else we can just check if the questino is not giving any error in grading view, i.e it is visible
         
     | 
| 
       264 
273 
     | 
    
         
             
                    let obj = {};
         
     | 
| 
       265 
274 
     | 
    
         
             
                    cy.log(`Extracting the question instructions and options from question ${index}`);
         
     | 
| 
       266 
275 
     | 
    
         
             
                    obj.questionIndex = index;
         
     | 
| 
       267 
     | 
    
         
            -
                    obj.questionType = ' 
     | 
| 
      
 276 
     | 
    
         
            +
                    obj.questionType = 'essayResponse'
         
     | 
| 
       268 
277 
     | 
    
         
             
                    lrnPage.questionWrapper()
         
     | 
| 
       269 
278 
     | 
    
         
             
                        .eq(index)
         
     | 
| 
       270 
279 
     | 
    
         
             
                        .within(() => {
         
     | 
| 
         @@ -273,6 +282,19 @@ export const extractLrnQuestionData = { 
     | 
|
| 
       273 
282 
     | 
    
         
             
                                    let text = $ins[0].innerText;
         
     | 
| 
       274 
283 
     | 
    
         
             
                                    obj.previewQuestionInstructions = text;
         
     | 
| 
       275 
284 
     | 
    
         
             
                                });
         
     | 
| 
      
 285 
     | 
    
         
            +
                            lrnPage.essayResponseTextArea()
         
     | 
| 
      
 286 
     | 
    
         
            +
                                .then(($element) => {
         
     | 
| 
      
 287 
     | 
    
         
            +
                                    let textAreaPlaceholder = $element[0].attributes["data-placeholder"]?.nodeValue;
         
     | 
| 
      
 288 
     | 
    
         
            +
                                    obj.textAreaPlaceholder = textAreaPlaceholder;
         
     | 
| 
      
 289 
     | 
    
         
            +
                                });
         
     | 
| 
      
 290 
     | 
    
         
            +
                            let toolbarButtons = [];
         
     | 
| 
      
 291 
     | 
    
         
            +
                            lrnPage.essayResponseToolbarButton()
         
     | 
| 
      
 292 
     | 
    
         
            +
                                .each(($button) => {
         
     | 
| 
      
 293 
     | 
    
         
            +
                                    let ariaLabel = $button[0].attributes["aria-label"].nodeValue;
         
     | 
| 
      
 294 
     | 
    
         
            +
                                    if (!ariaLabel) ariaLabel = $button[0].attributes["title"].nodeValue;
         
     | 
| 
      
 295 
     | 
    
         
            +
                                    if (ariaLabel != 'Edit table') toolbarButtons.push(ariaLabel);
         
     | 
| 
      
 296 
     | 
    
         
            +
                                })
         
     | 
| 
      
 297 
     | 
    
         
            +
                            obj.toolbarButtons = toolbarButtons;
         
     | 
| 
       276 
298 
     | 
    
         
             
                        });
         
     | 
| 
       277 
299 
     | 
    
         
             
                    lrnQuestionDataArr.push(obj);
         
     | 
| 
       278 
300 
     | 
    
         
             
                },
         
     | 
| 
         @@ -2,7 +2,7 @@ const lrnQuestionTypesENUM = { 
     | 
|
| 
       2 
2 
     | 
    
         
             
                mcq: 'mcq',
         
     | 
| 
       3 
3 
     | 
    
         
             
                textEntryMath: 'Cloze math',
         
     | 
| 
       4 
4 
     | 
    
         
             
                textEntryMathImage: 'Cloze math with image',
         
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
      
 5 
     | 
    
         
            +
                essayResponse: 'essayResponse',
         
     | 
| 
       6 
6 
     | 
    
         
             
                singleSelection: 'Multiple choice – standard',
         
     | 
| 
       7 
7 
     | 
    
         
             
                multipleSelection: 'Multiple choice – multiple response',
         
     | 
| 
       8 
8 
     | 
    
         
             
                trueOrFalse: 'True or false',
         
     | 
| 
         @@ -1,6 +1,7 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { multipleSelectionPage } from "../../pages";
         
     | 
| 
      
 1 
     | 
    
         
            +
            import { essayResponsePage, multipleSelectionPage } from "../../pages";
         
     | 
| 
       2 
2 
     | 
    
         
             
            import { singleSelectionPage } from "../../pages/singleSelectionPage"
         
     | 
| 
       3 
3 
     | 
    
         
             
            import utilities from "../helpers/utilities";
         
     | 
| 
      
 4 
     | 
    
         
            +
            import essayResponseToolbarOptionsENUM from "./essayResponseToolbarOptionsENUM";
         
     | 
| 
       4 
5 
     | 
    
         | 
| 
       5 
6 
     | 
    
         
             
            export const iePage = {
         
     | 
| 
       6 
7 
     | 
    
         
             
                mcqOption: () => cy.get('.mcq_Label'),
         
     | 
| 
         @@ -155,12 +156,27 @@ export const verifyIeQuestionData = { 
     | 
|
| 
       155 
156 
     | 
    
         
             
                        });
         
     | 
| 
       156 
157 
     | 
    
         
             
                },
         
     | 
| 
       157 
158 
     | 
    
         | 
| 
       158 
     | 
    
         
            -
                 
     | 
| 
       159 
     | 
    
         
            -
                    cy.get(' 
     | 
| 
      
 159 
     | 
    
         
            +
                essayResponse: (expectedQuestionData, index) => {
         
     | 
| 
      
 160 
     | 
    
         
            +
                    cy.get('[class*="ngie-essay-response"]')
         
     | 
| 
       160 
161 
     | 
    
         
             
                        .eq(index)
         
     | 
| 
       161 
162 
     | 
    
         
             
                        .within(() => {
         
     | 
| 
       162 
     | 
    
         
            -
                            singleSelectionPage.questionInstructionsText()
         
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
      
 163 
     | 
    
         
            +
                            utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.previewQuestionInstructions);
         
     | 
| 
      
 164 
     | 
    
         
            +
                            essayResponsePage.responseField()
         
     | 
| 
      
 165 
     | 
    
         
            +
                                .then(($element) => {
         
     | 
| 
      
 166 
     | 
    
         
            +
                                    let textAreaPlaceholder = $element[0].attributes["data-cke-editorplaceholder"]?.nodeValue;
         
     | 
| 
      
 167 
     | 
    
         
            +
                                    expect(textAreaPlaceholder).to.be.eq(expectedQuestionData.textAreaPlaceholder);
         
     | 
| 
      
 168 
     | 
    
         
            +
                                });
         
     | 
| 
      
 169 
     | 
    
         
            +
                            let ieButtonsTitle = [];
         
     | 
| 
      
 170 
     | 
    
         
            +
                            let ieButtonsExpected = expectedQuestionData.toolbarButtons.map((button) => {
         
     | 
| 
      
 171 
     | 
    
         
            +
                                return essayResponseToolbarOptionsENUM[button];
         
     | 
| 
      
 172 
     | 
    
         
            +
                            });
         
     | 
| 
      
 173 
     | 
    
         
            +
                            essayResponsePage.previewTabToolbarOption()
         
     | 
| 
      
 174 
     | 
    
         
            +
                                .each(($button) => {
         
     | 
| 
      
 175 
     | 
    
         
            +
                                    let title = $button[0].attributes["title"].nodeValue;
         
     | 
| 
      
 176 
     | 
    
         
            +
                                    ieButtonsTitle.push(title);
         
     | 
| 
      
 177 
     | 
    
         
            +
                                }).then(() => {
         
     | 
| 
      
 178 
     | 
    
         
            +
                                    expect(ieButtonsTitle).to.have.deep.members(ieButtonsExpected);
         
     | 
| 
      
 179 
     | 
    
         
            +
                                });
         
     | 
| 
       164 
180 
     | 
    
         
             
                        });
         
     | 
| 
       165 
181 
     | 
    
         
             
                },
         
     | 
| 
       166 
182 
     | 
    
         | 
    
        package/package.json
    CHANGED
    
    | 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            {
         
     | 
| 
       2 
2 
     | 
    
         
             
              "name": "itemengine-cypress-automation",
         
     | 
| 
       3 
     | 
    
         
            -
              "version": "1.0. 
     | 
| 
      
 3 
     | 
    
         
            +
              "version": "1.0.123",
         
     | 
| 
       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 
     | 
    
         
            +
            }
         
     |