itemengine-cypress-automation 1.0.27 → 1.0.28
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettings.js +1164 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAutoScoredScoring.js +104 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownEditTabBasicSection.js +591 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownEditTabScoringSection.js +131 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownHeaderSection.js +126 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownManuallyAndNonScoredScoring.js +57 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeights.js +119 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownRandomizeOptions.js +86 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownScoringPartialDifferentWeights.js +122 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownSetCorrectAnswerSection.js +170 -0
- package/package.json +1 -1
@@ -0,0 +1,170 @@
|
|
1
|
+
import { fillInTheGapsDropdownPage } from "../../../pages/fillInTheGapsDropdownPage";
|
2
|
+
import { fillInTheGapsSetCorrectAnswerSection } from "../../../pages/fillInTheGapsSetCorrectAnswerSection";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
const optionsForResponse1 = ['changing', 'progressively', 'healthy', 'new'];
|
7
|
+
const optionsForResponse2 = ['increasingly', 'decreasingly', 'extensively', 'exclusively'];
|
8
|
+
|
9
|
+
describe('Create Item page - fill in the gaps - dropdown: Set correct answer, Randomize options and Match from all responses - Edit tab cases, Alternate correct answer', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Set Correct Answer section', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
18
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1)
|
19
|
+
});
|
20
|
+
|
21
|
+
fillInTheGapsDropdownPage.tests.verifyAutoScoredSetCorrectAnswerHeaderSectionContents('fill in the gaps - dropdown');
|
22
|
+
|
23
|
+
fillInTheGapsDropdownPage.tests.verifySetCorrectAnswerTabContentsAndFunctionality('Correct tab');
|
24
|
+
});
|
25
|
+
|
26
|
+
describe('\'Randomize options\' and \'Match from all responses\' - Edit tab', () => {
|
27
|
+
abortEarlySetup();
|
28
|
+
before(() => {
|
29
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
30
|
+
cy.barsPreLoaderWait();
|
31
|
+
});
|
32
|
+
|
33
|
+
it('CSS of \'Randomize options\' and \'Match from all responses\' labels and checkboxes', { tags: 'css' }, () => {
|
34
|
+
const labels = [fillInTheGapsDropdownPage.randomizeOptionsLabel, fillInTheGapsDropdownPage.matchFromAllResponsesLabel];
|
35
|
+
const uncheckedCheckboxes = [fillInTheGapsDropdownPage.randomizeOptionsCheckbox, fillInTheGapsDropdownPage.matchFromAllResponsesCheckbox];
|
36
|
+
labels.forEach((checkinglabel) => {
|
37
|
+
checkinglabel()
|
38
|
+
.verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
|
39
|
+
});
|
40
|
+
uncheckedCheckboxes.forEach((uncheckedCheckbox) => {
|
41
|
+
uncheckedCheckbox()
|
42
|
+
.parent()
|
43
|
+
.find('svg')
|
44
|
+
.should('have.css', 'fill', css.color.uncheckedCheckbox);
|
45
|
+
});
|
46
|
+
});
|
47
|
+
|
48
|
+
it('\'Randomize options\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
|
49
|
+
fillInTheGapsDropdownPage.randomizeOptionsCheckbox()
|
50
|
+
.should('not.be.checked');
|
51
|
+
fillInTheGapsDropdownPage.randomizeOptionsLabel()
|
52
|
+
.verifyInnerText('Randomize options');
|
53
|
+
});
|
54
|
+
|
55
|
+
it('\'Match from all responses\' functionality label and checkbox should be displayed and by default it should be unchecked and disabled', () => {
|
56
|
+
fillInTheGapsDropdownPage.matchFromAllResponsesLabel()
|
57
|
+
.verifyInnerText('Match from all responses')
|
58
|
+
.should('have.class', 'Mui-disabled');
|
59
|
+
fillInTheGapsDropdownPage.matchFromAllResponsesCheckbox()
|
60
|
+
.should('not.be.checked')
|
61
|
+
.and('be.disabled');
|
62
|
+
});
|
63
|
+
});
|
64
|
+
|
65
|
+
describe('Match from all responses - Edit tab cases for \'All or Nothing\' scoring type', () => {
|
66
|
+
abortEarlySetup();
|
67
|
+
before(() => {
|
68
|
+
cy.log('Adding correct answer responses and alloting points');
|
69
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
70
|
+
cy.barsPreLoaderWait();
|
71
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
72
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
73
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
74
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new');
|
75
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'extensively');
|
76
|
+
fillInTheGapsDropdownPage.steps.allotPoints(7);
|
77
|
+
});
|
78
|
+
|
79
|
+
fillInTheGapsSetCorrectAnswerSection.tests.verifyPointsInEditTabForAutoScoredAllOrNothingWhenMatchFromAllResponsesIsTrue('fill in the gaps - dropdown');
|
80
|
+
});
|
81
|
+
|
82
|
+
describe('Match from all responses - Edit tab cases for \'Partial - equal weights\' scoring type', () => {
|
83
|
+
abortEarlySetup();
|
84
|
+
before(() => {
|
85
|
+
cy.log('Adding correct answer responses and alloting points');
|
86
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
87
|
+
cy.barsPreLoaderWait();
|
88
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
89
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
90
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
91
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new');
|
92
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'extensively');
|
93
|
+
fillInTheGapsDropdownPage.steps.allotPoints(7);
|
94
|
+
fillInTheGapsDropdownPage.partialEqualWeightsCheckbox()
|
95
|
+
.click();
|
96
|
+
});
|
97
|
+
|
98
|
+
fillInTheGapsSetCorrectAnswerSection.tests.verifyPointsInEditTabForAutoScoredPartialEqualWeightsWhenMatchFromAllResponsesIsTrue('fill in the gaps - dropdown');
|
99
|
+
});
|
100
|
+
|
101
|
+
describe('Match from all responses - Edit tab cases for \'Partial - different weights\' scoring type', () => {
|
102
|
+
abortEarlySetup();
|
103
|
+
before(() => {
|
104
|
+
cy.log('Adding correct answer responses and alloting points');
|
105
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
106
|
+
cy.barsPreLoaderWait();
|
107
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
108
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
109
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
110
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new');
|
111
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'extensively');
|
112
|
+
fillInTheGapsDropdownPage.partialDifferentWeightsCheckbox()
|
113
|
+
.click();
|
114
|
+
fillInTheGapsDropdownPage.steps.addPartialDifferentWeightsPoints([1, 7]);
|
115
|
+
});
|
116
|
+
|
117
|
+
fillInTheGapsSetCorrectAnswerSection.tests.verifyPointsInEditTabForAutoScoredPartialDifferentWeightsWhenMatchFromAllResponsesIsTrue('fill in the gaps - dropdown');
|
118
|
+
});
|
119
|
+
|
120
|
+
describe('Alternate correct answer', () => {
|
121
|
+
abortEarlySetup();
|
122
|
+
before(() => {
|
123
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
124
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
125
|
+
});
|
126
|
+
|
127
|
+
fillInTheGapsDropdownPage.tests.verifyAutoScoredAlternateAnswer();
|
128
|
+
|
129
|
+
it('When user has added points and set correct answer option in the \'Correct\' tab dropdown, 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', () => {
|
130
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'progressively');
|
131
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
132
|
+
fillInTheGapsDropdownPage.alternateAnswerButton()
|
133
|
+
.click();
|
134
|
+
fillInTheGapsDropdownPage.matchFromAllResponsesLabel()
|
135
|
+
.should('not.have.class', 'Mui-disabled');
|
136
|
+
fillInTheGapsDropdownPage.matchFromAllResponsesCheckbox()
|
137
|
+
.should('not.be.checked')
|
138
|
+
.and('not.be.disabled');
|
139
|
+
});
|
140
|
+
|
141
|
+
it('Accessibility of \'Alternate\' correct answer tab', { tags: 'a11y' }, () => {
|
142
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.correctTab().parents('[class*="AlternatePointsComponentstyles__AnswerTabWrapper"]'));
|
143
|
+
});
|
144
|
+
|
145
|
+
fillInTheGapsDropdownPage.tests.verifySetCorrectAnswerTabContentsAndFunctionality('Alternate tab');
|
146
|
+
|
147
|
+
it('When the user adds another alternate answer for the question using \'Add Alternate Answer\' button, then the name for this new tab should be \'Alternate 2\'', () => {
|
148
|
+
fillInTheGapsDropdownPage.steps.addAlternateTab(2);
|
149
|
+
});
|
150
|
+
|
151
|
+
fillInTheGapsDropdownPage.tests.verifyWarningPopupAndTabNavigationWhenNoPointsAddedInAlternateTab();
|
152
|
+
|
153
|
+
it('When the user clicks on the \'Close\' button alongside alternate answer tab, alternate answer tab should get removed and the name of the alternate answer tabs should get updated accordingly', () => {
|
154
|
+
cy.log('Set correct answer and points in alternate 2 tab, then switch to Alternate 1 tab and click delete icon button');
|
155
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'healthy');
|
156
|
+
fillInTheGapsDropdownPage.steps.allotPoints(2);
|
157
|
+
fillInTheGapsDropdownPage.alternateAnswerTab(1)
|
158
|
+
.click();
|
159
|
+
fillInTheGapsDropdownPage.deleteAlternateTabButton()
|
160
|
+
.click();
|
161
|
+
fillInTheGapsDropdownPage.alternateAnswerTab(2)
|
162
|
+
.should('not.exist');
|
163
|
+
fillInTheGapsDropdownPage.alternateAnswerTab(1)
|
164
|
+
.verifyInnerText('Alternate 1');
|
165
|
+
});
|
166
|
+
|
167
|
+
fillInTheGapsDropdownPage.tests.verifyMatchFromAllResponsesGetsDisabledWhenAlternateTabsAreDeleted();
|
168
|
+
});
|
169
|
+
});
|
170
|
+
|