itemengine-cypress-automation 1.0.22 → 1.0.24

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 (17) hide show
  1. package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettings.js +0 -139
  2. package/cypress/e2e/ILC/AudioResponse/audioResponseAdditionalSettingsBasic.js +151 -0
  3. package/cypress/e2e/ILC/AudioResponse/audioResponseControlsForRecordingResponse.js +308 -0
  4. package/cypress/e2e/ILC/AudioResponse/audioResponseControlsResponsePlayback.js +591 -0
  5. package/cypress/e2e/ILC/AudioResponse/audioResponseEditTabBasicSections.js +1 -882
  6. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettings.js +2060 -0
  7. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAlternateAnswer.js +104 -0
  8. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAutoScoredScoring.js +84 -0
  9. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextCaseSensitiveAndIgnoreExtraSpacesCheckboxes.js +174 -0
  10. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextEditTabBasicSections.js +176 -0
  11. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextEditTabScoringSection.js +150 -0
  12. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextHeaderSection.js +112 -0
  13. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextManuallyAndNonScoredScoring.js +49 -0
  14. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextScoringPartialDifferentWeights.js +97 -0
  15. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextScoringPartialEqualWeights.js +95 -0
  16. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextSetCorrectAnswerSection.js +70 -0
  17. package/package.json +1 -1
@@ -0,0 +1,150 @@
1
+ import { fillInTheGapsTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create Item page - Fill in the Gaps: Scoring Section', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Scoring Section contents', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ cy.log('Navigate to fill in the gaps - text question type');
14
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ fillInTheGapsTextPage.tests.verifyScoringTypeLabelAndDropdown('autoScored');
19
+
20
+ fillInTheGapsTextPage.tests.verifyAutoScoredScoringTypeSectionWithCSSAnda11y();
21
+ });
22
+
23
+ describe('Auto Scored: All or nothing scoring - Edit tab', () => { //All error messages cases except one are covered here
24
+ abortEarlySetup();
25
+ before(() => {
26
+ cy.log('Navigate to fill in the gaps - text question type');
27
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
28
+ cy.barsPreLoaderWait();
29
+ });
30
+
31
+ fillInTheGapsTextPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
32
+ fillInTheGapsTextPage.tests.verifyPointsFieldErrorState(10);
33
+ fillInTheGapsTextPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
34
+
35
+ it('When the user focuses in and out of the empty responses input field, \'Error: Please set a correct answer\' error message should be displayed below the response input fields', () => {
36
+ fillInTheGapsTextPage.setCorrectAnswerResponseField()
37
+ .eq(0)
38
+ .click();
39
+ cy.get('body')
40
+ .click();
41
+ fillInTheGapsTextPage.errorMessage()
42
+ .verifyInnerText('Error: Please set a correct answer.');
43
+ });
44
+
45
+ it('CSS of empty response input field error message', { tags: 'css' }, () => {
46
+ fillInTheGapsTextPage.setCorrectAnswerResponseField()
47
+ .parents('.cloze-with-text-authoring-mode-response-all-or-nothing-wrapper')
48
+ .within(() => {
49
+ fillInTheGapsTextPage.errorMessage()
50
+ .verifyCSS(css.color.errorText, css.fontSize.small, css.fontWeight.regular);
51
+ });
52
+ });
53
+
54
+ it('Accessibility of empty response input field error message', { tags: 'a11y' }, () => {
55
+ cy.checkAccessibility(fillInTheGapsTextPage.setCorrectAnswerResponseField().parents('.cloze-with-text-authoring-mode-response-all-or-nothing-wrapper'));
56
+ });
57
+
58
+ it('When user gives an input to all of the empty responses input fields, then the error message should disappear', () => {
59
+ fillInTheGapsTextPage.setCorrectAnswerResponseField()
60
+ .each(($element) => {
61
+ cy.wrap($element)
62
+ .type('Response input');
63
+ });
64
+ fillInTheGapsTextPage.errorMessage()
65
+ .should('not.exist');
66
+ });
67
+
68
+ });
69
+
70
+ describe('Auto Scored: Partial - equal weights scoring - Edit tab', () => {
71
+ abortEarlySetup();
72
+ before(() => {
73
+ cy.log('Navigate to fill in the gaps - text question type');
74
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
75
+ cy.barsPreLoaderWait();
76
+ });
77
+
78
+ fillInTheGapsTextPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabContents()
79
+
80
+ it('When user adds a response to the question, then one more response field should be displayed in the set correct answer section and points per response score should be updated accordingly', () => {
81
+ fillInTheGapsTextPage.questionInputField()
82
+ .click();
83
+ fillInTheGapsTextPage.ckEditorAddResponseButton()
84
+ .click();
85
+ fillInTheGapsTextPage.setCorrectAnswerResponseField()
86
+ .should('have.length', '3');
87
+ fillInTheGapsTextPage.partialEqualWeightsPointsPerResponseScore()
88
+ .each(($element) => {
89
+ cy.wrap($element)
90
+ .verifyInnerText('1.33');
91
+ });
92
+ });
93
+
94
+ fillInTheGapsTextPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality()
95
+ });
96
+
97
+ describe('Auto Scored: Partial - different weights scoring - Edit tab', () => {
98
+ abortEarlySetup();
99
+ before(() => {
100
+ cy.log('Navigate to fill in the gaps - text question type');
101
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
102
+ cy.barsPreLoaderWait();
103
+ });
104
+
105
+ fillInTheGapsTextPage.tests.verifyAutoScoredPartialDifferentWeightsScoringEditTabContents()
106
+
107
+ it('When user gives an input to the response input field then the \'Points per response\' input field should be enabled', () => {
108
+ fillInTheGapsTextPage.setCorrectAnswerResponseField()
109
+ .each(($element) => {
110
+ cy.wrap($element)
111
+ .type('Response input');
112
+ });
113
+ fillInTheGapsTextPage.pointsInputField()
114
+ .each(($element) => {
115
+ cy.wrap($element)
116
+ .should('be.enabled');
117
+ });
118
+ });
119
+
120
+ fillInTheGapsTextPage.tests.verifyAutoScoredPartialDifferentWeightsScoringEditTabFunctionality()
121
+ });
122
+
123
+ describe('Manually Scored scoring - Edit tab', () => {
124
+ abortEarlySetup();
125
+ before(() => {
126
+ cy.log('Navigate to fill in the gaps - text question type');
127
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
128
+ cy.barsPreLoaderWait();
129
+ });
130
+
131
+ it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
132
+ fillInTheGapsTextPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored')
133
+ });
134
+
135
+ fillInTheGapsTextPage.tests.verifyManuallyScoredScoringContents()
136
+ fillInTheGapsTextPage.tests.verifyPointsFieldErrorState(10);
137
+ fillInTheGapsTextPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
138
+ });
139
+
140
+ describe('Non Scored scoring - Edit tab', () => {
141
+ abortEarlySetup();
142
+ before(() => {
143
+ cy.log('Navigate to fill in the gaps - text question type');
144
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
145
+ cy.barsPreLoaderWait();
146
+ });
147
+
148
+ fillInTheGapsTextPage.tests.verifyEditTabNonScoredScoringSectionContents();
149
+ });
150
+ });
@@ -0,0 +1,112 @@
1
+ import { dialogBoxBase, fillInTheGapsTextPage, selectQuestionResourceToolPage } from "../../../pages";
2
+ import { commonComponents } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - Fill in the gaps - text: Header section and saving question', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Header section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigate to fill in the gaps - text question type');
15
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
16
+ });
17
+
18
+ fillInTheGapsTextPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Fill in the gaps with text');
19
+ });
20
+
21
+ describe('Tabs section', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
25
+ });
26
+
27
+ fillInTheGapsTextPage.tests.verifyTabsSection();
28
+ });
29
+
30
+ describe('Cancel button', () => {
31
+ abortEarlySetup();
32
+ before(() => {
33
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
34
+ });
35
+
36
+ fillInTheGapsTextPage.tests.verifyCancelButton('fill in the gaps with text');
37
+ });
38
+
39
+ describe('Save Question button', () => {
40
+ abortEarlySetup();
41
+ before(() => {
42
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
43
+ });
44
+
45
+ describe('Validation error messages', () => {
46
+ dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
47
+
48
+ it('Validation error messages should be displayed below required input fields', () => {
49
+ fillInTheGapsTextPage.questionInstructionsLabelEditTab()
50
+ .parents('.edit-question-instruction-wrapper')
51
+ .within(() => {
52
+ commonComponents.errorMessage()
53
+ .verifyInnerText('Error: Question instructions are required.')
54
+ .and('be.visible');
55
+ });
56
+ fillInTheGapsTextPage.pointsInputField()
57
+ .parents('.cloze-with-text-points-wrapper')
58
+ .within(() => {
59
+ fillInTheGapsTextPage.pleaseEnterPointsErrorMessage()
60
+ .verifyInnerText('Error: Please enter points.')
61
+ .and('be.visible');
62
+ });
63
+ //Failing due to https://redmine.zeuslearning.com/issues/531580
64
+ fillInTheGapsTextPage.setCorrectAnswerResponseField()
65
+ .parents('.cloze-with-text-authoring-mode-response-all-or-nothing-wrapper')
66
+ .within(() => {
67
+ fillInTheGapsTextPage.errorMessage()
68
+ .verifyInnerText('Error: Please set a correct answer.')
69
+ .and('be.visible');
70
+ });
71
+ fillInTheGapsTextPage.setCorrectAnswerErrorIcon()
72
+ .should('be.visible');
73
+ });
74
+
75
+ it('Validation error messages should disappear when required input fields are filled', () => {
76
+ fillInTheGapsTextPage.steps.addQuestionInstructions();
77
+ fillInTheGapsTextPage.questionInstructionsLabelEditTab()
78
+ .parents('.edit-question-instruction-wrapper')
79
+ .within(() => {
80
+ commonComponents.errorMessage()
81
+ .should('not.exist');
82
+ });
83
+ fillInTheGapsTextPage.steps.allotPoints(20);
84
+ fillInTheGapsTextPage.pointsInputField()
85
+ .parents('.cloze-with-text-points-wrapper')
86
+ .within(() => {
87
+ fillInTheGapsTextPage.pleaseEnterPointsErrorMessage()
88
+ .should('not.exist');
89
+ });
90
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
91
+ fillInTheGapsTextPage.setCorrectAnswerResponseField()
92
+ .parents('.cloze-with-text-authoring-mode-response-all-or-nothing-wrapper')
93
+ .within(() => {
94
+ fillInTheGapsTextPage.errorMessage()
95
+ .should('not.exist');
96
+ });
97
+ fillInTheGapsTextPage.setCorrectAnswerErrorIcon()
98
+ .should('not.exist');
99
+ });
100
+ });
101
+
102
+ describe('Saving a question', () => {
103
+ abortEarlySetup();
104
+
105
+ it('When user has filled all the mandatory fields then on clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
106
+ fillInTheGapsTextPage.steps.saveAQuestionAndVerifySnackbar();
107
+ });
108
+
109
+ fillInTheGapsTextPage.tests.verifySavedSuccessfullySnackbarCSSanda11y();
110
+ });
111
+ });
112
+ });
@@ -0,0 +1,49 @@
1
+ import { fillInTheGapsScoring, fillInTheGapsTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Fill in the gaps - text Manually and Non scored scoring types', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: Manually Scored', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Adding question instructions and options, select Manually Scored scoring type and add points for the question');
13
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text')
14
+ fillInTheGapsTextPage.steps.addQuestionInstructions();
15
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
16
+ fillInTheGapsTextPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored')
17
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
18
+ });
19
+
20
+ it('When the user switches to the Preview tab, the question instruction, sample \'Lorem Ipsum\' text along with two response fields should be displayed', () => {
21
+ fillInTheGapsTextPage.steps.switchToPreviewTab()
22
+ fillInTheGapsTextPage.steps.verifyQuestionInstructionsText();
23
+ fillInTheGapsTextPage.questionInputField()
24
+ .should('have.text', 'Lorem ipsum dolor sit amet, 1Responsecloseonsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget 2Responseclosetempus tellus dapibus.');
25
+ fillInTheGapsTextPage.previewTabQuestionContainer()
26
+ .verifyInnerText('Lorem ipsum dolor sit amet, \n​\nonsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \n​\ntempus tellus dapibus.');
27
+ fillInTheGapsTextPage.previewTabResponseField()
28
+ .should('have.length', 2)
29
+ .and('be.visible');
30
+ });
31
+
32
+ fillInTheGapsTextPage.tests.verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab()
33
+ });
34
+
35
+ describe('Question Preview: Non Scored', () => {
36
+ abortEarlySetup();
37
+ before(() => {
38
+ cy.log('Adding question instructions and options, select Non Scored scoring type and set correct answer');
39
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
40
+ fillInTheGapsTextPage.steps.selectAScoringTypeFromScoringTypeDropdown('Non scored');
41
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
42
+ fillInTheGapsTextPage.steps.expandAdditonalSettings();
43
+ fillInTheGapsTextPage.steps.setMaximumCheckAnswerAttempts(10)
44
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
45
+ });
46
+
47
+ fillInTheGapsScoring.tests.verifyNonScoredScoring('fill in the gaps - text');
48
+ });
49
+ });
@@ -0,0 +1,97 @@
1
+ import { fillInTheGapsScoring } from "../../../pages/fillInTheGapsScoring";
2
+ import { fillInTheGapsTextPage } from "../../../pages/fillInTheGapsTextPage";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Fill in the gaps - text: Partial Different scoring', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Question Preview: AutoScored - Partial different weights', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigate to Fill in the gaps - text question type, fill the necessary details and points, uncheck round down score checkbox and switch to preview tab');
15
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
16
+ fillInTheGapsTextPage.partialDifferentWeightsCheckbox()
17
+ .click();
18
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
19
+ fillInTheGapsTextPage.steps.addPartialDifferentWeightsPoints([5.4, 4.8]);
20
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
21
+ fillInTheGapsTextPage.rounddownScoreCheckbox()
22
+ .click();
23
+ fillInTheGapsTextPage.steps.expandAdditonalSettings();
24
+ fillInTheGapsTextPage.allowStudentsToCheckAnswerCheckbox()
25
+ .click();
26
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
27
+ });
28
+
29
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsScoring('fill in the gaps - text');
30
+ });
31
+
32
+ describe('Question Preview: AutoScored - Partial different weights with alternate answer with \'Match from all responses - \"false\"', () => {
33
+ abortEarlySetup();
34
+ before(() => {
35
+ cy.log('Navigate to Fill in the gaps - text question type, adding correct answer responses and alternate answer responses, adding points and switch to preview tab');
36
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
37
+ fillInTheGapsTextPage.partialDifferentWeightsCheckbox()
38
+ .click();
39
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
40
+ fillInTheGapsTextPage.steps.addPartialDifferentWeightsPoints([5, 7]);
41
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
42
+ fillInTheGapsTextPage.alternateAnswerButton()
43
+ .click();
44
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 3', 'Response 4']);
45
+ cy.log('Setting alternate answer points less than correct answer points')
46
+ fillInTheGapsTextPage.steps.addPartialDifferentWeightsPoints([3, 6]);
47
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
48
+ fillInTheGapsTextPage.steps.expandAdditonalSettings();
49
+ fillInTheGapsTextPage.allowStudentsToCheckAnswerCheckbox()
50
+ .click();
51
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
52
+ });
53
+
54
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - text');
55
+ });
56
+
57
+ describe('Question Preview: AutoScored - Partial different weights with alternate answer with \'Match from all responses - \"true\"', () => {
58
+ abortEarlySetup();
59
+ before(() => {
60
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
61
+ fillInTheGapsTextPage.partialDifferentWeightsCheckbox()
62
+ .click();
63
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
64
+ fillInTheGapsTextPage.steps.addPartialDifferentWeightsPoints([5, 7]);
65
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
66
+ fillInTheGapsTextPage.alternateAnswerButton()
67
+ .click();
68
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 3', 'Response 4']);
69
+ fillInTheGapsTextPage.steps.addPartialDifferentWeightsPoints([3, 6]);
70
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
71
+ fillInTheGapsTextPage.steps.expandAdditonalSettings();
72
+ fillInTheGapsTextPage.allowStudentsToCheckAnswerCheckbox()
73
+ .click();
74
+ fillInTheGapsTextPage.matchFromAllResponsesCheckbox()
75
+ .click();
76
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
77
+ });
78
+
79
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - text');
80
+ });
81
+
82
+ describe('Partial Different Weights: Round down score', () => {
83
+ abortEarlySetup();
84
+ before(() => {
85
+ cy.log('Add question instructions and options, set correct answers, select partial - different weights scoring and add points (in decimals) for correct answer options');
86
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
87
+ fillInTheGapsTextPage.partialDifferentWeightsCheckbox()
88
+ .click();
89
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
90
+ fillInTheGapsTextPage.steps.addPartialDifferentWeightsPoints([1.36, 2.89]);
91
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
92
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
93
+ });
94
+
95
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsRoundDownScore('fill in the gaps - text');
96
+ });
97
+ });
@@ -0,0 +1,95 @@
1
+ import { fillInTheGapsScoring, fillInTheGapsTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Fill in the gaps - Text Scoring Section Partial - equal weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ })
8
+
9
+ describe('Question Preview Auto Scored: Partial - equal weights', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to Fill in the gaps - text question type, fill the necessary details and points and switch to preview tab');
13
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
14
+ fillInTheGapsTextPage.steps.addQuestionInstructions();
15
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
16
+ fillInTheGapsTextPage.steps.allotPoints('10');
17
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
18
+ fillInTheGapsTextPage.steps.expandAdditonalSettings();
19
+ fillInTheGapsTextPage.allowStudentsToCheckAnswerCheckbox()
20
+ .click();
21
+ fillInTheGapsTextPage.partialEqualWeightsCheckbox()
22
+ .click();
23
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
24
+ });
25
+
26
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsScoring('fill in the gaps - text')
27
+ });
28
+
29
+ describe('Question preview: Partial - equal weights with alternate answer and match from all responses - \"false\"', () => {
30
+ abortEarlySetup();
31
+ before(() => {
32
+ cy.log('Navigate to Fill in the gaps - text question type, adding correct answer responses and alternate answer responses, adding points and switch to preview tab');
33
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
34
+ fillInTheGapsTextPage.steps.addQuestionInstructions();
35
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
36
+ fillInTheGapsTextPage.steps.allotPoints('10');
37
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
38
+ fillInTheGapsTextPage.alternateAnswerButton()
39
+ .click();
40
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 3', 'Response 4']);
41
+ fillInTheGapsTextPage.steps.allotPoints('6');
42
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
43
+ fillInTheGapsTextPage.partialEqualWeightsCheckbox()
44
+ .click();
45
+ fillInTheGapsTextPage.steps.expandAdditonalSettings();
46
+ fillInTheGapsTextPage.allowStudentsToCheckAnswerCheckbox()
47
+ .click();
48
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
49
+ });
50
+
51
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - text');
52
+ });
53
+
54
+ describe('Question preview: Partial - equal weights with alternate answer and match from all responses - \"true\"', () => {
55
+ abortEarlySetup();
56
+ before(() => {
57
+ cy.log('Navigate to Fill in the gaps - text question type, adding correct answer responses and alternate answer responses and points for both correct and alternate answer');
58
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
59
+ fillInTheGapsTextPage.steps.addQuestionInstructions();
60
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
61
+ fillInTheGapsTextPage.steps.allotPoints('10');
62
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
63
+ fillInTheGapsTextPage.alternateAnswerButton()
64
+ .click();
65
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 3', 'Response 4']);
66
+ fillInTheGapsTextPage.partialEqualWeightsCheckbox()
67
+ .click();
68
+ fillInTheGapsTextPage.steps.expandAdditonalSettings();
69
+ fillInTheGapsTextPage.allowStudentsToCheckAnswerCheckbox()
70
+ .click();
71
+ fillInTheGapsTextPage.matchFromAllResponsesCheckbox()
72
+ .click();
73
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
74
+ });
75
+
76
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - text');
77
+ });
78
+
79
+ describe('Partial Equal Weights: Round down score', () => {
80
+ abortEarlySetup();
81
+ before(() => {
82
+ cy.log('Add question instructions and options, set correct answers, select partial - equal weights scoring and add points (in decimals) for correct answer options');
83
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
84
+ fillInTheGapsTextPage.steps.addQuestionInstructions();
85
+ fillInTheGapsTextPage.partialEqualWeightsCheckbox()
86
+ .click();
87
+ fillInTheGapsTextPage.steps.setCorrectAnswerResponses(['Response 1', 'Response 2']);
88
+ fillInTheGapsTextPage.pointsInputField()
89
+ .type('8.5');
90
+ fillInTheGapsTextPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
91
+ });
92
+
93
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsRoundDownScore('fill in the gaps - text');
94
+ });
95
+ });
@@ -0,0 +1,70 @@
1
+ import { fillInTheGapsTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create Item page - fill in the gaps - text: Question Insructions, Question , Set Correct Answer, Alternate Correct Answer', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Set Correct Answer section', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
14
+ });
15
+
16
+ fillInTheGapsTextPage.tests.verifyAutoScoredSetCorrectAnswerHeaderSectionContents('fill in the gaps - text');
17
+
18
+ fillInTheGapsTextPage.tests.verifySetCorrectAnswerTabContentsAndFunctionality('Correct tab');
19
+ });
20
+
21
+ describe('Correct response conditions section', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
25
+ });
26
+
27
+ it('CSS of correct response conditions section', { tags: 'css' }, () => {
28
+ const labels = [fillInTheGapsTextPage.caseSensitiveLabel, fillInTheGapsTextPage.ignoreSpacesBeforeAndAfterLabel, fillInTheGapsTextPage.matchFromAllResponsesLabel]
29
+ const uncheckedCheckboxes = [fillInTheGapsTextPage.caseSensitiveCheckbox, fillInTheGapsTextPage.matchFromAllResponsesCheckbox]
30
+ labels.forEach((checkinglabel) => {
31
+ checkinglabel()
32
+ .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
33
+ });
34
+ uncheckedCheckboxes.forEach((uncheckedCheckbox) => {
35
+ uncheckedCheckbox()
36
+ .parent()
37
+ .find('svg')
38
+ .should('have.css', 'fill', css.color.uncheckedCheckbox);
39
+ });
40
+ fillInTheGapsTextPage.ignoreSpacesBeforeAndAfterCheckbox()
41
+ .parent()
42
+ .find('g[data-name*="Rectangle"]')
43
+ .should('have.css', 'fill', css.color.activeButtons);
44
+ });
45
+
46
+ it('\'Case sensitive\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
47
+ fillInTheGapsTextPage.caseSensitiveLabel()
48
+ .verifyInnerText('Case sensitive')
49
+ .and('be.visible');
50
+ fillInTheGapsTextPage.caseSensitiveCheckbox()
51
+ .should('not.be.checked');
52
+ });
53
+
54
+ it('\'Ignore spaces before and after\' functionality label and checkbox should be displayed and by default it should be checked', () => {
55
+ fillInTheGapsTextPage.ignoreSpacesBeforeAndAfterLabel()
56
+ .verifyInnerText('Ignore spaces before and after');
57
+ fillInTheGapsTextPage.ignoreSpacesBeforeAndAfterCheckbox()
58
+ .should('be.checked');
59
+ });
60
+
61
+ it('\'Match from all responses\' functionality label and checkbox should be displayed and by default it should be unchecked and disabled', () => {
62
+ fillInTheGapsTextPage.matchFromAllResponsesLabel()
63
+ .verifyInnerText('Match from all responses')
64
+ .should('have.class', 'Mui-disabled');
65
+ fillInTheGapsTextPage.matchFromAllResponsesCheckbox()
66
+ .should('not.be.checked')
67
+ .and('be.disabled');
68
+ });
69
+ });
70
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {