itemengine-cypress-automation 1.0.340 → 1.0.341

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.
Files changed (41) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +84 -0
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/checkAddAlternativeButton.js +33 -0
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -4
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +2 -4
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +33 -0
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +37 -6
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +96 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/checkAddAlternative.js +37 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +4 -6
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabBasicSection.js +47 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +37 -9
  12. package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +12 -0
  13. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +10 -0
  14. package/cypress/e2e/ILC/TextSelection/ScoringParagraph/allOrNothingAlternatePointsMoreThanCorrectPoints.js +80 -0
  15. package/cypress/e2e/ILC/TextSelection/ScoringParagraph/allOrNothingCorrectPointsMoreThanAlternatePoints.js +30 -0
  16. package/cypress/e2e/ILC/TextSelection/ScoringParagraph/checkScoringLabelBannerAndCorrectAnswerSection.js +110 -0
  17. package/cypress/e2e/ILC/TextSelection/checkAddAlternativeButton.js +46 -0
  18. package/cypress/e2e/ILC/TextSelection/editTabBasicSection.js +57 -0
  19. package/cypress/e2e/ILC/TextSelection/headerSection.js +38 -6
  20. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +1 -2
  21. package/cypress/fixtures/constants.js +5 -1
  22. package/cypress/fixtures/theme/ilc.json +2 -0
  23. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +5 -27
  24. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +0 -67
  25. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +0 -66
  26. package/cypress/pages/components/hideExpressionListComponent.js +53 -0
  27. package/cypress/pages/components/index.js +1 -0
  28. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  29. package/cypress/pages/desmos3DGraphingPage.js +368 -0
  30. package/cypress/pages/desmosGeometryPage.js +308 -0
  31. package/cypress/pages/dragAndDropIntoCategoriesPage.js +26 -6
  32. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -68
  33. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  34. package/cypress/pages/imageHighlightPage.js +0 -66
  35. package/cypress/pages/index.js +3 -2
  36. package/cypress/pages/multipleSelectionGridPage.js +1 -68
  37. package/cypress/pages/multipleSelectionPage.js +0 -67
  38. package/cypress/pages/singleSelectionGridPage.js +1 -68
  39. package/cypress/pages/singleSelectionPage.js +0 -67
  40. package/cypress/pages/textSelectionPage.js +25 -6
  41. package/package.json +1 -1
@@ -231,4 +231,84 @@ describe('Create Item page - Text selection: Preview tab Scoring Section - All o
231
231
  textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();*/
232
232
  });
233
233
  });
234
+
235
+
236
+ describe('Question Preview: AutoScored - All or Nothing with blank scoring: When alternative answer points are more than correct answer points and alternative has no text highlighted', () => {
237
+ abortEarlySetup();
238
+ before(() => {
239
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
240
+ cy.barsPreLoaderWait();
241
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
242
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
243
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
244
+ textSelectionPage.steps.allotPoints(12);
245
+ textSelectionPage.steps.addAlternativeAnswerAccordion(1);
246
+ textSelectionPage.steps.allotPoints(20);
247
+ textSelectionPage.steps.switchToPreviewTab();
248
+ });
249
+
250
+ it('When user attempts the question with responses from the correct accordion, then the user should be awarded points specified for correct points accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
251
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
252
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
253
+ textSelectionPage.steps.verifyPreviewScore(12, 20);
254
+ textSelectionPage.steps.switchToGradingView();
255
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[0]);
256
+ textSelectionPage.steps.verifyCorrectIconForOption(paragraphTextArray[1]);
257
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
258
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
259
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
260
+ });
261
+
262
+ it('When user selects and deselects an option then full score should be awarded as alternative accordion has blank response', () => {
263
+ textSelectionPage.steps.resetQuestionPreview();
264
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
265
+ textSelectionPage.steps.deselectOptionInPreviewTab(paragraphTextArray[0]);
266
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
267
+ textSelectionPage.steps.switchToGradingView();
268
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
269
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
270
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
271
+ });
272
+ });
273
+
274
+ describe('Question Preview: AutoScored - All or Nothing with blank scoring: When alternative answer points are more than correct answer points and correct answer has no text highlighted', () => {
275
+ abortEarlySetup();
276
+ before(() => {
277
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
278
+ cy.barsPreLoaderWait();
279
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
280
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
281
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
282
+ textSelectionPage.steps.allotPoints(12);
283
+ textSelectionPage.steps.addAlternativeAnswerAccordion(1);
284
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
285
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
286
+ textSelectionPage.steps.allotPoints(20);
287
+ textSelectionPage.steps.expandCorrectAnswerAccordion();
288
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
289
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
290
+ textSelectionPage.steps.switchToPreviewTab();
291
+ });
292
+
293
+ it('When user attempts the question with responses from the correct accordion i.e select and deselects an option, then the user should be awarded points specified for correct points accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
294
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
295
+ textSelectionPage.steps.deselectOptionInPreviewTab(paragraphTextArray[0]);
296
+ textSelectionPage.steps.verifyPreviewScore(12, 20);
297
+ textSelectionPage.steps.switchToGradingView();
298
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
299
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
300
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
301
+ });
302
+
303
+ it('When user attempts the question with responses from the alternative accordion then full score should be awarded', () => {
304
+ textSelectionPage.steps.resetQuestionPreview();
305
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[1]);
306
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[2]);
307
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
308
+ textSelectionPage.steps.switchToGradingView();
309
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
310
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
311
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
312
+ });
313
+ });
234
314
  });
@@ -231,4 +231,34 @@ describe('Create Item page - Text selection: Preview tab Scoring Section - All o
231
231
  textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();*/
232
232
  });
233
233
  });
234
+
235
+ describe('Question Preview: AutoScored - All or Nothing with blank scoring: When correct answer points are more than alternate answer points and correct answer has no text highlighted', () => {
236
+ abortEarlySetup();
237
+ before(() => {
238
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
239
+ cy.barsPreLoaderWait();
240
+ textSelectionPage.steps.setQuestionAndOptionsInEditTab();
241
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
242
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
243
+ textSelectionPage.steps.allotPoints(20);
244
+ textSelectionPage.steps.addAlternativeAnswerAccordion(1);
245
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
246
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
247
+ textSelectionPage.steps.allotPoints(12);
248
+ textSelectionPage.steps.expandCorrectAnswerAccordion();
249
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
250
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
251
+ textSelectionPage.steps.switchToPreviewTab();
252
+ });
253
+
254
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
255
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
256
+ textSelectionPage.steps.deselectOptionInPreviewTab(paragraphTextArray[0]);
257
+ textSelectionPage.steps.verifyPreviewScore(20, 20);
258
+ textSelectionPage.steps.switchToGradingView();
259
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExists();
260
+ textSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
261
+ textSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
262
+ });
263
+ });
234
264
  });
@@ -0,0 +1,110 @@
1
+ import { textSelectionPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ const paragraphTextArray = [
5
+ 'All animals have a unique role to play in maintaining the balance of nature.',
6
+ 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.',
7
+ 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.',
8
+ 'Birds are creatures with feathers, beaks, and the ability to lay eggs.',
9
+ 'Many animal species are undocumented even today.',
10
+ 'Research is going on to discover new species in the far corners of the earth'
11
+ ]
12
+
13
+ describe('Create Item page - Text Selection', () => {
14
+ before(() => {
15
+ cy.loginAs('admin');
16
+ });
17
+
18
+ describe('Question Preview: Auto Scored With Points', () => {
19
+ abortEarlySetup();
20
+ before(() => {
21
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
22
+ cy.barsPreLoaderWait();
23
+ paragraphTextArray.forEach((paragraphText) => {
24
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
25
+ });
26
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
27
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
28
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
29
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
30
+ textSelectionPage.steps.switchToPreviewTab();
31
+ });
32
+
33
+ it('In Preview tab, when an answer is not set then manually scored scoring label should be displayed', () => {
34
+ textSelectionPage.steps.checkManuallyScoredScoringLabel();
35
+ });
36
+
37
+ it('In Preview tab, when user switches to grading view then no banner and correct answer should be displayed', () => {
38
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
39
+ textSelectionPage.steps.switchToGradingView();
40
+ textSelectionPage.steps.verifyAnswerStatusBannerNotExist();
41
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
42
+ });
43
+
44
+ it('When user allocates points to the question then the scoring label should be displayed as manually scored and banner and correct answer status should not exist', () => {
45
+ textSelectionPage.steps.switchToEditTab();
46
+ textSelectionPage.steps.allotPoints(2);
47
+ textSelectionPage.steps.switchToPreviewTab();
48
+ textSelectionPage.steps.checkManuallyScoredScoringLabel();
49
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
50
+ textSelectionPage.steps.switchToGradingView();
51
+ textSelectionPage.steps.verifyAnswerStatusBannerNotExist();
52
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
53
+ });
54
+ });
55
+
56
+ describe('Question Preview: Auto Scored Without Points', () => {
57
+ abortEarlySetup();
58
+ before(() => {
59
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
60
+ cy.barsPreLoaderWait();
61
+ paragraphTextArray.forEach((paragraphText) => {
62
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
63
+ });
64
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
65
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
66
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
67
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
68
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
69
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
70
+ textSelectionPage.steps.switchToPreviewTab();
71
+ });
72
+
73
+ it('In Preview tab, when points are not set then manually scored scoring label should be displayed', () => {
74
+ textSelectionPage.steps.checkManuallyScoredScoringLabel();
75
+ });
76
+
77
+ it('In Preview tab, when user switches to grading view then banner and correct answer should be displayed', () => {
78
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
79
+ textSelectionPage.steps.switchToGradingView();
80
+ textSelectionPage.steps.verifyAnswerStatusBannerExist();
81
+ textSelectionPage.steps.verifyCorrectAnswerSectionExist();
82
+ });
83
+ });
84
+
85
+ describe('Question Preview: Non Scored', () => {
86
+ abortEarlySetup();
87
+ before(() => {
88
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
89
+ cy.barsPreLoaderWait();
90
+ paragraphTextArray.forEach((paragraphText) => {
91
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
92
+ });
93
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
94
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
95
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
96
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
97
+ textSelectionPage.steps.switchToPreviewTab();
98
+ });
99
+
100
+ it('When the user selects \'Grading\' view without setting the answer, correct answers section and answer status banner should not be displayed', () => {
101
+ textSelectionPage.steps.expandScoringTypeDropdown();
102
+ textSelectionPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
103
+ textSelectionPage.steps.switchToPreviewTab();
104
+ textSelectionPage.steps.selectOptionInPreviewTab(paragraphTextArray[0]);
105
+ textSelectionPage.steps.switchToGradingView();
106
+ textSelectionPage.steps.verifyAnswerStatusBannerNotExist();
107
+ textSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
108
+ });
109
+ });
110
+ });
@@ -0,0 +1,46 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ const paragraphTextArray = [
5
+ 'All animals have a unique role to play in maintaining the balance of nature.',
6
+ 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.',
7
+ 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.',
8
+ 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'
9
+ ];
10
+
11
+ describe('Create question page - Text Selection', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ describe('Check Alternative Answer Button', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
20
+ cy.barsPreLoaderWait();
21
+ paragraphTextArray.forEach((paragraphText) => {
22
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
23
+ });
24
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
25
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
26
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
27
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
28
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
29
+ });
30
+
31
+ it('When correct answer is not set then alternative answer should be disabled', () => {
32
+ textSelectionPage.steps.checkAlternativeButtonDisabled();
33
+ });
34
+
35
+ it('When correct answer is set then alternative answer should be enabled', () => {
36
+ textSelectionPage.steps.allotPoints(20);
37
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
38
+ textSelectionPage.steps.checkAlternativeButtonEnabled();
39
+ });
40
+
41
+ it('User should be able to add \'Alternative\' answer using the \'Add alternative\' button, when user has not set any answer in the \'Alternative\' accordion and clicks on the \'Correct\' accordion then \'Correct\' accordion should be expanded', () => {
42
+ textSelectionPage.steps.clickOnAddAlternativeAnswerButton();
43
+ textSelectionPage.steps.expandCorrectAnswerAccordion();
44
+ });
45
+ });
46
+ });
@@ -0,0 +1,57 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ const paragraphTextArray = [
5
+ 'All animals have a unique role to play in maintaining the balance of nature.',
6
+ 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.',
7
+ 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.',
8
+ 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'
9
+ ];
10
+
11
+ describe('Create item page - Text Selection', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ describe('User should be able to edit incomplete authored question', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
20
+ cy.barsPreLoaderWait();
21
+ textSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
22
+ textSelectionPage.steps.editItem();
23
+ });
24
+
25
+ it('Warning icons should be displayed on the required input fields', () => {
26
+ textSelectionPage.steps.verifyWarningIconOnRequiredFields([
27
+ 'Please specify a possible option',
28
+ 'Please set points',
29
+ ]);
30
+ });
31
+
32
+ it('When required input fields are filled then warning icons should disappear', () => {
33
+ textSelectionPage.steps.clearQuestionInputField();
34
+ paragraphTextArray.forEach((paragraphText) => {
35
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
36
+ });
37
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
38
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
39
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
40
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
41
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
42
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
43
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
44
+ textSelectionPage.steps.allotPoints(10);
45
+ textSelectionPage.steps.verifyErrorMessageIsNotDisplayed();
46
+ textSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
47
+ });
48
+
49
+ it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
50
+ textSelectionPage.steps.saveAQuestionAndVerifySnackbar();
51
+ });
52
+
53
+ it('Warning icon should not be visible', () => {
54
+ textSelectionPage.steps.verifyWarningIconNotExist();
55
+ });
56
+ });
57
+ });
@@ -1,8 +1,12 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
- import { dialogBoxBase, textSelectionPage } from "../../../pages";
2
+ import { dialogBoxBase, textSelectionPage, itemPreviewPage } from "../../../pages";
3
+ import { browseItemsPage } from "../../../pages/components";
3
4
  import utilities from "../../../support/helpers/utilities";
4
5
  const options = ['Bat', 'Eagle'];
5
6
 
7
+ var itemReferenceID = "";
8
+
9
+
6
10
  describe('Create item page - Text selection: Header section and Saving question', () => {
7
11
  before(() => {
8
12
  cy.loginAs('admin');
@@ -43,19 +47,16 @@ describe('Create item page - Text selection: Header section and Saving question'
43
47
  });
44
48
 
45
49
  describe('Validation error messages', () => {
46
- dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
50
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please specify a possible option', 'Please set points']);
47
51
 
48
52
  it('Validation error messages should be displayed below required input fields', () => {
49
53
  textSelectionPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
50
- textSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
51
- utilities.verifyInnerText(textSelectionPage.specifyCorrectAnswerErrorMessage(), 'Error: Please set a correct answer.');
54
+ textSelectionPage.steps.verifyWarningIconOnRequiredFields(['Please specify a possible option', 'Please set points']);
52
55
  });
53
56
 
54
57
  it('Validation error messages should disappear when required input fields are filled', () => {
55
58
  textSelectionPage.steps.selectOptionInSpecifyPossibleOptionsSection('Custom', 'Lorem');
56
59
  textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection('Lorem');
57
- utilities.verifyElementVisibilityState(textSelectionPage.specifyCorrectAnswerErrorMessage(), 'notExist');
58
- textSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
59
60
  textSelectionPage.steps.allotPoints(10);
60
61
  });
61
62
 
@@ -68,5 +69,36 @@ describe('Create item page - Text selection: Header section and Saving question'
68
69
  });
69
70
  textSelectionPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
70
71
  });
72
+
73
+ describe('Saving a question with incomplete authoring', () => {
74
+ abortEarlySetup();
75
+ before(() => {
76
+ textSelectionPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
77
+ cy.barsPreLoaderWait();
78
+ });
79
+
80
+ it('User should be able to save the question with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save Question button is clicked', () => {
81
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter all option values', 'Please set points']);
82
+ textSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
83
+ });
84
+ textSelectionPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
85
+ });
86
+ });
87
+
88
+
89
+ describe('Save as you go - Browse item page contents', () => {
90
+ abortEarlySetup();
91
+ before(() => {
92
+ textSelectionPage.steps.navigateToCreateQuestion('fill in the gaps over image with drag and drop');
93
+ cy.barsPreLoaderWait();
94
+ textSelectionPage.steps.saveAQuestionWithIncompleteAuthoring();
95
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
96
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
97
+ browseItemsPage.steps.navigateToBrowseItemsPage();
98
+ });
99
+
100
+ it('When user saves an incompletely authored question then a warning icon should be visible in browse items page', () => {
101
+ browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
102
+ });
71
103
  });
72
104
  });
@@ -50,8 +50,7 @@ describe('Create Item page - Text selection: Question Instructions and Question
50
50
  it('When the user removes all the text from the question input field and focuses out of it, an error message \'Error: Question is required.\' should be displayed', () => {
51
51
  textSelectionPage.steps.clearQuestionInputField();
52
52
  textSelectionPage.steps.focusOutOfQuestionInputField();
53
- utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Question is required.');
54
- textSelectionPage.steps.verifyErroredStateOfQuestionInputField();
53
+ utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
55
54
  });
56
55
 
57
56
  textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
@@ -14,7 +14,11 @@ const constants = {
14
14
  sampleWAVLink: "https://dl.espressif.com/dl/audio/ff-16b-1c-44100hz.wav",
15
15
  sampleAACLink: "https://dl.espressif.com/dl/audio/ff-16b-1c-44100hz.aac",
16
16
  geoGebraResourceLink1: "https://www.geogebra.org/m/sajppba6",
17
- geoGebraResourceLink2: "https://www.geogebra.org/m/xmvdurzb"
17
+ geoGebraResourceLink2: "https://www.geogebra.org/m/xmvdurzb",
18
+ desmos3DGraphingLink1: "https://www.desmos.com/3d/grva75wxbu",
19
+ desmos3DGraphingLink2: "https://www.desmos.com/3d/9scw9vyjdo",
20
+ desmosGeometryLink1: "https://www.desmos.com/geometry/8bj4wiekpm",
21
+ desmosGeometryLink2: "https://www.desmos.com/geometry/trq73hwbnf",
18
22
  };
19
23
 
20
24
  export default constants;
@@ -20,6 +20,7 @@
20
20
  "text": "rgb(0, 0, 46)",
21
21
  "textAreaErrorBg": "rgb(255, 244, 241)",
22
22
  "errorText": "rgb(209, 51, 51)",
23
+ "desmosErrorText": "rgb(164, 93, 0)",
23
24
  "labelText": "rgba(0, 0, 48, 0.87)",
24
25
  "optionsText": "rgb(0, 0, 73)",
25
26
  "optionsSelectedText": "rgb(82, 0, 255)",
@@ -122,6 +123,7 @@
122
123
  "lightThemeBtnBorder": "rgb(94, 110, 255)",
123
124
  "geoGebraCanvasBorder": "rgb(102, 102, 102)",
124
125
  "geoGebraHttpsBg": "rgb(233, 238, 255)",
126
+ "desmosHttpsBg": "rgba(255, 251, 214, 0.4)",
125
127
  "enabledSwitchBg": "rgb(48, 160, 79)",
126
128
  "disabledSwitchBg": "rgb(0, 0, 124)",
127
129
  "gridCellHoverStateBg": "rgba(186, 201, 255, 0.6)",
@@ -141,7 +141,7 @@ const steps = {
141
141
  checkAlternativeButtonEnabled: () => {
142
142
  autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
143
143
  .should('be.enabled');
144
- }
144
+ },
145
145
  }
146
146
 
147
147
  const tests = {
@@ -326,9 +326,9 @@ const tests = {
326
326
  .verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
327
327
  });
328
328
 
329
- it('If user has not selected correct answer in the correct accordion, the user should get a warning popup', () => {
329
+ it('If user has not selected correct answer in the correct accordion, then the Add alternative answer button should be in enabled state', () => {
330
+ utilities.verifyElementNotDisabled(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton());
330
331
  autoScoredSpecifyCorrectAnswerSection.steps.clickOnAddAlternativeAnswerButton();
331
- dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
332
332
  });
333
333
 
334
334
  it('CSS of warning popup', { tags: 'css' }, () => {
@@ -349,30 +349,7 @@ const tests = {
349
349
 
350
350
  it('Accessibility of warning popup', { tags: 'a11y' }, () => {
351
351
  cy.checkAccessibility(dialogBoxBase.dialogBox());
352
- });
353
-
354
- it('Warning popup should close on clicking the Close icon button', () => {
355
352
  dialogBoxBase.steps.closeWarningPopup();
356
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
357
- });
358
-
359
- it('\'Error: Please set a correct answer.\' validation error messages should be displayed in the correct accordion, points error message should not be displayed', () => {
360
- autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
361
- .within(() => {
362
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
363
- });
364
- scoringSectionBaseEditTab.pointsWrapper()
365
- .within(() => {
366
- utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'notExist');
367
- });
368
- if (questionType != 'list ordering' && questionType != 'short text response' && questionType != 'text entry math' && questionType != 'text selection' && questionType != 'fill in the gaps with text' && questionType != 'fill in the gaps over image text') {
369
- steps.verifySpecifyCorrectAnswerErrorMessage();
370
- }
371
- else if (questionType === 'short text response' || questionType === 'fill in the gaps with text' || questionType === 'fill in the gaps over image text' || questionType === 'text entry math') {
372
- utilities.verifyInnerText(utilities.getNthElement(commonComponents.errorMessage(), -1), 'Error: Answer is required.');
373
- } else if (questionType === 'text selection') {
374
- utilities.verifyInnerText(commonComponents.alertMessage(), 'Error: Please set a correct answer.');
375
- }
376
353
  });
377
354
  },
378
355
 
@@ -380,8 +357,9 @@ const tests = {
380
357
  it('When user tries to expand correct accordion when all the mandatory fields are not filled in the alternative accordion, then a warning popup should be displayed and on closing the popup, alternative 2 accordion should be in expanded state', () => {
381
358
  autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
382
359
  .click();
383
- dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
384
360
  dialogBoxBase.steps.closeWarningPopup();
361
+ //TODO: Need to add error message according to question types
362
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'exist');
385
363
  autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
386
364
  .eq(1)
387
365
  .should('have.attr', 'aria-expanded', 'true');
@@ -6,7 +6,6 @@ import { optionsWrapperComponent } from "./optionsWrapperComponent";
6
6
  import { createQuestionBasePage } from "./createQuestionBasePage";
7
7
  import { placeholderTextSectionComponent } from "./placeholderTextSectionComponent";
8
8
  import { scoringSectionBaseEditTab } from "./scoringSectionBaseEditTab";
9
- import { dialogBoxBase } from "../dialogBoxBase";
10
9
  const css = Cypress.env('css');
11
10
 
12
11
  const selectors = {
@@ -750,72 +749,6 @@ const steps = {
750
749
  }
751
750
 
752
751
  const tests = {
753
- //TODO need to remove once Save as you go is available for all questions
754
- /**
755
- * @description Verifies the behavior of the 'Add alternative answer' button, warning popups, and validation error messages
756
- * in the 'Specify correct answer' section for alternative answers in auto-scored questions.
757
- * @param {string|null} questionType - The type of the question (e.g., 'list ordering'). Pass `null` if not applicable.
758
- * @example - verifyAutoScoredAddAlternativeAnswerButtonAndValidation();
759
- */
760
- verifyAutoScoredAddAlternativeAnswerButtonAndValidation: (questionType = null) => {
761
- it('\'+ Add alternative answer\' button should be present', () => {
762
- utilities.verifyInnerText(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton(), 'Add alternative answer');
763
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton(), 'visible');
764
- autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
765
- .verifyPseudoClassBeforeProperty('content', '""');
766
- });
767
-
768
- it('CSS of \'Add Alternative answer\' button', { tags: 'css' }, () => {
769
- utilities.verifyCSS(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton().find('p'), {
770
- 'color': css.color.activeButtons,
771
- 'font-size': css.fontSize.default,
772
- 'font-weight': css.fontWeight.regular
773
- });
774
- autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton()
775
- .verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
776
- });
777
-
778
- it('If user has not selected correct answer in the correct accordion, then the Add alternative answer button should be in enabled state', () => {
779
- utilities.verifyElementNotDisabled(autoScoredSpecifyCorrectAnswerSection.alternativeAnswerButton());
780
- autoScoredSpecifyCorrectAnswerSection.steps.clickOnAddAlternativeAnswerButton();
781
- });
782
-
783
- it('CSS of warning popup', { tags: 'css' }, () => {
784
- utilities.verifyCSS(dialogBoxBase.dialogBoxTitle(), {
785
- 'color': css.color.flyoutTitle,
786
- 'font-size': css.fontSize.heading,
787
- 'font-weight': css.fontWeight.semibold
788
- });
789
- utilities.verifyCSS(dialogBoxBase.dialogBoxContent(), {
790
- 'color': css.color.labels,
791
- 'font-size': css.fontSize.default,
792
- 'font-weight': css.fontWeight.regular
793
- });
794
- utilities.verifyCSS(dialogBoxBase.buttonClose().find('svg'), {
795
- 'fill': css.color.closeIcon
796
- });
797
- });
798
-
799
- it('Accessibility of warning popup', { tags: 'a11y' }, () => {
800
- cy.checkAccessibility(dialogBoxBase.dialogBox());
801
- dialogBoxBase.steps.closeWarningPopup();
802
- });
803
- },
804
-
805
- //TODO need to remove once Save as you go is available for all questions
806
- verifyWarningPopupAndAccordionNavigationWhenNoPointsAddedInAlternativeAccordion: () => {
807
- it('When user tries to expand correct accordion when all the mandatory fields are not filled in the alternative accordion, then a warning popup should be displayed and on closing the popup, alternative 2 accordion should be in expanded state', () => {
808
- autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
809
- .click();
810
- dialogBoxBase.steps.closeWarningPopup();
811
- //TODO: Need to add error message according to question types
812
- utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'exist');
813
- autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
814
- .eq(1)
815
- .should('have.attr', 'aria-expanded', 'true');
816
- });
817
- },
818
-
819
752
  /**
820
753
  * Verifies the contents and functionality of the 'Specify correct answer' accordion for fill in the gaps over image dropdown question.
821
754
  * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.