itemengine-cypress-automation 1.0.339 → 1.0.340

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.
@@ -68,8 +68,9 @@ describe('Edit item - fill in the gaps with drag and drop', () => {
68
68
  fillInTheGapsDragAndDropPage.steps.editItem();
69
69
  fillInTheGapsDragAndDropPage.steps.expandScoringTypeDropdown();
70
70
  fillInTheGapsDragAndDropPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
71
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Insects': 0 });
72
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Birds': 1 });
71
+ //Failing due to https://weldnorthed.atlassian.net/browse/IEI-5502
72
+ // fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Insects': 0 });
73
+ // fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Birds': 1 });
73
74
  fillInTheGapsDragAndDropPage.steps.saveAQuestionAndVerifySnackbar();
74
75
  });
75
76
  });
@@ -150,7 +150,7 @@ describe('Create item page - Fill in the gaps: Question instructions, Options se
150
150
  fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
151
151
  cy.barsPreLoaderWait();
152
152
  fillInTheGapsDropdownPage.steps.saveAQuestionWithIncompleteAuthoring();
153
- fillInTheGapsDropdownPage.steps.editItem(1);
153
+ fillInTheGapsDropdownPage.steps.editItem();
154
154
  });
155
155
 
156
156
  it('Warning icons should be displayed on the required input fields', () => {
@@ -147,7 +147,7 @@ describe('Create item page - Fill in the gaps with text: Question instructions,
147
147
  fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
148
148
  cy.barsPreLoaderWait();
149
149
  fillInTheGapsTextPage.steps.saveAQuestionWithIncompleteAuthoring();
150
- fillInTheGapsTextPage.steps.editItem(1);
150
+ fillInTheGapsTextPage.steps.editItem();
151
151
  });
152
152
 
153
153
  it('Warning icons should be displayed on the required input fields', () => {
@@ -61,7 +61,8 @@ describe('Edit item - Image highlight', () => {
61
61
  imageHighlightPage.steps.editItem();
62
62
  imageHighlightPage.steps.expandScoringTypeDropdown();
63
63
  imageHighlightPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
64
- imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
64
+ //Failing due to https://weldnorthed.atlassian.net/browse/IEI-5502
65
+ // imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
65
66
  imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
66
67
  });
67
68
 
@@ -174,7 +174,7 @@ describe('Create item page - Multiple selection: Question instructions, Options
174
174
  multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
175
175
  multipleSelectionPage.steps.addInputToOptionsInputField(options);
176
176
  multipleSelectionPage.steps.allotPoints(10);
177
- multipleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(0);
177
+ multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
178
178
  multipleSelectionPage.steps.verifyErrorMessageIsNotDisplayed();
179
179
  multipleSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
180
180
  });
@@ -268,6 +268,85 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
268
268
  });
269
269
  });
270
270
 
271
+ views.forEach((view) => {
272
+ describe(`Text entry math: all or nothing scoring - ${view}`, { tags: 'smoke' }, () => {
273
+ abortEarlySetup();
274
+ before(() => {
275
+ switch (view) {
276
+ case 'Question preview':
277
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
278
+ cy.barsPreLoaderWait();
279
+ textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
280
+ textEntryMathPage.steps.addResponseArea();
281
+ textEntryMathPage.steps.addResponseArea();
282
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
283
+ textEntryMathPage.steps.allotPoints(20);
284
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
285
+ equationEditorFlyout.steps.clearAll();
286
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Correct1');
287
+ equationEditorFlyout.steps.clickOnOkButton();
288
+ textEntryMathPage.steps.expandAndFocusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
289
+ equationEditorFlyout.steps.enterEquationUsingPiSymbol();
290
+ textEntryMathPage.steps.expandAdditionalSettings();
291
+ textEntryMathPage.steps.selectModalVisibilityTypeButton();
292
+ textEntryMathPage.steps.switchToPreviewTab();
293
+ textEntryMathPage.steps.clickOnSaveQuestionButton();
294
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
295
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
296
+ break;
297
+ case 'Item preview':
298
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
299
+ itemPreviewPage.steps.switchToPreviewTab();
300
+ break;
301
+ case 'Grading view':
302
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
303
+ break;
304
+ }
305
+ });
306
+
307
+ beforeEach(() => {
308
+ switch (view) {
309
+ case 'Item preview':
310
+ itemPreviewPage.steps.switchToStudentView();
311
+ itemPreviewPage.steps.resetQuestionPreview();
312
+ break;
313
+ case 'Grading view':
314
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
315
+ break;
316
+ }
317
+ });
318
+
319
+ it('When student enters a text, removes it, and then reloads the page, the page should not become unresponsive', () => {
320
+ if (view === 'Grading view') {
321
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
322
+ textEntryMathPage.steps.enterTextInPreviewInputFieldNew(0, 'Temporary text');
323
+ equationEditorFlyout.steps.clickOnOkButton();
324
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
325
+ equationEditorFlyout.steps.clearAll();
326
+ equationEditorFlyout.steps.clickOnOkButton();
327
+ cy.reload();
328
+ }
329
+ });
330
+
331
+ it('When user attempts the question then the user should be able to submit the question', () => {
332
+ if (view === 'Grading view') {
333
+ textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
334
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Correct1');
335
+ equationEditorFlyout.steps.clickOnOkButton();
336
+ if (view === 'Grading view') {
337
+ studentViewPage.steps.submitResponse();
338
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
339
+ studentViewPage.steps.clickOnGoToGradingViewButton();
340
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
341
+ }
342
+ textEntryMathPage.steps.verifyCorrectResponseIcon(0);
343
+ textEntryMathPage.steps.verifyIncorrectResponseIcon(1);
344
+ textEntryMathPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
345
+ }
346
+ });
347
+ });
348
+ });
349
+
271
350
  if (!grepTags || !grepTags.includes('smoke')) {
272
351
  describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
273
352
  abortEarlySetup();
@@ -12,7 +12,7 @@ describe('Edit item - Text entry math', () => {
12
12
  before(() => {
13
13
  textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
14
14
  cy.barsPreLoaderWait();
15
- textEntryMathWithImagePage.steps.addTextInQuestionInstructionsInputField('Text entry math question instruction');
15
+ textEntryMathPage.steps.addTextInQuestionInstructionsInputField('Text entry math question instruction');
16
16
  textEntryMathPage.steps.addResponseArea();
17
17
  textEntryMathPage.steps.addResponseArea();
18
18
  textEntryMathPage.steps.allotPoints(20);
@@ -92,7 +92,7 @@ describe('Create item page - Text entry math: Question instructions, Add structu
92
92
  textEntryMathPage.steps.switchToEditTab();
93
93
  textEntryMathPage.steps.deleteAResponseArea(0);
94
94
  textEntryMathPage.steps.deleteAResponseArea(0);
95
- utilities.verifyElementVisibilityState(textEntryMathPage.errorMessage(), 'notExist');
95
+ utilities.verifyElementVisibilityState(textEntryMathPage.errorMessage(), 'exist');
96
96
  });
97
97
 
98
98
  textEntryMathPage.tests.verifyErrorMessageCSSAndA11y();
@@ -64,6 +64,7 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
64
64
  switch (view) {
65
65
  case 'Question preview':
66
66
  textEntryMathWithImagePage.steps.navigateToCreateQuestion('Text Entry Math');
67
+ cy.wait(5000);//waiting for question instructions to load
67
68
  cy.barsPreLoaderWait();
68
69
  textEntryMathWithImagePage.steps.addBackground();
69
70
  textEntryMathWithImagePage.steps.allotPoints(20);
@@ -23,6 +23,7 @@ describe('Tool settings content for all views', () => {
23
23
  case 'Question preview':
24
24
  cy.log('Navigating to multiple selection response question type');
25
25
  multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
26
+ cy.wait(5000);//waiting for question instructions to load
26
27
  cy.barsPreLoaderWait();
27
28
  multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Text');
28
29
  multipleSelectionPage.steps.addInputToOptionsInputField(options);
@@ -5,7 +5,7 @@ describe('Scores API cases', () => {
5
5
  var sessionData = [{}, {}, {}];
6
6
  var timestamp;
7
7
  var dtScoreUpdateArray = [];
8
- let itemReferenceIdNew = "a50ba14-5603-b55e-7cc-d17404ce5afb";
8
+ let itemReferenceIdNew = "cd2f017-4f0-33b3-062b-ab6150047a83";
9
9
  let dt_score_update;
10
10
  let response_id;
11
11
  let dt_saved;
@@ -130,11 +130,11 @@ const steps = {
130
130
  chartsLinePage.barAndPointTooltipLockUnlockButton()
131
131
  .should('have.attr', 'aria-label', 'unlocked bar');
132
132
  utilities.triggerMouseout(utilities.getNthElement(chartsLinePage.selectChartTypePoint(), pointIndex));
133
- cy.wait(500); // Add a small delay to ensure the tooltip is hidden
134
133
  utilities.getNthElement(chartsLinePage.selectChartTypePoint(), pointIndex)
135
134
  .within(() => {
136
135
  utilities.verifyElementVisibilityState(chartsLinePage.pointLockIcon(), 'notExist');
137
136
  });
137
+ cy.wait(500); // Add a small delay to ensure the tooltip is hidden
138
138
  utilities.hoverAwayFromElement();
139
139
  },
140
140
 
@@ -640,7 +640,7 @@ const steps = {
640
640
  },
641
641
 
642
642
  verifyCaptureImageContainerIsVisible: () => {
643
- utilities.verifyElementVisibilityState(drawingResponsePage.captureImageContainer(), 'visible');
643
+ utilities.verifyElementVisibilityState(drawingResponsePage.captureImageContainer(), 'exist');
644
644
  },
645
645
 
646
646
  verifyCaptureImageContainerNotExist: () => {
@@ -9,6 +9,7 @@ import { ckEditorLinkComponent } from "../pages/components/ckEditorLinkComponent
9
9
  import { createItemPage } from "./createItemPage";
10
10
  import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
11
11
  import { audioPlayerPage } from "./audioPlayerPage";
12
+ import { dialogBoxBase } from "./dialogBoxBase";
12
13
  const css = Cypress.env('css');
13
14
  const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
14
15
 
@@ -940,9 +941,8 @@ const tests = {
940
941
  .verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
941
942
  });
942
943
 
943
- it('If user has not selected correct answer in the correct accordion, then the Add alternative answer button should be in enabled state', () => {
944
- utilities.verifyElementNotDisabled(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton());
945
- autoScoredSpecifyCorrectAnswerSection.steps.clickOnAddAlternativeAnswerButton();
944
+ it('If user has not selected correct answer in the correct accordion, then the Add alternative answer button should be in disabled state', () => {
945
+ utilities.verifyElementDisabled(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton());
946
946
  });
947
947
 
948
948
  it('CSS of warning popup', { tags: 'css' }, () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.339",
3
+ "version": "1.0.340",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {