itemengine-cypress-automation 1.0.83 → 1.0.85
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/DesmosGraphing/previewTabContent.smoke.js +3 -3
- package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +30 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/allOrNothingGroupedScoring.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +43 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +510 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +678 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +82 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/minimumScoringPenaltyPointsAndRoundingDropdown.js +198 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettingsForGroupedLayout.js +263 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +80 -0
- package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +2 -0
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +2 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +177 -171
- package/cypress/pages/components/backgroundImageUploadComponent.js +19 -3
- package/cypress/pages/components/draggableOptionContainer.js +13 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +175 -25
- package/cypress/pages/components/figOverImageCanvasComponent.js +257 -0
- package/cypress/pages/components/imageActionsComponent.js +30 -0
- package/cypress/pages/components/index.js +5 -5
- package/cypress/pages/components/measuringToolComponent.js +0 -54
- package/cypress/pages/components/opacityComponent.js +64 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +16 -1
- package/cypress/pages/essayResponsePage.js +5 -7
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +152 -11
- package/cypress/pages/protractorPage.js +3 -1
- package/cypress/pages/rulerPage.js +5 -24
- package/cypress/pages/selectQuestionResourceToolPage.js +1 -1
- package/{deploy.yaml → deploy/e2e/deploy.yaml} +1 -1
- package/deploy/smoke/deploy.yaml +29 -0
- package/deploy/smoke/run.sh +6 -0
- package/package.json +1 -1
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/allOrNothingPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/manuallyAndNonScoredScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionBasic.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perCorrectOptionMinimumAndPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneBasic.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/Scoring/perDropzoneMinimumAndPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/allOrNothingBasicForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/checkAnswerFunctionalityForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/clickAndDrop.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/draggableOptions.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/editTabBasicSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/editTabScoring.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/headerSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/manuallyAndNonScoredScoringEditTab.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/previewContentsForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/specifyCorrectAnswerSection.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/studentViewSettings.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/studentViewSettingsForGroupedLayout.js +0 -0
- /package/cypress/e2e/ILC/{DragAndDropIntoCategories → DragAndDropIntoCategoriesNew}/switchingCasesBetweenOptionsLayout.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/allOrNothingPenaltyScoring.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/manuallyAndNonScored.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsBasic.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsBasic.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/allOrNothingForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/checkAnswerFunctionalityForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/editTabScoringSection.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/previewContentsForAllViews.smoke.js +0 -0
- /package/cypress/e2e/ILC/{FillInTheGapsOverImageText → FillInTheGapsOverImageTextNew}/specifyCorrectAnswerSection.js +0 -0
- /package/{run.sh → deploy/e2e/run.sh} +0 -0
@@ -173,6 +173,8 @@ describe('Create Item page - Protractor : Edit Tab', () => {
|
|
173
173
|
|
174
174
|
it('\'Opacity\' label, input field and slider should be displayed and by default the slider and input field of \'Opacity\' should be set to 40 percent', () => {
|
175
175
|
protractorPage.steps.verifyDefaultOpacityLabelSliderAndInputField();
|
176
|
+
protractorPage.steps.verifyOpacityInputFieldValue(40);
|
177
|
+
protractorPage.steps.verifyOpacitySliderValue(40);
|
176
178
|
});
|
177
179
|
|
178
180
|
it('The maximum value of \'Opacity\' slider should be 100', () => {
|
@@ -426,6 +426,8 @@ describe('Create Item page - Ruler: Edit Tab', () => {
|
|
426
426
|
|
427
427
|
it('\'Opacity\' label, input field and slider should be displayed and by default the slider of \'Opacity\' should be set to 40 percent', () => {
|
428
428
|
rulerPage.steps.verifyDefaultOpacityLabelSliderAndInputField();
|
429
|
+
rulerPage.steps.verifyOpacityInputFieldValue(40);
|
430
|
+
rulerPage.steps.verifyOpacitySliderValue(40);
|
429
431
|
});
|
430
432
|
|
431
433
|
it('The maximum value of \'Opacity\' slider should be 100', () => {
|
@@ -9,198 +9,204 @@ const css = Cypress.env('css');
|
|
9
9
|
const views = utilities.getViews(previewContentViews);
|
10
10
|
var itemReferenceID = "";
|
11
11
|
|
12
|
-
views
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
switch (view) {
|
17
|
-
case 'Question preview':
|
18
|
-
cy.log('Navigating to short text response question type');
|
19
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
20
|
-
cy.barsPreLoaderWait();
|
21
|
-
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Text');
|
22
|
-
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
23
|
-
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
|
24
|
-
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
|
25
|
-
multipleSelectionPage.steps.allotPoints(20);
|
26
|
-
toolSettingsComponent.steps.expandToolSettingsAccordion();
|
27
|
-
toolSettingsComponent.steps.selectTool(0);
|
28
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
29
|
-
utilities.verifyElementVisibilityState(commonComponents.previewTabQuestionWrapper(), 'visible');
|
30
|
-
break;
|
31
|
-
case 'Item view':
|
32
|
-
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
33
|
-
break;
|
34
|
-
case 'Item preview':
|
35
|
-
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
36
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
37
|
-
break;
|
38
|
-
case 'Student view':
|
39
|
-
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
40
|
-
break;
|
41
|
-
case 'Grading view':
|
42
|
-
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
43
|
-
break;
|
44
|
-
case 'Correct answer view':
|
45
|
-
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
46
|
-
break;
|
47
|
-
default:
|
48
|
-
throw new Error('Invalid view');
|
49
|
-
}
|
50
|
-
});
|
12
|
+
describe('Tool settings content for all views', () => {
|
13
|
+
before(() => {
|
14
|
+
cy.loginAs('admin');
|
15
|
+
});
|
51
16
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
17
|
+
views.forEach((view) => {
|
18
|
+
describe(`Preview tab contents : Single tool selected - ${view}`, { tags: 'smoke' }, () => {
|
19
|
+
abortEarlySetup();
|
20
|
+
before(() => {
|
21
|
+
switch (view) {
|
22
|
+
case 'Question preview':
|
23
|
+
cy.log('Navigating to short text response question type');
|
24
|
+
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
25
|
+
cy.barsPreLoaderWait();
|
26
|
+
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Text');
|
27
|
+
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
28
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
|
29
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
|
30
|
+
multipleSelectionPage.steps.allotPoints(20);
|
31
|
+
toolSettingsComponent.steps.expandToolSettingsAccordion();
|
32
|
+
toolSettingsComponent.steps.selectTool(0);
|
33
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
34
|
+
utilities.verifyElementVisibilityState(commonComponents.previewTabQuestionWrapper(), 'visible');
|
35
|
+
break;
|
36
|
+
case 'Item view':
|
37
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
38
|
+
break;
|
39
|
+
case 'Item preview':
|
40
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
41
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
42
|
+
break;
|
43
|
+
case 'Student view':
|
44
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
45
|
+
break;
|
46
|
+
case 'Grading view':
|
47
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
48
|
+
break;
|
49
|
+
case 'Correct answer view':
|
50
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
51
|
+
break;
|
52
|
+
default:
|
53
|
+
throw new Error('Invalid view');
|
54
|
+
}
|
55
|
+
});
|
63
56
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
after(() => {
|
58
|
+
if (view === 'Question preview') {
|
59
|
+
createQuestionBasePage.steps.clickOnSaveQuestionButton();
|
60
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
61
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
62
|
+
}
|
63
|
+
if (view === 'Student view') {
|
64
|
+
studentViewPage.steps.submitResponse();
|
65
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
66
|
+
}
|
67
|
+
});
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
rulerPage.steps.verifyLengthOfRulerInPreview('15cm');
|
74
|
-
});
|
69
|
+
it('\'Show ruler\' button should be displayed and ruler tool should not be displayed by default', () => {
|
70
|
+
rulerPage.steps.verifyPreviewTabRulerVisibilityButtonLabel('Show');
|
71
|
+
rulerPage.steps.verifyRulerNotVisible();
|
72
|
+
});
|
75
73
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
'
|
80
|
-
'
|
81
|
-
'font-weight': css.fontWeight.semibold
|
74
|
+
it('When user clicks on \'Show ruler\' button, then ruler should be displayed and its button should change to \'Hide ruler\'', () => {
|
75
|
+
rulerPage.steps.clickOnRulerVisibilityButton();
|
76
|
+
rulerPage.steps.verifyRulerVisible();
|
77
|
+
rulerPage.steps.verifyPreviewTabRulerVisibilityButtonLabel('Hide');
|
78
|
+
rulerPage.steps.verifyLengthOfRulerInPreview('15cm');
|
82
79
|
});
|
83
|
-
});
|
84
80
|
|
85
|
-
|
86
|
-
|
87
|
-
|
81
|
+
it('CSS of the \'Hide ruler\' button', { tags: 'css' }, () => {
|
82
|
+
utilities.verifyCSS(rulerPage.rulerVisibilityButtonPreviewTab(), {
|
83
|
+
'border': `1px solid ${css.color.activeButtons}`,
|
84
|
+
'background-color': css.color.defaultBackground,
|
85
|
+
'font-size': css.fontSize.normal,
|
86
|
+
'font-weight': css.fontWeight.semibold
|
87
|
+
});
|
88
|
+
});
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
rulerPage.steps.verifyRulerNotVisible();
|
93
|
-
});
|
94
|
-
});
|
90
|
+
it('Accessibility of \'Hide ruler\' button', { tags: 'a11y' }, () => {
|
91
|
+
cy.checkAccessibility(rulerPage.rulerVisibilityButtonPreviewTab().parents('[class*="ItemEnginestyles__MainWrapper"]'));
|
92
|
+
});
|
95
93
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
cy.log('Navigating to short text response question type');
|
102
|
-
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
103
|
-
cy.barsPreLoaderWait();
|
104
|
-
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Text');
|
105
|
-
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
106
|
-
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
|
107
|
-
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
|
108
|
-
multipleSelectionPage.steps.allotPoints(20);
|
109
|
-
toolSettingsComponent.steps.expandToolSettingsAccordion();
|
110
|
-
toolSettingsComponent.steps.selectTool(0);
|
111
|
-
toolSettingsComponent.steps.selectTool(1);
|
112
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
113
|
-
break;
|
114
|
-
case 'Item view':
|
115
|
-
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
116
|
-
break;
|
117
|
-
case 'Item preview':
|
118
|
-
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
119
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
120
|
-
break;
|
121
|
-
case 'Student view':
|
122
|
-
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
123
|
-
break;
|
124
|
-
case 'Grading view':
|
125
|
-
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
126
|
-
break;
|
127
|
-
case 'Correct answer view':
|
128
|
-
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
129
|
-
break;
|
130
|
-
default:
|
131
|
-
throw new Error('Invalid view');
|
132
|
-
}
|
94
|
+
it('When user clicks on \'Hide ruler\', then tool should be disappear and its button should change to \'Show ruler\'', () => {
|
95
|
+
rulerPage.steps.clickOnRulerVisibilityButton();
|
96
|
+
rulerPage.steps.verifyPreviewTabRulerVisibilityButtonLabel('Show');
|
97
|
+
rulerPage.steps.verifyRulerNotVisible();
|
98
|
+
});
|
133
99
|
});
|
134
100
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
101
|
+
describe(`Preview tab contents : Multiple tools selected - ${view}`, { tags: 'smoke' }, () => {
|
102
|
+
abortEarlySetup();
|
103
|
+
before(() => {
|
104
|
+
switch (view) {
|
105
|
+
case 'Question preview':
|
106
|
+
cy.log('Navigating to short text response question type');
|
107
|
+
multipleSelectionPage.steps.navigateToCreateQuestion('multiple selection');
|
108
|
+
cy.barsPreLoaderWait();
|
109
|
+
multipleSelectionPage.steps.addTextInQuestionInstructionsInputField('Text');
|
110
|
+
multipleSelectionPage.steps.addInputToOptionsInputField(options);
|
111
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(0);
|
112
|
+
multipleSelectionPage.steps.checkOptionsCheckboxInSpecifyCorrectAnswerSection(1);
|
113
|
+
multipleSelectionPage.steps.allotPoints(20);
|
114
|
+
toolSettingsComponent.steps.expandToolSettingsAccordion();
|
115
|
+
toolSettingsComponent.steps.selectTool(0);
|
116
|
+
toolSettingsComponent.steps.selectTool(1);
|
117
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
118
|
+
break;
|
119
|
+
case 'Item view':
|
120
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
121
|
+
break;
|
122
|
+
case 'Item preview':
|
123
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
124
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
125
|
+
break;
|
126
|
+
case 'Student view':
|
127
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
128
|
+
break;
|
129
|
+
case 'Grading view':
|
130
|
+
cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
|
131
|
+
break;
|
132
|
+
case 'Correct answer view':
|
133
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
134
|
+
break;
|
135
|
+
default:
|
136
|
+
throw new Error('Invalid view');
|
137
|
+
}
|
138
|
+
});
|
146
139
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
140
|
+
after(() => {
|
141
|
+
if (view === 'Question preview') {
|
142
|
+
createQuestionBasePage.steps.clickOnSaveQuestionButton();
|
143
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
144
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
145
|
+
}
|
146
|
+
if (view === 'Student view') {
|
147
|
+
studentViewPage.steps.submitResponse();
|
148
|
+
utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
|
149
|
+
}
|
150
|
+
});
|
153
151
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
152
|
+
it('When the user selects ruler and protractor tool in edit tab, then \'Show Ruler\' and \'Show protractor\' buttons should be displayed in preview tab and tools should not be visible by default', () => {
|
153
|
+
rulerPage.steps.verifyPreviewTabRulerVisibilityButtonLabel('Show');
|
154
|
+
rulerPage.steps.verifyRulerNotVisible();
|
155
|
+
protractorPage.steps.verifyPreviewTabProtractorVisibilityButtonLabel('Show');
|
156
|
+
protractorPage.steps.verifyProtractorNotExistInPreviewTab();
|
157
|
+
});
|
160
158
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
159
|
+
it('When the user clicks on \'Show ruler\', then ruler tool should be displayed and its button should change to \'Hide ruler\'', () => {
|
160
|
+
rulerPage.steps.clickOnRulerVisibilityButton();
|
161
|
+
rulerPage.steps.verifyRulerVisible();
|
162
|
+
rulerPage.steps.verifyPreviewTabRulerVisibilityButtonLabel('Hide');
|
163
|
+
rulerPage.steps.verifyLengthOfRulerInPreview('15cm');
|
164
|
+
});
|
167
165
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
166
|
+
it('When user clicks on \'Show protractor\', then protractor tool should be displayed and its button should change to \'Hide protractor\'', () => {
|
167
|
+
protractorPage.steps.clickOnProtractorVisibilityButton();
|
168
|
+
protractorPage.steps.verifyProtractorVisibleInPreviewTab();
|
169
|
+
protractorPage.steps.verifyAngleTypeIsBothAcuteAndObtuseInPreviewTab();
|
170
|
+
protractorPage.steps.verifyPreviewTabProtractorVisibilityButtonLabel('Hide');
|
171
|
+
});
|
172
172
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
'background-color': css.color.defaultBackground,
|
177
|
-
'font-size': css.fontSize.normal,
|
178
|
-
'font-weight': css.fontWeight.semibold
|
173
|
+
it('When user has clicked visibility buttons for both the ruler and protractor tools, both tools should be displayed simultaneously in the preview tab', () => {
|
174
|
+
rulerPage.steps.verifyRulerVisible();
|
175
|
+
protractorPage.steps.verifyProtractorVisibleInPreviewTab();
|
179
176
|
});
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
177
|
+
|
178
|
+
it('CSS of the \'Hide ruler\' and \'Hide protractor\' button', { tags: 'css' }, () => {
|
179
|
+
utilities.verifyCSS(rulerPage.rulerVisibilityButtonPreviewTab(), {
|
180
|
+
'border': `1px solid ${css.color.activeButtons}`,
|
181
|
+
'background-color': css.color.defaultBackground,
|
182
|
+
'font-size': css.fontSize.normal,
|
183
|
+
'font-weight': css.fontWeight.semibold
|
184
|
+
});
|
185
|
+
utilities.verifyCSS(protractorPage.protractorVisibilityButtonPreviewTab(), {
|
186
|
+
'border': `1px solid ${css.color.activeButtons}`,
|
187
|
+
'background-color': css.color.defaultBackground,
|
188
|
+
'font-size': css.fontSize.normal,
|
189
|
+
'font-weight': css.fontWeight.medium
|
190
|
+
});
|
185
191
|
});
|
186
|
-
});
|
187
192
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
+
//Failed due to https://redmine.zeuslearning.com/issues/557552
|
194
|
+
|
195
|
+
it('Accessibility of \'Hide ruler\' button', { tags: 'a11y' }, () => {
|
196
|
+
cy.checkAccessibility(rulerPage.rulerVisibilityButtonPreviewTab().parents('[class*="ItemEnginestyles__MainWrapper"]'));
|
197
|
+
});
|
193
198
|
|
194
199
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
+
it('When user clicks on \'Hide ruler\', then ruler tool should be disappear and button should change to \'Show ruler\'. Protractor tool should be visible in preview tab', () => {
|
201
|
+
rulerPage.steps.clickOnRulerVisibilityButton();
|
202
|
+
rulerPage.steps.verifyRulerNotVisible();
|
203
|
+
protractorPage.steps.verifyProtractorVisibleInPreviewTab();
|
204
|
+
});
|
200
205
|
|
201
|
-
|
202
|
-
|
203
|
-
|
206
|
+
it('When user clicks on \'Hide protractor\', then protractor tool should be disappear and button should change to \'Show protractor\'', () => {
|
207
|
+
protractorPage.steps.clickOnProtractorVisibilityButton();
|
208
|
+
protractorPage.steps.verifyProtractorNotExistInPreviewTab();
|
209
|
+
});
|
204
210
|
});
|
205
211
|
});
|
206
212
|
});
|
@@ -3,13 +3,15 @@ import utilities from "../../support/helpers/utilities";
|
|
3
3
|
const selectors = {
|
4
4
|
backgroundImageLabel: () => cy.get('[class*="Background"][class*="LabelWrapper"]'),
|
5
5
|
inputTypeFile: () => cy.get('input[type="file"]'),
|
6
|
-
uploadLabel: () => cy.get('[class*="
|
7
|
-
fileNameLabel: () => cy.get('[class*="
|
6
|
+
uploadLabel: () => cy.get('[class*="UploadImagestyles__LabelWrapper"]').eq(0),
|
7
|
+
fileNameLabel: () => cy.get('[class*="UploadImagestyles__LabelWrapper"]').eq(1),
|
8
8
|
fileUploadSection: () => cy.get('.file-input-wrapper'),
|
9
9
|
chooseFileButton: () => cy.get('.choose-file-button'),
|
10
10
|
noFileChosenLabel: () => cy.get('[aria-label="No file chosen"]'),
|
11
11
|
uploadImageProgressBar: () => cy.get('[class*="ProgressBar"]'),
|
12
|
-
uploadedFileNameLabel: () => cy.get('[class*="
|
12
|
+
uploadedFileNameLabel: () => cy.get('[class*="UploadImagestyles__SelectedFileWithIcon"]'),
|
13
|
+
deleteImageIcon: () => cy.get('[aria-label="Delete image"]'),
|
14
|
+
errorMessage: () => cy.get('.ErrorMessageContainer')
|
13
15
|
}
|
14
16
|
|
15
17
|
const steps = {
|
@@ -20,6 +22,20 @@ const steps = {
|
|
20
22
|
uploadFile: (file) => {
|
21
23
|
backgroundImageUploadComponent.inputTypeFile()
|
22
24
|
.attachFile(`uploads/${file}`);
|
25
|
+
},
|
26
|
+
|
27
|
+
deleteImage: () => {
|
28
|
+
backgroundImageUploadComponent.deleteImageIcon()
|
29
|
+
.click();
|
30
|
+
},
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @param {*} fileName name of the uploaded file
|
34
|
+
* @description function verifies uploaded file name
|
35
|
+
*/
|
36
|
+
verifyFileNameLabel: (fileName) => {
|
37
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.uploadedFileNameLabel(), fileName);
|
38
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadedFileNameLabel(), 'visible');
|
23
39
|
}
|
24
40
|
}
|
25
41
|
|
@@ -359,6 +359,19 @@ const steps = {
|
|
359
359
|
utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOption(), 'notExist');
|
360
360
|
});
|
361
361
|
},
|
362
|
+
|
363
|
+
/**
|
364
|
+
* @param {number} groupIndex Index of group
|
365
|
+
* @description Verify the empty group displayed in specify correct answer section
|
366
|
+
*/
|
367
|
+
verifyEmptyGroupInPreviewTab: (groupIndex) => {
|
368
|
+
draggableOptionContainer.groupedOptionsContainerPreviewTab()
|
369
|
+
.eq(groupIndex)
|
370
|
+
.should('be.visible')
|
371
|
+
.within(() => {
|
372
|
+
utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOption(), 'notExist');
|
373
|
+
});
|
374
|
+
}
|
362
375
|
}
|
363
376
|
|
364
377
|
const tests = {
|