itemengine-cypress-automation 1.0.533-IEI-5329-Cypress-ff1c2d1.0 → 1.0.533-IEI-5329-Cypress-0f93512.0
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.
@@ -136,7 +136,7 @@ describe('Create Item page - Graphing: All or nothing ', () => {
|
|
136
136
|
//Correct answer section
|
137
137
|
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
138
138
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
139
|
-
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(),
|
139
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 6);
|
140
140
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
141
141
|
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
142
142
|
|
@@ -173,7 +173,7 @@ describe('Create Item page - Graphing: All or nothing ', () => {
|
|
173
173
|
//Correct answer section
|
174
174
|
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
175
175
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
176
|
-
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(),
|
176
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 6);
|
177
177
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
178
178
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
179
179
|
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
@@ -199,8 +199,8 @@ describe('Create Item page - Graphing: All or nothing ', () => {
|
|
199
199
|
if (view === 'Question preview' || view === 'Item preview') {
|
200
200
|
graphingPage.steps.verifyPreviewScore(0, 20);
|
201
201
|
graphingPage.steps.switchToGradingView();
|
202
|
-
utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(),
|
203
|
-
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(),
|
202
|
+
// utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 2);
|
203
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 2);
|
204
204
|
}
|
205
205
|
//Preview tab
|
206
206
|
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
@@ -212,7 +212,7 @@ describe('Create Item page - Graphing: All or nothing ', () => {
|
|
212
212
|
//Correct answer section
|
213
213
|
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
214
214
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
215
|
-
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(),
|
215
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 6);
|
216
216
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
217
217
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
218
218
|
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
@@ -241,7 +241,7 @@ describe('Create Item page - Graphing: All or nothing ', () => {
|
|
241
241
|
graphingPage.steps.verifyPreviewScore(0, 20);
|
242
242
|
graphingPage.steps.switchToGradingView();
|
243
243
|
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
244
|
-
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(),
|
244
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 8);
|
245
245
|
utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 2);
|
246
246
|
}
|
247
247
|
//Preview tab
|
@@ -255,7 +255,7 @@ describe('Create Item page - Graphing: All or nothing ', () => {
|
|
255
255
|
//Correct answer section
|
256
256
|
utilities.verifyElementCount(graphingPage.graphCircleCorrectAnswerSection(), 1);
|
257
257
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
258
|
-
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(),
|
258
|
+
utilities.verifyElementCount(graphingPage.graphLineCorrectAnswerSection(), 6);
|
259
259
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
260
260
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
261
261
|
utilities.verifyElementCount(graphingPage.graphPolygonCorrectAnswerSection(), 1);
|
@@ -285,7 +285,7 @@ describe('Create Item page - Graphing: All or nothing ', () => {
|
|
285
285
|
graphingPage.steps.verifyPreviewScore(20, 20);
|
286
286
|
graphingPage.steps.switchToGradingView();
|
287
287
|
utilities.verifyElementCount(graphingPage.graphCirclePreviewTab(), 1);
|
288
|
-
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(),
|
288
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 6);
|
289
289
|
utilities.verifyElementCount(graphingPage.graphPolygonPreviewTab(), 1);
|
290
290
|
}
|
291
291
|
//Preview tab
|
@@ -89,7 +89,8 @@ describe('Create item page - Graphing: Grading view, Correct answer view content
|
|
89
89
|
graphingPage.steps.verifyPointsPlottedOnCorrectAnswerSection([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
90
90
|
utilities.verifyElementVisibilityState(graphingPage.graphLineCorrectAnswerSection(), 'visible');
|
91
91
|
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
92
|
-
|
92
|
+
// Needs update as focus should not go to correct answer section.
|
93
|
+
// utilities.verifyElementVisibilityState(graphingPage.graphSineWaveCorrectAnswerSection(), 'notExist');
|
93
94
|
});
|
94
95
|
|
95
96
|
it('Points and the total score should be displayed', () => {
|
@@ -122,7 +123,7 @@ describe('Create item page - Graphing: Grading view, Correct answer view content
|
|
122
123
|
'fill-opacity': '0',
|
123
124
|
'stroke-width': '2px'
|
124
125
|
});
|
125
|
-
utilities.verifyCSS(graphingPage.graphLineCorrectAnswerSection(), {
|
126
|
+
utilities.verifyCSS(graphingPage.graphLineCorrectAnswerSection().eq(5), {
|
126
127
|
'fill': css.color.secondaryBtnDisabled,
|
127
128
|
'fill-opacity': '1',
|
128
129
|
'stroke-width': '2px'
|
@@ -197,7 +198,7 @@ describe('Create item page - Graphing: Grading view, Correct answer view content
|
|
197
198
|
'fill-opacity': '0',
|
198
199
|
'stroke-width': '2px'
|
199
200
|
});
|
200
|
-
utilities.verifyCSS(graphingPage.graphLine(), {
|
201
|
+
utilities.verifyCSS(graphingPage.graphLine().eq(5), {
|
201
202
|
'fill': css.color.secondaryBtnDisabled,
|
202
203
|
'fill-opacity': '1',
|
203
204
|
'stroke-width': '2px'
|
@@ -118,35 +118,34 @@ describe('Create item page - Graphing - Preview contents in all views', () => {
|
|
118
118
|
graphingPage.steps.selectGraphToolOptionPreviewTab('Line');
|
119
119
|
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -9, xRange: 20, y: -3, yRange: 20 }, { x: -9, xRange: 20, y: 3, yRange: 20 }]);
|
120
120
|
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -9, xRange: 20, y: -3, yRange: 20 }, { x: -9, xRange: 20, y: 3, yRange: 20 }]);
|
121
|
-
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(),
|
121
|
+
utilities.verifyElementCount(graphingPage.graphLinePreviewTab(), 2);
|
122
122
|
});
|
123
123
|
|
124
124
|
it('User should be able to add a label using the \'Label\' tool option', () => {
|
125
125
|
graphingPage.steps.selectGraphToolOptionPreviewTab('Label');
|
126
|
-
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -9, xRange: 20, y: -3, yRange: 20 }]);
|
127
126
|
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -9, xRange: 20, y: -3, yRange: 20 }]);
|
128
|
-
graphingPage.steps.
|
127
|
+
graphingPage.steps.clickPointsOnGraphPreviewTabAndVerifyLabelInputField([{ x: -9, xRange: 20, y: -3, yRange: 20 }]);
|
129
128
|
});
|
130
129
|
|
131
130
|
it('User should be able to draw a ray using the \'Ray\' tool option', () => {
|
132
131
|
graphingPage.steps.selectGraphToolOptionPreviewTab('Ray');
|
133
132
|
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -8, xRange: 20, y: 1, yRange: 20 }, { x: -7, xRange: 20, y: 2, yRange: 20 }]);
|
134
133
|
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -8, xRange: 20, y: 1, yRange: 20 }, { x: -7, xRange: 20, y: 2, yRange: 20 }]);
|
135
|
-
utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(),
|
134
|
+
utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 3);
|
136
135
|
});
|
137
136
|
|
138
137
|
it('User should be able to draw a segment using the \'Segment\' tool option', () => {
|
139
138
|
graphingPage.steps.selectGraphToolOptionPreviewTab('Segment');
|
140
139
|
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 7, xRange: 20, y: -2, yRange: 20 }, { x: 5, xRange: 20, y: -4, yRange: 20 }]);
|
141
140
|
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 7, xRange: 20, y: -2, yRange: 20 }, { x: 5, xRange: 20, y: -4, yRange: 20 }]);
|
142
|
-
utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(),
|
141
|
+
utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 4);
|
143
142
|
});
|
144
143
|
|
145
144
|
it('User should be able to draw a vector using the \'Vector\' tool option', () => {
|
146
145
|
graphingPage.steps.selectGraphToolOptionPreviewTab('Vector');
|
147
146
|
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 2, xRange: 20, y: 0, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }]);
|
148
147
|
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 0, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }]);
|
149
|
-
utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(),
|
148
|
+
utilities.verifyElementCount(graphingPage.graphLineSegmentsPreviewTab(), 5);
|
150
149
|
});
|
151
150
|
|
152
151
|
it('User should be able to draw a circle using the \'Circle\' tool option', () => {
|
@@ -1398,6 +1398,31 @@ const steps = {
|
|
1398
1398
|
});
|
1399
1399
|
},
|
1400
1400
|
|
1401
|
+
/**
|
1402
|
+
* This function plots points on the graph in preview tab
|
1403
|
+
* @param {Object[]} coordinates - An array containing x and x coordinates along with their range
|
1404
|
+
* @param {number} coordinates[].x - x coordinate to be plotted on the graph
|
1405
|
+
* @param {number} coordinates[].xRange - range of x coordinate
|
1406
|
+
* @param {number} coordinates[].y - y coordinate to be plotted on the graph
|
1407
|
+
* @param {number} coordinates[].yRange - range of y coordinate
|
1408
|
+
*/
|
1409
|
+
clickPointsOnGraphPreviewTabAndVerifyLabelInputField: (coordinates) => {
|
1410
|
+
coordinates.forEach(({ x, xRange, y, yRange }) => {
|
1411
|
+
graphingPage.graphPreviewTab()
|
1412
|
+
.then(($graphElement) => {
|
1413
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1414
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1415
|
+
const originX = graphWidth / 2;
|
1416
|
+
const originY = graphHeight / 2;
|
1417
|
+
const xPixel = originX + x * (graphWidth / (xRange + 1));
|
1418
|
+
const yPixel = originY - y * (graphHeight / (yRange + 1));
|
1419
|
+
graphingPage.graphPreviewTab()
|
1420
|
+
.click(xPixel, yPixel, { force: true });
|
1421
|
+
graphingPage.steps.enterTextInGraphLabelInputField('This is a line')
|
1422
|
+
});
|
1423
|
+
});
|
1424
|
+
},
|
1425
|
+
|
1401
1426
|
/**
|
1402
1427
|
* This function verifies plotted points on the graph in preview tab
|
1403
1428
|
* @param {Object[]} coordinates - An array containing x and x coordinates along with their range
|