itemengine-cypress-automation 1.0.46 → 1.0.48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAddResponseContainer.js +221 -0
  2. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js +450 -0
  3. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsBasic.js +202 -0
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsCustomSpecialCharachters.js +120 -0
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsMultilineResponse.js +189 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsResponseAccordions.js +431 -0
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettingsStudentResponseAreaAndLayout.js +262 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js +188 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswer.js +613 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingWithAlternateAnswerMatchFromAllResponsesTrue.js +172 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextConditionalCheckboxes.js +203 -0
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +134 -0
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +133 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabScoringSection.js +227 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextHeaderSection.js +109 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js +156 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextManualAndNonScored.js +157 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextMatchFromAllResponses.js +162 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsScoring.js +200 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswer.js +849 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +171 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsScoring.js +199 -0
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswer.js +738 -0
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsWithAlternateAnswerMatchFromAllResponsesTrue.js +168 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPreviewTab.js +66 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSetCorrectAnswerSection.js +113 -0
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSupportedFileTypes.js +86 -0
  28. package/package.json +1 -1
@@ -0,0 +1,168 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const correctTabAnswerArray = ['Flower', 'Leaf', 'Stem'];
4
+ const alternateTabAnswerArray = ['Petals', 'Leaves', 'Stem'];
5
+ const incorrectAnswerArray = ['Roots', 'Branch', 'Seed'];
6
+
7
+ describe('Create item page - Fill in the gaps over image - text: Partial equal weights scoring', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Question preview: Auto scored - Partial equal weights with alternate answer (Match from all responses - true)', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigate to fill in the gaps over image - text question type');
16
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
17
+ cy.barsPreLoaderWait();
18
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
19
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
20
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
21
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
22
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
23
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
24
+ fillInTheGapsOverImageTextPage.steps.selectPartialEqualWeightsCheckbox();
25
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
26
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
27
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTabAnswerArray[0]);
28
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTabAnswerArray[1]);
29
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
30
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
31
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
32
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
33
+ });
34
+
35
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct answer container should be displayed with the correct responses from the correct tab', () => {
36
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
37
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
38
+ fillInTheGapsOverImageTextPage.steps.uncheckShowCorrectAnswerCheckbox();
39
+ });
40
+
41
+ it('When the user attempts the question with responses from the correct tab, then the user should be awarded with points specified for correct tab and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, correct/incorrect answer label and its border should not be displayed below the question preview and correct answer container should not be displayed', () => {
42
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
43
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, correctTabAnswerArray[1]);
44
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
45
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
46
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
47
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
48
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
49
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
50
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
51
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
52
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields correct/incorrect answer label and its border should not be displayed below the question preview and correct answer container should not be displayed')
53
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
54
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
55
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
56
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
57
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
58
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
59
+ });
60
+
61
+ it('When the user attempts the question with responses from the alternate tab, then the user should be awarded with points specified for alternate tab and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, correct/incorrect answer label and its border should not be displayed below the question preview and correct answer container should not be displayed', () => {
62
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
63
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
64
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
65
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
66
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
67
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
68
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
69
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
70
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
71
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
72
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
73
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, label \'Correct answer\' and correct answer border should be displayed below the question preview and correct answer container should not be displayed')
74
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
75
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
76
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
77
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
78
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
79
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
80
+ });
81
+
82
+ it('When the user attempts the question with partially correct responses exclusively from the correct tab, the user should be awarded points as per the correctly attempted response and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
83
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
84
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
85
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
86
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 20);
87
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
88
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
89
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
90
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
91
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
92
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[1]], ['2']);
93
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
94
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should not be displayed')
95
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
96
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
97
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
98
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
99
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
100
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
101
+ });
102
+
103
+ it('When the user attempts the question with partially correct responses exclusively from the alternate tab, the user should be awarded points as per the correctly attempted response, and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
104
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
105
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, alternateTabAnswerArray[0]);
106
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, incorrectAnswerArray[1]);
107
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 20);
108
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
109
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
110
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
111
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
112
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
113
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([alternateTabAnswerArray[1]], ['2']);
114
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
115
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides correct response field, red cross-mark icon should be displayed besides the incorrect response field, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should not be displayed')
116
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
117
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
118
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
119
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
120
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
121
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
122
+ });
123
+
124
+ it('When the user attempts the question with a combination of correct responses from correct tab and alternate tab, then the user should be awarded with full points and on selecting \'Show correct answer\' checkbox, green check-mark icon should be displayed besides response fields, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should not be displayed', () => {
125
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
126
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[0]);
127
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[1]);
128
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(20, 20);
129
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
130
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
131
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
132
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
133
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
134
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
135
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
136
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should not be displayed')
137
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
138
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
139
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(1);
140
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
141
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
142
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
143
+ });
144
+
145
+ it('When the user attempts the question incorrectly, then the user should be awarded with 0 points and on selecting \'Show correct answer\' checkbox, red cross-mark icon should be displayed beside response fields, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should be displayed with the correct responses from the correct tab for the responses marked incorrect', () => {
146
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
147
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[1]);
148
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(1, alternateTabAnswerArray[0]);
149
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 20);
150
+ fillInTheGapsOverImageTextPage.steps.checkShowCorrectAnswerCheckbox();
151
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
152
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
153
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
154
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
155
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount([correctTabAnswerArray[0], correctTabAnswerArray[1]], ['1', '2']);
156
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
157
+ cy.log('When the user clicks on \'Check answer\' button, green check-mark icon should be displayed besides response fields, correct/incorrect answer label and its border should not be displayed below the question preview and the correct answer container should not be displayed')
158
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
159
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
160
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(1);
161
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectBorderNotExists();
162
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
163
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabCorrectAnswerContainerNotExist();
164
+ });
165
+
166
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(1, 20);
167
+ });
168
+ });
@@ -0,0 +1,66 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const correctTabAnswerArray = ['Flower', 'Leaf', 'Stem'];
7
+
8
+ describe('Create item page - Fill in the gaps over image - text: Preview contents', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Preview tab contents', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to Fill in the gaps over image - text question type');
17
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
18
+ cy.barsPreLoaderWait();
19
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
20
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
21
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
22
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
23
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
24
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
25
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
26
+ });
27
+
28
+ it('When user uploads an image in the \'Image\' section then the uploaded image should be displayed in the preview tab', () => {
29
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imagePreviewTab(), 'visible');
30
+ });
31
+
32
+ it('The added response fields should be displayed in the preview tab and they should be empty', () => {
33
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldPreviewTab(), 2);
34
+ fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, '');
35
+ fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(1, '');
36
+ });
37
+
38
+ it('User should be able to enter text in the response field', () => {
39
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, correctTabAnswerArray[2]);
40
+ fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(0, correctTabAnswerArray[2]);
41
+ fillInTheGapsOverImageTextPage.steps.verifyTextInResponseFieldPreviewTab(1, '');
42
+ });
43
+
44
+ it('CSS of preview tab contents', { tags: 'css' }, () => {
45
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseContainerPointer().find('circle'), {
46
+ 'fill': css.color.responseContainerPointer,
47
+ 'font-size': css.fontSize.normal,
48
+ 'font-weight': css.fontWeight.regular,
49
+ });
50
+ fillInTheGapsOverImageTextPage.steps.focusInResponseFieldPreviewTab(0);
51
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseFieldPreviewTab().parents('.cloze-with-text-response-preview-wrapper').find('fieldset').eq(0), {
52
+ 'border': `1px solid ${css.color.activeButtons}`
53
+ });
54
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.responseFieldPreviewTab().parents('.cloze-with-text-response-preview-wrapper').find('fieldset').eq(1), {
55
+ 'color': css.color.text,
56
+ 'font-size': css.fontSize.default,
57
+ 'font-weight': css.fontWeight.regular,
58
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`
59
+ });
60
+ });
61
+
62
+ it('Accessibility of preview tab', { tags: 'a11y' }, () => {
63
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.previewTabQuestionWrapper());
64
+ });
65
+ });
66
+ });
@@ -0,0 +1,113 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - Fill in the gaps over image - text: Set correct answer section, Alternate answer tab, Correct response conditions section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Set correct answer section', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigate to fill in the gaps over image - text question type');
15
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
16
+ cy.barsPreLoaderWait();
17
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
18
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
19
+ });
20
+
21
+ fillInTheGapsOverImageTextPage.tests.verifyAutoScoredSetCorrectAnswerHeaderSectionContents('fill in the gaps over image - text');
22
+
23
+ fillInTheGapsOverImageTextPage.tests.verifySetCorrectAnswerSectionDefaultState();
24
+
25
+ it('When the user adds a response container over the uploaded image, a response field with label \'Response 1\' should be displayed in the set correct answer section', () => {
26
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
27
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldSetCorrectAnswerSection(), 'visible');
28
+ utilities.verifyElementCount(fillInTheGapsOverImageTextPage.responseFieldSetCorrectAnswerSection(), 1);
29
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.responseFieldLabelSetCorrectAnswerSection(), 'Response 1');
30
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.responseFieldLabelSetCorrectAnswerSection(), 'visible');
31
+ });
32
+ });
33
+
34
+ describe('Set correct answer section - Correct tab', () => {
35
+ abortEarlySetup();
36
+ before(() => {
37
+ cy.log('Navigate to fill in the gaps over image - text question type');
38
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
39
+ cy.barsPreLoaderWait();
40
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
41
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
42
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
43
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
44
+ });
45
+
46
+ fillInTheGapsOverImageTextPage.tests.verifySetCorrectAnswerTabContentsAndFunctionality('Correct tab');
47
+ });
48
+
49
+ describe('Set correct answer section - Alternate tab', () => {
50
+ abortEarlySetup();
51
+ before(() => {
52
+ cy.log('Navigate to fill in the gaps over image - text question type');
53
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
54
+ cy.barsPreLoaderWait();
55
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
56
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
57
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
58
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
59
+ });
60
+
61
+ fillInTheGapsOverImageTextPage.tests.verifyAutoScoredAlternateAnswer();
62
+
63
+ it('When user has added points and filled all the response fields in the \'Correct\' tab, then the user should be able to add alternate answer for the question using \'Add alternate answer\' button and \'Match from all responses\' functionality label and checkbox should get enabled and the checkbox should be in unchecked state', () => {
64
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Flower');
65
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, 'Leaf');
66
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
67
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
68
+ fillInTheGapsOverImageTextPage.steps.verifyMatchFromAllResponsesLabelAndCheckboxEnabledState();
69
+ });
70
+
71
+ fillInTheGapsOverImageTextPage.tests.verifyA11yOfAlternateAnswerTab();
72
+
73
+ fillInTheGapsOverImageTextPage.tests.verifySetCorrectAnswerTabContentsAndFunctionality('Alternate tab');
74
+
75
+ it('User should be able to add another alternate answer for the question using \'Add alternate answer\' button and the name for this new tab should be \'Alternate 2\'', () => {
76
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(2);
77
+ });
78
+
79
+ fillInTheGapsOverImageTextPage.tests.verifyWarningPopupAndTabNavigationWhenNoPointsAddedInAlternateTab();
80
+
81
+ it('User should be able to remove alternate correct answer by clicking on the \'Close\' icon button alongside alternate answer tab and the name of the alternate answer tabs should get updated accordingly', () => {
82
+ cy.log('Set correct answer and points in alternate 2 tab, then switch to Alternate 1 tab and click delete icon button');
83
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Petals');
84
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, 'Leaves');
85
+ fillInTheGapsOverImageTextPage.steps.allotPoints(5);
86
+ fillInTheGapsOverImageTextPage.steps.navigateToAlternateTab(1);
87
+ fillInTheGapsOverImageTextPage.steps.deleteAlternateTab();
88
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.alternateAnswerTab(2), 'notExist');
89
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.alternateAnswerTab(1), 'Alternate 1');
90
+ });
91
+
92
+ it('When the user removes all the \'Alternate\' tabs, \'Match from all responses\' functionality should get disabled', () => {
93
+ fillInTheGapsOverImageTextPage.steps.deleteAlternateTab();
94
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.alternateAnswerTab(1), 'notExist');
95
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.matchFromAllResponsesLabel(), 'Match from all responses');
96
+ fillInTheGapsOverImageTextPage.steps.verifyMatchFromAllResponsesLabelAndCheckboxDisabledState();
97
+ });
98
+ });
99
+
100
+ describe('Correct response conditions section', () => {
101
+ abortEarlySetup();
102
+ before(() => {
103
+ cy.log('Navigate to fill in the gaps over image - text question type');
104
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
105
+ cy.barsPreLoaderWait();
106
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
107
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
108
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
109
+ });
110
+
111
+ fillInTheGapsOverImageTextPage.tests.verifyCorrectResponseConditionSectionDefaultState();
112
+ });
113
+ });
@@ -0,0 +1,86 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import { uploadImageSectionComponent } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ import constants from "../../../fixtures/constants";
6
+
7
+ describe('Create Item page - Fill in the gaps over image - text: Supported file types', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Supported file types functionality: device popup', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to fill in the gaps over image - text question type');
16
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
17
+ cy.barsPreLoaderWait();
18
+ });
19
+
20
+ const supportedFormatFiles = {
21
+ jpg: 'highlightImage.jpg',
22
+ jpeg: 'sample.jpeg',
23
+ png: 'image.png',
24
+ gif: 'sample.gif',
25
+ heic: 'sample.heic',
26
+ heif: 'sample.heif',
27
+ svg: 'sample.svg'
28
+ };
29
+
30
+ Object.keys(supportedFormatFiles).forEach((fileType) => {
31
+ it(`User should be able to upload ${fileType} file in the image section using link text \'device\' and it should be displayed in the \'Image\' section and \'Preview tab\'`, () => {
32
+ uploadImageSectionComponent.steps.uploadFile(supportedFormatFiles[fileType]);
33
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
34
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
35
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
36
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'visible');
37
+ fillInTheGapsOverImageTextPage.steps.verifyUploadedImageFormatInImageSection(fileType);
38
+ cy.log('Checking in preview tab')
39
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
40
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imagePreviewTab(), 'visible');
41
+ fillInTheGapsOverImageTextPage.steps.verifyUploadedImageFormatInPreviewTab(fileType);
42
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
43
+ cy.log('Post step: Delete the image')
44
+ uploadImageSectionComponent.steps.clickOnDeleteImageButton();
45
+ uploadImageSectionComponent.steps.clickOnDeleteButtonInDeleteImagePopup();
46
+ });
47
+ });
48
+ });
49
+
50
+ describe('Supported file types functionality: Source URL popup', () => {
51
+ abortEarlySetup();
52
+ before(() => {
53
+ cy.log('Navigating to fill in the gaps over image - text question type');
54
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
55
+ cy.barsPreLoaderWait();
56
+ });
57
+
58
+ const supportedFormatFiles = {
59
+ jpg: constants.foxImageLink,
60
+ jpeg: constants.sampleJPEGLink,
61
+ png: constants.samplePNGLink,
62
+ gif: constants.sampleGIFLink,
63
+ svg: constants.sampleSVGLink
64
+ };
65
+
66
+ Object.keys(supportedFormatFiles).forEach((fileType) => {
67
+ it(`User should be able to upload ${fileType} file in the upload section using link text \'source URL\' and it should be displayed in the \'Image\' section and \'Preview tab\'`, () => {
68
+ uploadImageSectionComponent.steps.clickOnSourceURL();
69
+ uploadImageSectionComponent.steps.uploadImageUsingSourceURL(supportedFormatFiles[fileType]);
70
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
71
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
72
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
73
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imageSectionImage(), 'visible');
74
+ fillInTheGapsOverImageTextPage.steps.verifyUploadedImageFormatInImageSection(fileType);
75
+ cy.log('Checking in preview tab')
76
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
77
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.imagePreviewTab(), 'visible');
78
+ fillInTheGapsOverImageTextPage.steps.verifyUploadedImageFormatInPreviewTab(fileType);
79
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
80
+ cy.log('Post step: Delete the image')
81
+ uploadImageSectionComponent.steps.clickOnDeleteImageButton();
82
+ uploadImageSectionComponent.steps.clickOnDeleteButtonInDeleteImagePopup();
83
+ });
84
+ });
85
+ });
86
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {