itemengine-cypress-automation 1.0.79 → 1.0.80
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +172 -0
- package/cypress/fixtures/evaluationMethodsAndCustomSettings.js +83 -0
- package/cypress/fixtures/theme/ilc.json +21 -2
- package/cypress/support/helpers/accessibility.js +2 -2
- package/cypress/support/helpers/utilities.js +54 -0
- package/package.json +3 -3
@@ -0,0 +1,172 @@
|
|
1
|
+
export const drawingToolbarOptionsAndAdditionalOptions = {
|
2
|
+
drawingToolbarOptions: [
|
3
|
+
{
|
4
|
+
displayName: 'Select',
|
5
|
+
tooltipText: 'SelectSelect, move, rotate and re-size',
|
6
|
+
toolType: 'tool'
|
7
|
+
},
|
8
|
+
{
|
9
|
+
displayName: 'Scribble',
|
10
|
+
additionalOptions: [' strokefontcolor', ' strokefontcolorpicker'],
|
11
|
+
secondaryToolbarOptions: ['Stroke color', 'Stroke thickness', 'Opacity'],
|
12
|
+
tooltipText: 'PencilDraw freehand lines',
|
13
|
+
toolType: 'tool'
|
14
|
+
},
|
15
|
+
{
|
16
|
+
displayName: 'Line',
|
17
|
+
additionalOptions: [' strokefontcolor', ' strokefontcolorpicker'],
|
18
|
+
secondaryToolbarOptions: ['Stroke color', 'Stroke thickness', 'Line type', 'Opacity'],
|
19
|
+
tooltipText: 'LineDraw a straight line',
|
20
|
+
toolType: 'tool'
|
21
|
+
},
|
22
|
+
{
|
23
|
+
displayName: 'Curved line',
|
24
|
+
additionalOptions: [' strokefontcolor', ' strokefontcolorpicker'],
|
25
|
+
secondaryToolbarOptions: ['Stroke color', 'Stroke thickness', 'Line type', 'Opacity'],
|
26
|
+
tooltipText: 'Curved LineDraw a curved line',
|
27
|
+
toolType: 'tool'
|
28
|
+
},
|
29
|
+
{
|
30
|
+
displayName: 'Capture image',
|
31
|
+
tooltipText: "Take a photoUse your device's camera to take a photo and add it to the canvas",
|
32
|
+
toolType: 'dialog'
|
33
|
+
},
|
34
|
+
{
|
35
|
+
displayName: 'Insert image',
|
36
|
+
tooltipText: 'Upload an imageUpload an image from your device',
|
37
|
+
toolType: 'dialog'
|
38
|
+
},
|
39
|
+
{
|
40
|
+
displayName: 'Text',
|
41
|
+
additionalOptions: [' specialchar', ' mathchar', ' fontsize', ' strokefontcolor', ' strokefontcolorpicker'],
|
42
|
+
secondaryToolbarOptions: ['Special characters', 'Math characters', 'Font Size', 'Text color', 'Opacity'],
|
43
|
+
tooltipText: 'TextAdd text',
|
44
|
+
toolType: 'tool'
|
45
|
+
},
|
46
|
+
{
|
47
|
+
displayName: 'Point eraser',
|
48
|
+
secondaryToolbarOptions: ['Eraser thickness'],
|
49
|
+
tooltipText: 'Point EraserErase the element by pixel',
|
50
|
+
toolType: 'tool'
|
51
|
+
},
|
52
|
+
{
|
53
|
+
displayName: 'Item eraser',
|
54
|
+
tooltipText: 'Item EraserErase the entire element',
|
55
|
+
toolType: 'tool'
|
56
|
+
},
|
57
|
+
{
|
58
|
+
displayName: 'Rectangle',
|
59
|
+
additionalOptions: [' strokefontcolor', ' strokefontcolorpicker', ' fillcolor', ' fillcolorpicker'],
|
60
|
+
secondaryToolbarOptions: ['Fill color', 'Stroke color', 'Stroke thickness', 'Opacity'],
|
61
|
+
tooltipText: 'RectangleDraw a rectangle',
|
62
|
+
toolType: 'tool'
|
63
|
+
},
|
64
|
+
{
|
65
|
+
displayName: 'Ellipse',
|
66
|
+
additionalOptions: [' strokefontcolor', ' strokefontcolorpicker', ' fillcolor', ' fillcolorpicker'],
|
67
|
+
secondaryToolbarOptions: ['Fill color', 'Stroke color', 'Stroke thickness', 'Opacity'],
|
68
|
+
tooltipText: 'EllipseDraw an ellipse',
|
69
|
+
toolType: 'tool'
|
70
|
+
},
|
71
|
+
{
|
72
|
+
displayName: 'Polygon',
|
73
|
+
additionalOptions: [' strokefontcolor', ' strokefontcolorpicker', ' fillcolor', ' fillcolorpicker'],
|
74
|
+
secondaryToolbarOptions: ['Fill color', 'Stroke color', 'Stroke thickness', 'Opacity'],
|
75
|
+
tooltipText: 'PolygonDraw polygon',
|
76
|
+
toolType: 'tool'
|
77
|
+
},
|
78
|
+
{
|
79
|
+
displayName: 'Compass',
|
80
|
+
additionalOptions: [' strokefontcolor', ' strokefontcolorpicker', ' fillcolor', ' fillcolorpicker'],
|
81
|
+
secondaryToolbarOptions: ['Stroke color', 'Stroke thickness', 'Opacity'],
|
82
|
+
tooltipText: 'CompassDraw compass',
|
83
|
+
toolType: 'tool'
|
84
|
+
},
|
85
|
+
{
|
86
|
+
displayName: 'Bring forward',
|
87
|
+
tooltipText: 'Bring forwardBring selected item forward a layer',
|
88
|
+
toolType: 'action'
|
89
|
+
},
|
90
|
+
{
|
91
|
+
displayName: 'Bring backward',
|
92
|
+
tooltipText: 'Bring backwardSend selected item back a layer',
|
93
|
+
toolType: 'action'
|
94
|
+
},
|
95
|
+
{
|
96
|
+
displayName: 'Duplicate',
|
97
|
+
tooltipText: 'DuplicateMake a copy of the selection',
|
98
|
+
toolType: 'action'
|
99
|
+
},
|
100
|
+
{
|
101
|
+
displayName: 'Undo',
|
102
|
+
tooltipText: 'UndoUndo last action',
|
103
|
+
toolType: 'action'
|
104
|
+
},
|
105
|
+
{
|
106
|
+
displayName: 'Redo',
|
107
|
+
tooltipText: 'RedoRedo last action',
|
108
|
+
toolType: 'action'
|
109
|
+
},
|
110
|
+
{
|
111
|
+
displayName: 'Full Screen',
|
112
|
+
tooltipText: 'Full ScreenView the canvas using your whole screen',
|
113
|
+
toolType: 'dialog'
|
114
|
+
},
|
115
|
+
{
|
116
|
+
displayName: 'Clear All',
|
117
|
+
tooltipText: 'Clear AllClear entire canvas',
|
118
|
+
toolType: 'dialog'
|
119
|
+
}
|
120
|
+
],
|
121
|
+
|
122
|
+
additionalOptions: [' specialchar', ' mathchar', ' fontsize', ' strokefontcolor', ' strokefontcolorpicker', ' fillcolor', ' fillcolorpicker'],
|
123
|
+
|
124
|
+
additionalOptionsTooltip: ['Special characters', 'Math characters', 'Font size', 'Stroke font color', 'Stroke font color picker', 'Fill color', 'Fill color picker']
|
125
|
+
}
|
126
|
+
|
127
|
+
export const specialCharacters = [
|
128
|
+
{
|
129
|
+
categoryName: 'Spanish'
|
130
|
+
},
|
131
|
+
{
|
132
|
+
categoryName: 'French'
|
133
|
+
},
|
134
|
+
{
|
135
|
+
categoryName: 'German'
|
136
|
+
},
|
137
|
+
{
|
138
|
+
categoryName: 'Portuguese'
|
139
|
+
},
|
140
|
+
{
|
141
|
+
categoryName: 'Scandinavian'
|
142
|
+
},
|
143
|
+
{
|
144
|
+
categoryName: 'Italian'
|
145
|
+
},
|
146
|
+
{
|
147
|
+
categoryName: 'Icelandic'
|
148
|
+
}
|
149
|
+
]
|
150
|
+
|
151
|
+
export const mathCharacters = [
|
152
|
+
{
|
153
|
+
categoryName: 'Mathematical symbols',
|
154
|
+
symbols: ['SquareRoot', 'CubeRoot', 'Infinity', 'PlusMinus', 'Integral', 'Triangle', 'GreaterThan', 'LessThan', 'NotEqual', 'Approximate']
|
155
|
+
},
|
156
|
+
{
|
157
|
+
categoryName: 'Notation and set theory',
|
158
|
+
symbols: ['StandardDeviation', 'Eta', 'Summation', 'Pi', 'Union', 'Intersection', 'ProperSet', 'SubSet']
|
159
|
+
},
|
160
|
+
{
|
161
|
+
categoryName: 'Comparison and units',
|
162
|
+
symbols: ['Equivalence', 'Estimates', 'Approximation', 'Mu', 'MicroMeter', 'Degree', 'DegreeCelsius']
|
163
|
+
},
|
164
|
+
{
|
165
|
+
categoryName: 'Fraction values',
|
166
|
+
symbols: ['OneNine', 'OneTen', 'OneSix', 'OneFive', 'OneFour', 'OneThree', 'TwoFive', 'TwoThree', 'FiveEight', 'OneTwo', 'ThreeFive', 'ThreeFour', 'FourFive', 'FiveSix']
|
167
|
+
},
|
168
|
+
{
|
169
|
+
categoryName: 'Superscript and subscript',
|
170
|
+
symbols: ['Plus', 'Minus', 'Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Plus', 'Minus', 'Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine']
|
171
|
+
}
|
172
|
+
]
|
@@ -0,0 +1,83 @@
|
|
1
|
+
export const evaluationMethods = [
|
2
|
+
{
|
3
|
+
name: 'Symbols are equivalent',
|
4
|
+
description: 'Response inputted needs to be equivalent to be marked correct',
|
5
|
+
answerInputField: 'true',
|
6
|
+
customSettings: ['Case sensitive', 'Accept interval notation', 'Exclude LaTeX text from validation', 'Check for equality across sides', 'Interpret alphabets as variables', 'Interpret e as Euler\'s number', 'Interpret i as imaginary', 'Decimal separator', 'Thousands separator', 'Decimal places to be compared'],
|
7
|
+
},
|
8
|
+
{
|
9
|
+
name: 'Value is equivalent',
|
10
|
+
description: 'Response inputted needs to be equivalent but can be represented differently to be marked correct',
|
11
|
+
answerInputField: 'true',
|
12
|
+
customSettings: ['Case sensitive', 'Exclude LaTeX text from validation', 'Check for equality across sides', 'Decimal separator', 'Thousands separator', 'Decimal places to be compared', 'Tolerance']
|
13
|
+
},
|
14
|
+
{
|
15
|
+
name: 'Match value',
|
16
|
+
description: 'Response inputted needs to be equal and represented the same way to be marked correct',
|
17
|
+
answerInputField: 'true',
|
18
|
+
customSettings: ['Case sensitive', 'Accept interval notation', 'Accept expressions in any order', 'Exclude from possible correct answers', 'Ignore zeros after decimal', 'Ignore unit coefficient', 'Check for parenthesis grouping', 'Decimal separator', 'Thousands separator']
|
19
|
+
},
|
20
|
+
{
|
21
|
+
name: 'Equivalent structure',
|
22
|
+
description: 'Response inputted needs to be in set structure / format to be marked correct',
|
23
|
+
answerInputField: 'false',
|
24
|
+
customSettings: ['Case sensitive', 'Syntax']
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: 'Response is true',
|
28
|
+
description: 'Response inputted needs to be a true equation / inequality to be marked correct',
|
29
|
+
answerInputField: 'true',
|
30
|
+
customSettings: ['Case sensitive', 'Decimal separator', 'Thousands separator', 'Decimal places to be compared']
|
31
|
+
},
|
32
|
+
{
|
33
|
+
name: 'Expanded form',
|
34
|
+
description: 'Response inputted needs to be in expanded form to be marked correct',
|
35
|
+
answerInputField: 'false',
|
36
|
+
customSettings: ['Case sensitive', 'Decimal separator', 'Thousands separator']
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: 'Factored form',
|
40
|
+
description: 'Response inputted needs to be in factored form to be marked correct',
|
41
|
+
answerInputField: 'false',
|
42
|
+
customSettings: ['Case sensitive', 'Decimal separator', 'Thousands separator', 'Type of expression']
|
43
|
+
},
|
44
|
+
{
|
45
|
+
name: 'Simplified version',
|
46
|
+
description: 'Response inputted needs to be in simplified form to be marked correct',
|
47
|
+
answerInputField: 'false',
|
48
|
+
customSettings: ['Case sensitive', 'Decimal separator', 'Thousands separator']
|
49
|
+
},
|
50
|
+
{
|
51
|
+
name: 'Match exact',
|
52
|
+
description: 'Response entered needs to be an exact match to be marked correct',
|
53
|
+
answerInputField: 'true',
|
54
|
+
customSettings: ['Case sensitive', 'Ignore spaces before and after', 'Ignore extra spaces'],
|
55
|
+
}
|
56
|
+
]
|
57
|
+
|
58
|
+
export const syntaxDropdown = ['Number', 'Integer', 'Decimal', 'Scientific', 'Variable', 'Fraction', 'Mixed fraction', 'Simple fraction', 'Fraction or decimal', 'Expression', 'Equation']
|
59
|
+
|
60
|
+
export const typeOfExpression = ['Integer', 'Real', 'Complex']
|
61
|
+
|
62
|
+
export const decimalSeparator = ['Dot', 'Comma']
|
63
|
+
|
64
|
+
export const thousandsSeparatorForDotDecimalSeparator = ['None', 'Comma or space', 'Comma', 'Space']
|
65
|
+
|
66
|
+
export const thousandsSeparatorForCommaDecimalSeparator = ['None', 'Dot or space', 'Dot', 'Space']
|
67
|
+
|
68
|
+
export const customSettingsIds = {
|
69
|
+
caseSensitive: 'case-sensitive-checkbox',
|
70
|
+
acceptIntervalNotation: 'accept-interval-notation-checkbox',
|
71
|
+
excludeLatexTextFromValidation: 'exclude-latex-text-from-validation-checkbox',
|
72
|
+
checkForEqualityAcrossSides: 'check-for-equality-across-sides-checkbox',
|
73
|
+
interpretAlphabetsAsVariables: 'interpret-alphabets-as-variables-checkbox',
|
74
|
+
interpretEAsEulerNumber: 'interpret-e-as-euler\'s-number-checkbox',
|
75
|
+
interpretIAsImaginary: 'interpret-i-as-imaginary-checkbox',
|
76
|
+
acceptExpressionsInAnyOrder: 'accept-expressions-in-any-order-checkbox',
|
77
|
+
excludeFromPossibleCorrectAnswers: 'exclude-from-possible-correct-answers-checkbox',
|
78
|
+
ignoreZerosAfterDecimal: 'ignore-zeros-after-decimal-checkbox',
|
79
|
+
ignoreUnitCoefficient: 'ignore-unit-coefficient-checkbox',
|
80
|
+
checkForParenthesisGrouping: 'check-for-parenthesis-groups-checkbox',
|
81
|
+
ignoreSpacesBeforeAndAfter: 'ignore-spaces-before-and-after-checkbox',
|
82
|
+
ignoreExtraSpaces: 'ignore-extra-spaces-checkbox',
|
83
|
+
}
|
@@ -74,7 +74,7 @@
|
|
74
74
|
"titleContainerBorder": "rgb(107, 139, 255)",
|
75
75
|
"optionNumerationBg": "rgb(214, 224, 255)",
|
76
76
|
"panelLabel": "rgb(0, 0, 124)",
|
77
|
-
"
|
77
|
+
"correctOptionBorder": "rgb(107, 139, 255)",
|
78
78
|
"feedbackStar": "rgb(226, 121, 0)",
|
79
79
|
"clickTapAnywhereAreaBg": "rgb(102, 102, 102)",
|
80
80
|
"recordingIcon": "rgb(209, 51, 51)",
|
@@ -85,7 +85,26 @@
|
|
85
85
|
"fileUploadProgressBarFill": "rgb(74, 147, 224)",
|
86
86
|
"responseContainerPointer": "rgba(0, 0, 46, 0.4)",
|
87
87
|
"activeHighlightBorder": "rgb(41, 0, 128)",
|
88
|
-
"hoverHighlightBorder": "rgb(66, 0, 204)"
|
88
|
+
"hoverHighlightBorder": "rgb(66, 0, 204)",
|
89
|
+
"selectToolbarOptionBg": "rgb(186, 201, 255)",
|
90
|
+
"defaultToolbarOptionBg": "rgb(245, 247, 254)",
|
91
|
+
"toolBarOptionTooltipBackground": "rgba(34, 34, 34, 0.9)",
|
92
|
+
"correctAnswerLabelBg": "rgb(199, 238, 210)",
|
93
|
+
"incorrectAnswerLabelBg": "rgb(255, 244, 241)",
|
94
|
+
"matrixHeadingCellBg": "rgb(214, 223, 255)",
|
95
|
+
"matrixSubheadingCellBg": "rgb(238, 241, 251)",
|
96
|
+
"matrixCellBorder": "rgb(82, 0, 255)",
|
97
|
+
"draggableOptionsContainerBg": "rgb(238, 241, 251)",
|
98
|
+
"draggableOptionsContainerBorder": "rgb(186, 201, 255)",
|
99
|
+
"draggableOptionBorder": "rgb(107, 139, 255)",
|
100
|
+
"matrixDropzoneCellBg": "rgb(245, 248, 255)",
|
101
|
+
"dropzoneCellIcon": "rgb(186, 201, 255)",
|
102
|
+
"noneCellIcon": "rgb(0, 0, 124)",
|
103
|
+
"unSelectedEvaluationMethodTitle": "rgb(82, 0, 255)",
|
104
|
+
"evaluationMethodContainerBorder": "rgb(186, 201, 255)",
|
105
|
+
"selectedEvaluationMethodContainerBg": "rgb(0, 0, 124)",
|
106
|
+
"customSettingsCheckboxLabel": "rgb(34, 34, 76)",
|
107
|
+
"separatorsUnselectedOption": "rgb(68, 68, 97)"
|
89
108
|
},
|
90
109
|
"fontSize": {
|
91
110
|
"extraSmall": "10px",
|
@@ -20,10 +20,10 @@ function checkAccessibility(cySelector = null) {
|
|
20
20
|
cy.injectAxe()
|
21
21
|
.then(() => {
|
22
22
|
if (cySelector === null) {
|
23
|
-
return cy.checkA11y(null, config);
|
23
|
+
return cy.checkA11y(null, config, terminalLog);
|
24
24
|
} else {
|
25
25
|
cySelector.then(($element) => {
|
26
|
-
return cy.checkA11y($element.selector, config);
|
26
|
+
return cy.checkA11y($element.selector, config, terminalLog);
|
27
27
|
});
|
28
28
|
};
|
29
29
|
});
|
@@ -126,6 +126,60 @@ const utilities = {
|
|
126
126
|
base64Encoding: (str) => {
|
127
127
|
const base64 = btoa(str);
|
128
128
|
return encodeURIComponent(base64).replace(/([!*'();:@&=+$,/?#[]~])/g, match => `%${match.charCodeAt(0).toString(16).toUpperCase()}`);
|
129
|
+
},
|
130
|
+
|
131
|
+
/**
|
132
|
+
* @description verifies disabled state of an element
|
133
|
+
* @param {*} selector cy.get selector
|
134
|
+
*/
|
135
|
+
verifyElementDisabled: (selector) => {
|
136
|
+
selector.should('be.disabled');
|
137
|
+
},
|
138
|
+
|
139
|
+
/**
|
140
|
+
* @description verifies disabled state of an element
|
141
|
+
* @param {*} selector cy.get selector
|
142
|
+
*/
|
143
|
+
verifyElementDisabledClass: (selector) => {
|
144
|
+
selector.should(($form) => {
|
145
|
+
const classes = $form.attr('class');
|
146
|
+
expect(classes).to.include('disabled');
|
147
|
+
});
|
148
|
+
},
|
149
|
+
|
150
|
+
/**
|
151
|
+
* @description verifies that element is not disabled
|
152
|
+
* @param {*} selector cy.get selector
|
153
|
+
*/
|
154
|
+
verifyElementNotDisabled: (selector) => {
|
155
|
+
selector.should(($form) => {
|
156
|
+
const classes = $form.attr('class');
|
157
|
+
expect(classes).to.not.include('disabled');
|
158
|
+
});
|
159
|
+
selector.should('not.be.disabled');
|
160
|
+
},
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Retrieves an array of views based on the provided filter or returns the default views.
|
164
|
+
* @param {Array<string>} [filterArray] - An optional array of view names to filter from the default views.
|
165
|
+
* @example
|
166
|
+
* const allViews = getViews(); // Retrieves all default views
|
167
|
+
* const filteredViews = getViews(['Item view', 'Student view']); // Retrieves only specific views
|
168
|
+
* @returns {Array<string>} - An array of view names.
|
169
|
+
*/
|
170
|
+
getViews: (filterArray) => {
|
171
|
+
const views = Cypress.env('views') ? Cypress.env('views') : ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view']
|
172
|
+
return (filterArray) ? filterArray.filter(view => views.includes(view)) : views
|
173
|
+
},
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Verifies that the input field with the specified selector has the expected value.
|
177
|
+
* @param {*} selector - The Cypress selector representing the input field.
|
178
|
+
* @param {string} value - The expected value to match with the input field.
|
179
|
+
* @returns {null} - Returns null as the verification is done through assertions.
|
180
|
+
*/
|
181
|
+
verifyInputFieldValue: (selector, value) => {
|
182
|
+
selector.should('have.value', value);
|
129
183
|
}
|
130
184
|
}
|
131
185
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.80",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"local": "node scripts/local.mjs --env fileConfig=ilqa,theme=ilc",
|
10
10
|
"spinnaker": "node scripts/spinnaker.mjs --env theme=ilc",
|
11
11
|
"local:untagged": "node scripts/local.mjs --env fileConfig=ilqa,theme=ilc,grepUntagged=true",
|
12
|
-
"spinnaker:untagged": "node scripts/spinnaker.mjs --env theme=ilc,grepUntagged=true",
|
12
|
+
"spinnaker:untagged": "node scripts/spinnaker.mjs --env theme=ilc,grepUntagged=true",
|
13
13
|
"cy:ildev": "cypress open --env fileConfig=ildev",
|
14
14
|
"cy:ilprod": "cypress open --env fileConfig=ilprod",
|
15
15
|
"cy:ilqa": "cypress open --env fileConfig=ilqa",
|
@@ -30,4 +30,4 @@
|
|
30
30
|
"cypress-real-events": "^1.7.6",
|
31
31
|
"react-uuid": "^2.0.0"
|
32
32
|
}
|
33
|
-
}
|
33
|
+
}
|