itemengine-cypress-automation 1.0.352-IEI-6088-3cb25eb.0 → 1.0.352-IEI-6088-0a6a59e.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.
- package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +101 -81
- package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +102 -82
- package/cypress/pages/components/gridQuestionCommonComponent.js +50 -0
- package/cypress/pages/components/questionInstructionsComponent.js +2 -0
- package/cypress/support/helpers/utilities.js +1 -1
- package/package.json +1 -1
@@ -1,9 +1,9 @@
|
|
1
|
-
import { multipleSelectionGridPage, itemPreviewPage, studentViewPage
|
1
|
+
import { multipleSelectionGridPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
2
|
import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components";
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
4
|
import utilities from "../../../support/helpers/utilities";
|
5
5
|
const css = Cypress.env('css');
|
6
|
-
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
6
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
|
7
7
|
const views = utilities.getViews(previewContentViews);
|
8
8
|
var itemReferenceID = "";
|
9
9
|
|
@@ -69,6 +69,9 @@ describe('Create item page - Multiple selection grid: Preview contents', () => {
|
|
69
69
|
case 'Correct answer view':
|
70
70
|
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
71
71
|
break;
|
72
|
+
case 'Print preview':
|
73
|
+
cy.visit(`/item-engine/demo/render-item/print-view/${utilities.base64Encoding(itemReferenceID)}`);
|
74
|
+
break;
|
72
75
|
default:
|
73
76
|
throw new Error('Invalid view');
|
74
77
|
}
|
@@ -86,26 +89,28 @@ describe('Create item page - Multiple selection grid: Preview contents', () => {
|
|
86
89
|
}
|
87
90
|
});
|
88
91
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
92
|
+
if (view !== 'Print preview') {
|
93
|
+
it('Question instructions should be visible', () => {
|
94
|
+
utilities.verifyInnerText(multipleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
|
95
|
+
utilities.verifyElementVisibilityState(multipleSelectionGridPage.questionInstructionsText(), 'visible');
|
96
|
+
});
|
97
|
+
|
98
|
+
it(`Multiple selection grid - The question grid as set by the user should be displayed in the ${view}`, () => {
|
99
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
|
100
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 1 }, 'Heading');
|
101
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 2 }, 'Heading');
|
102
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 1, column: 0 }, 'Heading');
|
103
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 1, column: 1 }, 'Checkbox with text');
|
104
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 2, column: 0 }, 'Subheading');
|
105
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 2, column: 2 }, 'No checkbox');
|
106
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 3, column: 0 }, 'Text');
|
107
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 3, column: 1 }, 'No checkbox');
|
108
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 4, column: 2 }, 'No checkbox');
|
109
|
+
cy.eyesCheckWindow(`Multiple selection grid - ${view} - Question grid displayed`);
|
110
|
+
});
|
111
|
+
}
|
107
112
|
|
108
|
-
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
113
|
+
if (view !== 'Grading view' && view !== 'Correct answer view' && view !== 'Print preview') {
|
109
114
|
it(`When the user has added image, equation, bold text to the options, then they should be displayed in the grid in ${view}`, () => {
|
110
115
|
multipleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
|
111
116
|
multipleSelectionGridPage.steps.verifyTableCellWithBoldTextInPreviewTab({ row: 3, column: 1 });
|
@@ -126,6 +131,30 @@ describe('Create item page - Multiple selection grid: Preview contents', () => {
|
|
126
131
|
it('The content in the grid should not be editable', () => {
|
127
132
|
multipleSelectionGridPage.steps.verifyOptionDisabledState({ row: 1, column: 1 });
|
128
133
|
});
|
134
|
+
} else if (view === 'Print preview') {
|
135
|
+
it('Question number should be visible', () => {
|
136
|
+
utilities.verifyInnerText(multipleSelectionGridPage.questionNumberPrintPreviewText(), '1');
|
137
|
+
utilities.verifyElementVisibilityState(multipleSelectionGridPage.questionNumberPrintPreviewText(), 'visible');
|
138
|
+
});
|
139
|
+
|
140
|
+
it('Question instructions should be visible', () => {
|
141
|
+
utilities.verifyInnerText(multipleSelectionGridPage.questionInstructionsPrintPreviewText(), 'Please select where the following animals are found');
|
142
|
+
utilities.verifyElementVisibilityState(multipleSelectionGridPage.questionInstructionsPrintPreviewText(), 'visible');
|
143
|
+
});
|
144
|
+
|
145
|
+
it(`Multiple selection - grid ${view} - The question grid as set by the user should be displayed in the ${view}`, () => {
|
146
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 0, column: 0 }, 'None');
|
147
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 0, column: 1 }, 'Heading');
|
148
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 0, column: 2 }, 'Heading');
|
149
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 1, column: 0 }, 'Heading');
|
150
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 1, column: 1 }, 'Radio button with text');
|
151
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 2, column: 0 }, 'Subheading');
|
152
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 2, column: 2 }, 'No radio button');
|
153
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 3, column: 0 }, 'Text');
|
154
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 3, column: 1 }, 'No radio button');
|
155
|
+
multipleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 4, column: 2 }, 'No radio button');
|
156
|
+
cy.eyesCheckWindow(`Single selection - grid ${view} - Question grid displayed`);
|
157
|
+
});
|
129
158
|
} else {
|
130
159
|
it(`The correct options should be in checked state, correct icons should be displayed besides them, correct background should be displayed behind the option`, () => {
|
131
160
|
multipleSelectionGridPage.steps.verifyOptionWithCheckboxSelectedState({ row: 1, column: 0 });
|
@@ -139,72 +168,63 @@ describe('Create item page - Multiple selection grid: Preview contents', () => {
|
|
139
168
|
});
|
140
169
|
}
|
141
170
|
|
142
|
-
|
143
|
-
|
144
|
-
.
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
171
|
+
if (view !== 'Print preview') {
|
172
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
173
|
+
multipleSelectionGridPage.gridPreviewTab()
|
174
|
+
.within(() => {
|
175
|
+
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell().parent(), 1), {
|
176
|
+
'background-color': css.color.matrixHeadingCellBg,
|
177
|
+
'border-bottom-color': `${css.color.matrixCellBorder}`
|
178
|
+
});
|
179
|
+
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell().parent(), 6), {
|
180
|
+
'background-color': css.color.matrixSubheadingCellBg,
|
181
|
+
'border-color': `${css.color.matrixCellBorder}`
|
182
|
+
});
|
183
|
+
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell().parent(), 9), {
|
184
|
+
'background-color': css.color.defaultBackground,
|
185
|
+
'border-color': `${css.color.matrixCellBorder}`
|
186
|
+
});
|
187
|
+
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 1).find('.question-text-wrapper'), {
|
188
|
+
'color': css.color.text,
|
189
|
+
'font-size': css.fontSize.heading,
|
190
|
+
'font-weight': css.fontWeight.bold
|
191
|
+
});
|
192
|
+
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 6).find('.question-text-wrapper'), {
|
193
|
+
'color': css.color.text,
|
194
|
+
'font-size': css.fontSize.default,
|
195
|
+
'font-weight': css.fontWeight.bold
|
196
|
+
});
|
197
|
+
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 9).find('.question-text-wrapper'), {
|
198
|
+
'color': css.color.text,
|
199
|
+
'font-size': css.fontSize.default,
|
200
|
+
'font-weight': css.fontWeight.regular
|
201
|
+
});
|
161
202
|
});
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 10).find('.question-text-wrapper strong'), {
|
183
|
-
'color': css.color.successBtn,
|
184
|
-
'font-size': css.fontSize.default,
|
185
|
-
'font-weight': css.fontWeight.bold
|
186
|
-
});
|
187
|
-
break;
|
188
|
-
default:
|
189
|
-
throw new Error('Invalid view');
|
190
|
-
}
|
191
|
-
});
|
203
|
+
switch (view) {
|
204
|
+
case 'Question preview':
|
205
|
+
case 'Item preview':
|
206
|
+
case 'Item view':
|
207
|
+
case 'Item preview':
|
208
|
+
case 'Student view':
|
209
|
+
break;
|
210
|
+
case 'Grading view':
|
211
|
+
case 'Correct answer view':
|
212
|
+
utilities.verifyCSS(utilities.getNthElement(multipleSelectionGridPage.tableCell(), 10).find('.question-text-wrapper strong'), {
|
213
|
+
'color': css.color.successBtn,
|
214
|
+
'font-size': css.fontSize.default,
|
215
|
+
'font-weight': css.fontWeight.bold
|
216
|
+
});
|
217
|
+
break;
|
218
|
+
default:
|
219
|
+
throw new Error('Invalid view');
|
220
|
+
}
|
221
|
+
});
|
222
|
+
}
|
192
223
|
|
193
224
|
//Failing due to https://weldnorthed.atlassian.net/browse/IEI-4738
|
194
225
|
it.skip('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
195
226
|
cy.checkAccessibility(multipleSelectionGridPage.tableCell());
|
196
227
|
});
|
197
|
-
|
198
|
-
if (view === 'Item view') {
|
199
|
-
it(`The Print Preview button should be visible`, () => {
|
200
|
-
itemPrintPreviewPage.steps.verifyPrintPreviewButton();
|
201
|
-
});
|
202
|
-
|
203
|
-
it('User should be able to open print preview', () => {
|
204
|
-
itemPrintPreviewPage.steps.clickPrintPreviewButton();
|
205
|
-
itemPrintPreviewPage.steps.verifyNoPrintPreviewErrors();
|
206
|
-
});
|
207
|
-
}
|
208
228
|
});
|
209
229
|
});
|
210
230
|
});
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { singleSelectionGridPage, itemPreviewPage, studentViewPage
|
1
|
+
import { singleSelectionGridPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
2
2
|
import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components";
|
3
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
4
|
import utilities from "../../../support/helpers/utilities";
|
5
5
|
const css = Cypress.env('css');
|
6
|
-
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
|
6
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview'];
|
7
7
|
const views = utilities.getViews(previewContentViews);
|
8
8
|
var itemReferenceID = "";
|
9
9
|
describe('Create item page - Single selection grid: Preview contents', () => {
|
@@ -68,6 +68,9 @@ describe('Create item page - Single selection grid: Preview contents', () => {
|
|
68
68
|
case 'Correct answer view':
|
69
69
|
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
70
70
|
break;
|
71
|
+
case 'Print preview':
|
72
|
+
cy.visit(`/item-engine/demo/render-item/print-view/${utilities.base64Encoding(itemReferenceID)}`);
|
73
|
+
break;
|
71
74
|
default:
|
72
75
|
throw new Error('Invalid view');
|
73
76
|
}
|
@@ -84,27 +87,29 @@ describe('Create item page - Single selection grid: Preview contents', () => {
|
|
84
87
|
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
85
88
|
}
|
86
89
|
});
|
90
|
+
|
91
|
+
if (view !== 'Print preview') {
|
92
|
+
it('Question instructions should be visible', () => {
|
93
|
+
utilities.verifyInnerText(singleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
|
94
|
+
utilities.verifyElementVisibilityState(singleSelectionGridPage.questionInstructionsText(), 'visible');
|
95
|
+
});
|
96
|
+
|
97
|
+
it(`Single selection - grid ${view} - The question grid as set by the user should be displayed in the ${view}`, () => {
|
98
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
|
99
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 1 }, 'Heading');
|
100
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 2 }, 'Heading');
|
101
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 1, column: 0 }, 'Heading');
|
102
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 1, column: 1 }, 'Radio button with text');
|
103
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 2, column: 0 }, 'Subheading');
|
104
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 2, column: 2 }, 'No radio button');
|
105
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 3, column: 0 }, 'Text');
|
106
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 3, column: 1 }, 'No radio button');
|
107
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 4, column: 2 }, 'No radio button');
|
108
|
+
cy.eyesCheckWindow(`Single selection - grid ${view} - Question grid displayed`);
|
109
|
+
});
|
110
|
+
}
|
87
111
|
|
88
|
-
|
89
|
-
utilities.verifyInnerText(singleSelectionGridPage.questionInstructionsText(), 'Please select where the following animals are found');
|
90
|
-
utilities.verifyElementVisibilityState(singleSelectionGridPage.questionInstructionsText(), 'visible');
|
91
|
-
});
|
92
|
-
|
93
|
-
it(`Single selection - grid ${view} - The question grid as set by the user should be displayed in the ${view}`, () => {
|
94
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 0 }, 'None');
|
95
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 1 }, 'Heading');
|
96
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 0, column: 2 }, 'Heading');
|
97
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 1, column: 0 }, 'Heading');
|
98
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 1, column: 1 }, 'Radio button with text');
|
99
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 2, column: 0 }, 'Subheading');
|
100
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 2, column: 2 }, 'No radio button');
|
101
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 3, column: 0 }, 'Text');
|
102
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 3, column: 1 }, 'No radio button');
|
103
|
-
singleSelectionGridPage.steps.verifyTableCellPropertyPreviewTab({ row: 4, column: 2 }, 'No radio button');
|
104
|
-
cy.eyesCheckWindow(`Single selection - grid ${view} - Question grid displayed`);
|
105
|
-
});
|
106
|
-
|
107
|
-
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
112
|
+
if (view !== 'Grading view' && view !== 'Correct answer view' && view !== 'Print preview') {
|
108
113
|
it(`When the user has added image, equation, bold text to the options, then they should be displayed in the grid in ${view}`, () => {
|
109
114
|
singleSelectionGridPage.steps.verifyTableCellWithImageInPreviewTab({ row: 1, column: 1 });
|
110
115
|
singleSelectionGridPage.steps.verifyTableCellWithBoldTextInPreviewTab({ row: 3, column: 1 });
|
@@ -125,6 +130,30 @@ describe('Create item page - Single selection grid: Preview contents', () => {
|
|
125
130
|
it('The content in the grid should not be editable', () => {
|
126
131
|
singleSelectionGridPage.steps.verifyOptionDisabledState({ row: 1, column: 1 });
|
127
132
|
});
|
133
|
+
} else if (view === 'Print preview') {
|
134
|
+
it('Question number should be visible', () => {
|
135
|
+
utilities.verifyInnerText(singleSelectionGridPage.questionNumberPrintPreviewText(), '1');
|
136
|
+
utilities.verifyElementVisibilityState(singleSelectionGridPage.questionNumberPrintPreviewText(), 'visible');
|
137
|
+
});
|
138
|
+
|
139
|
+
it('Question instructions should be visible', () => {
|
140
|
+
utilities.verifyInnerText(singleSelectionGridPage.questionInstructionsPrintPreviewText(), 'Please select where the following animals are found');
|
141
|
+
utilities.verifyElementVisibilityState(singleSelectionGridPage.questionInstructionsPrintPreviewText(), 'visible');
|
142
|
+
});
|
143
|
+
|
144
|
+
it(`Single selection - grid ${view} - The question grid as set by the user should be displayed in the ${view}`, () => {
|
145
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 0, column: 0 }, 'None');
|
146
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 0, column: 1 }, 'Heading');
|
147
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 0, column: 2 }, 'Heading');
|
148
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 1, column: 0 }, 'Heading');
|
149
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 1, column: 1 }, 'Radio button with text');
|
150
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 2, column: 0 }, 'Subheading');
|
151
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 2, column: 2 }, 'No radio button');
|
152
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 3, column: 0 }, 'Text');
|
153
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 3, column: 1 }, 'No radio button');
|
154
|
+
singleSelectionGridPage.steps.verifyTableCellPropertyPrintPreviewTab({ row: 4, column: 2 }, 'No radio button');
|
155
|
+
cy.eyesCheckWindow(`Single selection - grid ${view} - Question grid displayed`);
|
156
|
+
});
|
128
157
|
} else {
|
129
158
|
it(`The correct options should be in checked state, correct icons should be displayed besides them, correct background should be displayed behind the option`, () => {
|
130
159
|
singleSelectionGridPage.steps.verifyOptionWithRadioButtonSelectedState({ row: 1, column: 0 });
|
@@ -138,72 +167,63 @@ describe('Create item page - Single selection grid: Preview contents', () => {
|
|
138
167
|
});
|
139
168
|
}
|
140
169
|
|
141
|
-
|
142
|
-
|
143
|
-
.
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
switch (view) {
|
173
|
-
case 'Question preview':
|
174
|
-
case 'Item preview':
|
175
|
-
case 'Item view':
|
176
|
-
case 'Item preview':
|
177
|
-
case 'Student view':
|
178
|
-
break;
|
179
|
-
case 'Grading view':
|
180
|
-
case 'Correct answer view':
|
181
|
-
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 10).find('.question-text-wrapper strong'), {
|
182
|
-
'color': css.color.text,
|
183
|
-
'font-size': css.fontSize.default,
|
184
|
-
'font-weight': css.fontWeight.bold
|
170
|
+
if (view !== 'Print preview') {
|
171
|
+
it('CSS of preview contents', { tags: 'css' }, () => {
|
172
|
+
singleSelectionGridPage.gridPreviewTab()
|
173
|
+
.within(() => {
|
174
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell().parent(), 1), {
|
175
|
+
'background-color': css.color.matrixHeadingCellBg,
|
176
|
+
'border-color': `${css.color.matrixCellBorder} ${css.color.matrixCellBorder} ${css.color.matrixCellBorder} ${css.color.correctOptionBorder}`
|
177
|
+
});
|
178
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell().parent(), 6), {
|
179
|
+
'background-color': css.color.matrixSubheadingCellBg,
|
180
|
+
'border-color': `${css.color.matrixCellBorder}`
|
181
|
+
});
|
182
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell().parent(), 9), {
|
183
|
+
'background-color': css.color.defaultBackground,
|
184
|
+
'border-color': `${css.color.matrixCellBorder}`
|
185
|
+
});
|
186
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 1).find('.question-text-wrapper'), {
|
187
|
+
'color': css.color.text,
|
188
|
+
'font-size': css.fontSize.heading,
|
189
|
+
'font-weight': css.fontWeight.bold
|
190
|
+
});
|
191
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 6).find('.question-text-wrapper'), {
|
192
|
+
'color': css.color.text,
|
193
|
+
'font-size': css.fontSize.default,
|
194
|
+
'font-weight': css.fontWeight.bold
|
195
|
+
});
|
196
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 9).find('.question-text-wrapper'), {
|
197
|
+
'color': css.color.text,
|
198
|
+
'font-size': css.fontSize.default,
|
199
|
+
'font-weight': css.fontWeight.regular
|
200
|
+
});
|
185
201
|
});
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
202
|
+
switch (view) {
|
203
|
+
case 'Question preview':
|
204
|
+
case 'Item preview':
|
205
|
+
case 'Item view':
|
206
|
+
case 'Item preview':
|
207
|
+
case 'Student view':
|
208
|
+
break;
|
209
|
+
case 'Grading view':
|
210
|
+
case 'Correct answer view':
|
211
|
+
utilities.verifyCSS(utilities.getNthElement(singleSelectionGridPage.tableCell(), 10).find('.question-text-wrapper strong'), {
|
212
|
+
'color': css.color.text,
|
213
|
+
'font-size': css.fontSize.default,
|
214
|
+
'font-weight': css.fontWeight.bold
|
215
|
+
});
|
216
|
+
break;
|
217
|
+
default:
|
218
|
+
throw new Error('Invalid view');
|
219
|
+
}
|
220
|
+
});
|
221
|
+
}
|
191
222
|
|
192
223
|
//Remove skip once https://weldnorthed.atlassian.net/browse/IEI-4738 is resolved
|
193
224
|
it.skip('Accessibility of preview tab', { tags: 'a11y' }, () => {
|
194
225
|
cy.checkAccessibility(singleSelectionGridPage.tableCell());
|
195
226
|
});
|
196
|
-
|
197
|
-
if (view === 'Item view') {
|
198
|
-
it(`The Print Preview button should be visible`, () => {
|
199
|
-
itemPrintPreviewPage.steps.verifyPrintPreviewButton();
|
200
|
-
});
|
201
|
-
|
202
|
-
it('User should be able to open print preview', () => {
|
203
|
-
itemPrintPreviewPage.steps.clickPrintPreviewButton();
|
204
|
-
itemPrintPreviewPage.steps.verifyNoPrintPreviewErrors();
|
205
|
-
});
|
206
|
-
}
|
207
227
|
});
|
208
228
|
});
|
209
229
|
});
|
@@ -44,6 +44,7 @@ const selectors = {
|
|
44
44
|
optionsButton: () => cy.get('[class*="PreviewSelectionButton"]'),
|
45
45
|
optionsButtonPreviewTab: () => cy.get('.preview-selection-grid [class*="PreviewSelectionButton"]'),
|
46
46
|
gridPreviewTab: () => cy.get('.single-selection-grid-wrapper:visible'),
|
47
|
+
gridPrintPreviewTab: () => cy.get('[data-testid="print-preview-selection-grid-table"]'),
|
47
48
|
gridSpecifyCorrectAnswerSection: () => cy.get('.set-correct-ans-selection-grid'),
|
48
49
|
tableCell: () => cy.get('[class*="CellContainer"]'),
|
49
50
|
tableCellWrapperSpecifyCorrectAnswerSection: () => cy.get('.set-correct-ans-selection-grid [class*="TableCellWrapper"]'),
|
@@ -351,6 +352,55 @@ const steps = {
|
|
351
352
|
});
|
352
353
|
},
|
353
354
|
|
355
|
+
|
356
|
+
/**
|
357
|
+
* Verifies the property of a cell in the print preview of a grid question component.
|
358
|
+
* @param {Object} cellPosition - The position of the cell to verify, containing row and column indices.
|
359
|
+
* @param {number} cellPosition.row - The row index of the cell.
|
360
|
+
* @param {number} cellPosition.column - The column index of the cell.
|
361
|
+
* @param {'None'|Heading'|'Subheading'|'Text'|'Radio button'|'Checkbox'|'Radio button with text'|'Checkbox with text'|'No radio button'|'No checkbox'} cellProperty - The property to verify for the cell.
|
362
|
+
* @throws {Error} If an invalid cellProperty is provided.
|
363
|
+
*/
|
364
|
+
verifyTableCellPropertyPrintPreviewTab: ({ row, column }, cellProperty) => {
|
365
|
+
gridQuestionCommonComponent.gridPrintPreviewTab().within(() => {
|
366
|
+
utilities.getNthElement(gridQuestionCommonComponent.tableRow(), row)
|
367
|
+
.within(() => {
|
368
|
+
switch (cellProperty) {
|
369
|
+
case 'None':
|
370
|
+
utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
|
371
|
+
.should('have.class', 'cell-content-none');
|
372
|
+
break;
|
373
|
+
case 'Heading':
|
374
|
+
utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
|
375
|
+
.should('have.class', 'cell-content-heading');
|
376
|
+
break;
|
377
|
+
case 'Subheading':
|
378
|
+
utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
|
379
|
+
.should('have.class', 'cell-content-subeading');
|
380
|
+
break;
|
381
|
+
case 'Text':
|
382
|
+
case 'No radio button':
|
383
|
+
case 'No checkbox':
|
384
|
+
utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
|
385
|
+
.should('have.class', 'cell-content-text');
|
386
|
+
break;
|
387
|
+
case 'Radio button':
|
388
|
+
case 'Checkbox':
|
389
|
+
utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
|
390
|
+
.should('have.class', 'cell-content-radio');
|
391
|
+
break;
|
392
|
+
case 'Radio button with text':
|
393
|
+
case 'Checkbox with text':
|
394
|
+
utilities.getNthElement(gridQuestionCommonComponent.tableCell(), column)
|
395
|
+
.should('have.class', 'cell-content-radio-text');
|
396
|
+
break;
|
397
|
+
default:
|
398
|
+
throw new Error('Invalid list option');
|
399
|
+
};
|
400
|
+
});
|
401
|
+
});
|
402
|
+
},
|
403
|
+
|
354
404
|
/**
|
355
405
|
* Verifies the property of a cell in the specify correct answer section of a grid question component.
|
356
406
|
* @param {Object} cellPosition - The position of the cell to verify, containing row and column indices.
|
@@ -9,6 +9,8 @@ const selectors = {
|
|
9
9
|
questionInstructionsText: () => cy.get('.question-instruction'),
|
10
10
|
questionInstructionsWrapper: () => cy.get('.edit-question-instruction-wrapper'),
|
11
11
|
questionInstructionsTextPreviewTab: () => cy.get('.question-instruction:visible'),
|
12
|
+
questionNumberPrintPreviewText: () => cy.get('[data-testid="print-preview-question-number"]'),
|
13
|
+
questionInstructionsPrintPreviewText: () => cy.get('[data-testid="question-instruction-element"]').first(),
|
12
14
|
}
|
13
15
|
|
14
16
|
const steps = {
|
@@ -227,7 +227,7 @@ const utilities = {
|
|
227
227
|
* @returns {Array<string>} - An array of view names.
|
228
228
|
*/
|
229
229
|
getViews: (filterArray) => {
|
230
|
-
const views = Cypress.env('views') ? Cypress.env('views') : ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view']
|
230
|
+
const views = Cypress.env('views') ? Cypress.env('views') : ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view', 'Correct answer view', 'Print preview']
|
231
231
|
return (filterArray) ? filterArray.filter(view => views.includes(view)) : views
|
232
232
|
},
|
233
233
|
|