itemengine-cypress-automation 1.0.295-applitools-05cc9de.0 → 1.0.295-applitools-5d97c84.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.
@@ -1,4 +1,5 @@
|
|
1
1
|
import { dragAndDropIntoCategoriesPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
|
+
import { equationEditorFlyout } from "../../../pages/components";
|
2
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
4
|
import utilities from "../../../support/helpers/utilities";
|
4
5
|
const css = Cypress.env('css');
|
@@ -204,4 +205,71 @@ describe('Create item page - Drag and drop into categories: Preview contents', (
|
|
204
205
|
});
|
205
206
|
});
|
206
207
|
});
|
207
|
-
|
208
|
+
|
209
|
+
//https://weldnorthed.atlassian.net/browse/IEI-4579
|
210
|
+
views.forEach((view) => {
|
211
|
+
describe('Equations in table layout', () => {
|
212
|
+
before(() => {
|
213
|
+
switch (view) {
|
214
|
+
case 'Question preview':
|
215
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
216
|
+
cy.barsPreLoaderWait();
|
217
|
+
dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options in correct categories');
|
218
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInOptionInputField(0, 'Bat');
|
219
|
+
dragAndDropIntoCategoriesPage.steps.enterTextInOptionInputField(1, 'Eagle');
|
220
|
+
dragAndDropIntoCategoriesPage.steps.modifyTableCellProperty(3, 'Text');
|
221
|
+
dragAndDropIntoCategoriesPage.steps.modifyTableCellProperty(6, 'Text');
|
222
|
+
dragAndDropIntoCategoriesPage.steps.modifyTableCellProperty(9, 'Text');
|
223
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Bat': 0, 'Eagle': 1 });
|
224
|
+
dragAndDropIntoCategoriesPage.steps.focusWithinCellText(3);
|
225
|
+
dragAndDropIntoCategoriesPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
226
|
+
dragAndDropIntoCategoriesPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
227
|
+
dragAndDropIntoCategoriesPage.steps.focusWithinCellText(6);
|
228
|
+
dragAndDropIntoCategoriesPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
229
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('This is a equation');
|
230
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
231
|
+
dragAndDropIntoCategoriesPage.steps.focusWithinCellText(9);
|
232
|
+
dragAndDropIntoCategoriesPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
233
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('This is a very long text to test the equation editor');
|
234
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
235
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
236
|
+
break;
|
237
|
+
case 'Item view':
|
238
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
239
|
+
break;
|
240
|
+
case 'Item preview':
|
241
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
242
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
243
|
+
break;
|
244
|
+
case 'Student view':
|
245
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
246
|
+
break;
|
247
|
+
case 'Grading view':
|
248
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
249
|
+
break;
|
250
|
+
case 'Correct answer view':
|
251
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
252
|
+
break;
|
253
|
+
default:
|
254
|
+
throw new Error('Invalid view');
|
255
|
+
}
|
256
|
+
});
|
257
|
+
|
258
|
+
after(() => {
|
259
|
+
if (view === 'Question preview') {
|
260
|
+
dragAndDropIntoCategoriesPage.steps.clickOnSaveQuestionButton();
|
261
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
262
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
263
|
+
}
|
264
|
+
if (view === 'Student view') {
|
265
|
+
studentViewPage.steps.submitResponse();
|
266
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
267
|
+
}
|
268
|
+
});
|
269
|
+
|
270
|
+
it(`DND into categories ${view}: The equations should be correctly displayed in all views`, () => {
|
271
|
+
cy.eyesCheckWindow(`Equations in table layout: ${view}`);
|
272
|
+
});
|
273
|
+
});
|
274
|
+
});
|
275
|
+
});
|
@@ -409,6 +409,19 @@ const steps = {
|
|
409
409
|
});
|
410
410
|
},
|
411
411
|
|
412
|
+
/**
|
413
|
+
* focus in the drag-and-drop into categories table.
|
414
|
+
* @param {number} cellIndex - The index of the cell to edit.
|
415
|
+
*/
|
416
|
+
focusWithinCellText: (cellIndex) => {
|
417
|
+
dragAndDropIntoCategoriesPage.tableCellContainer()
|
418
|
+
.eq(cellIndex)
|
419
|
+
.within(() => {
|
420
|
+
dragAndDropIntoCategoriesPage.cellTextTextArea()
|
421
|
+
.focus();
|
422
|
+
});
|
423
|
+
},
|
424
|
+
|
412
425
|
/**
|
413
426
|
* Verifies the empty state of a dropzone cell in the Specify Correct Answer section.
|
414
427
|
* @param {number} cellIndex - The index of the dropzone cell to verify.
|