itemengine-cypress-automation 1.0.132 → 1.0.133
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 +1 -2
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +53 -54
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +0 -149
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +312 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +71 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +98 -0
- package/cypress/e2e/ILC/GeogebraActivity/editTabScoringSection.js +56 -0
- package/cypress/e2e/ILC/GeogebraActivity/gradingViewAndCorrectAnswerViewContents.smoke.js +106 -0
- package/cypress/e2e/ILC/GeogebraActivity/headerSection.js +74 -0
- package/cypress/e2e/ILC/GeogebraActivity/previewTabContent.smoke.js +91 -0
- package/cypress/e2e/ILC/GeogebraActivity/questionInstructions.js +28 -0
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingPenaltyScoring.js +79 -0
- package/cypress/e2e/ILC/Graphing/Scoring/manuallyAndNonScoredScoring.js +253 -0
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +307 -0
- package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +84 -0
- package/cypress/e2e/ILC/Graphing/editTabScoringSection.js +105 -0
- package/cypress/e2e/ILC/Graphing/headerSection.js +77 -0
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +916 -0
- package/cypress/e2e/ILC/Graphing/minimumScoringPenaltyPointsAndRoundingDropdown.js +57 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/Graphing/specifyCorrectAnswerSection.js +72 -0
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +120 -0
- package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +858 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +337 -4
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/components/additionalSettingsAccessibilitySectionComponent.js +66 -0
- package/cypress/pages/components/additionalSettingsPanel.js +95 -90
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +9 -7
- package/cypress/pages/components/backgroundImageUploadComponent.js +16 -14
- package/cypress/pages/components/colorPopupComponent.js +14 -17
- package/cypress/pages/components/commonComponents.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
- package/cypress/pages/components/imageCanvasComponent.js +3 -3
- package/cypress/pages/components/index.js +2 -2
- package/cypress/pages/components/opacityComponent.js +1 -1
- package/cypress/pages/components/scoringSectionBaseEditTab.js +18 -0
- package/cypress/pages/components/studentResponseAreaAndLayoutComponent.js +1 -1
- package/cypress/pages/dialogBoxBase.js +1 -1
- package/cypress/pages/drawingResponsePage.js +35 -4
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +2 -2
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +2 -0
- package/cypress/pages/geogebraActivityPage.js +106 -0
- package/cypress/pages/graphingPage.js +1458 -77
- package/cypress/pages/index.js +1 -0
- package/cypress/pages/multipleSelectionPage.js +0 -1
- package/cypress/pages/shortTextResponsePage.js +155 -3
- package/cypress/pages/uploadResponsePage.js +0 -2
- package/package.json +1 -1
@@ -0,0 +1,98 @@
|
|
1
|
+
import { geoGebraActivityPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const fontSizeDropdownOptions = ['Tiny', 'Small', 'Default', 'Normal', 'Big', 'Huge'];
|
6
|
+
const fontSizes = ['12px', '14px', '16px', '18px', '22px', '26px'];
|
7
|
+
|
8
|
+
describe('Create item page - GeoGebra activity: Additional Settings accordion', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Additional Settings accordion', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
});
|
19
|
+
geoGebraActivityPage.tests.verifyAdditonalSettingsAccordionProperties();
|
20
|
+
});
|
21
|
+
|
22
|
+
describe('Additional settings: Font size contents', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
before(() => {
|
25
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
26
|
+
cy.barsPreLoaderWait();
|
27
|
+
geoGebraActivityPage.steps.expandAdditonalSettings();
|
28
|
+
});
|
29
|
+
geoGebraActivityPage.tests.verifyFontSizeSectionContents();
|
30
|
+
});
|
31
|
+
|
32
|
+
describe('Additional settings: Font size functionality edit tab', () => {
|
33
|
+
abortEarlySetup();
|
34
|
+
before(() => {
|
35
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
36
|
+
cy.barsPreLoaderWait();
|
37
|
+
geoGebraActivityPage.steps.addGeoGebraResourceLink();
|
38
|
+
geoGebraActivityPage.steps.expandAdditonalSettings();
|
39
|
+
});
|
40
|
+
|
41
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
42
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the edit tab geoGebra resource should stay 16px`, () => {
|
43
|
+
geoGebraActivityPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
|
44
|
+
utilities.verifyInnerText(geoGebraActivityPage.fontSizeDropdown(), `${option}`);
|
45
|
+
utilities.verifyCSS(geoGebraActivityPage.geoGebraItemCanvas(), {
|
46
|
+
'font-size': css.fontSize.default
|
47
|
+
});
|
48
|
+
});
|
49
|
+
});
|
50
|
+
});
|
51
|
+
|
52
|
+
describe('Additional settings: Font size functionality preview tab', () => {
|
53
|
+
abortEarlySetup();
|
54
|
+
before(() => {
|
55
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
56
|
+
cy.barsPreLoaderWait();
|
57
|
+
geoGebraActivityPage.steps.addQuestionInstructions();
|
58
|
+
geoGebraActivityPage.steps.addGeoGebraResourceLink();
|
59
|
+
geoGebraActivityPage.steps.expandAdditonalSettings();
|
60
|
+
});
|
61
|
+
|
62
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
63
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${option} accordingly`, () => {
|
64
|
+
geoGebraActivityPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
|
65
|
+
utilities.verifyInnerText(geoGebraActivityPage.fontSizeDropdown(), `${option}`);
|
66
|
+
geoGebraActivityPage.steps.switchToPreviewTab();
|
67
|
+
utilities.verifyCSS(geoGebraActivityPage.questionInstructionsText(), {
|
68
|
+
'font-size': fontSizes[fontsIndex]
|
69
|
+
});
|
70
|
+
utilities.verifyCSS(geoGebraActivityPage.geoGebraCanvasPreviewTab(), {
|
71
|
+
'font-size': css.fontSize.default
|
72
|
+
});
|
73
|
+
geoGebraActivityPage.steps.switchToEditTab();
|
74
|
+
});
|
75
|
+
});
|
76
|
+
});
|
77
|
+
|
78
|
+
//Failing due to https://redmine.zeuslearning.com/issues/564166
|
79
|
+
describe('Setting tab: Accessibility section', () => {
|
80
|
+
abortEarlySetup();
|
81
|
+
before(() => {
|
82
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
83
|
+
geoGebraActivityPage.steps.expandAdditonalSettings();
|
84
|
+
});
|
85
|
+
|
86
|
+
geoGebraActivityPage.tests.verifyAdditionalSettingsAccessibilitySection();
|
87
|
+
});
|
88
|
+
|
89
|
+
describe('Additional Settings: Details section', () => {
|
90
|
+
abortEarlySetup();
|
91
|
+
before(() => {
|
92
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
93
|
+
cy.barsPreLoaderWait();
|
94
|
+
geoGebraActivityPage.steps.expandAdditonalSettings();
|
95
|
+
});
|
96
|
+
geoGebraActivityPage.tests.verifyDetailsSection();
|
97
|
+
});
|
98
|
+
});
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import { geoGebraActivityPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create item page - GeoGebra activity: Edit tab scoring section', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Scoring section contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
});
|
17
|
+
|
18
|
+
geoGebraActivityPage.tests.verifyScoringTypeLabelAndDropdown('manuallyScored');
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Manually scored scoring type - Scoring section', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
25
|
+
});
|
26
|
+
|
27
|
+
it('When the user selects \'Manually scored\' option from the Scoring Type dropdown, then the \'Points\' label and input field should be displayed and and \'Minimum score awarded (if attempted)\' should not be displayed', () => {
|
28
|
+
geoGebraActivityPage.steps.expandScoringTypeDropdown();
|
29
|
+
geoGebraActivityPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
|
30
|
+
geoGebraActivityPage.steps.verifyDefaultPointsLabelAndInputField();
|
31
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.minimumPointsLabel(), 'notExist');
|
32
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.minimumPointsInputField(), 'notExist');
|
33
|
+
});
|
34
|
+
|
35
|
+
geoGebraActivityPage.tests.verifyPointsFieldErrorState();
|
36
|
+
});
|
37
|
+
|
38
|
+
describe('Non scored scoring - Scoring section', () => {
|
39
|
+
abortEarlySetup();
|
40
|
+
before(() => {
|
41
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
42
|
+
cy.barsPreLoaderWait();
|
43
|
+
});
|
44
|
+
|
45
|
+
it('User should be able to select \'Non scored\' scoring type from scoring type dropdown', () => {
|
46
|
+
geoGebraActivityPage.steps.expandScoringTypeDropdown();
|
47
|
+
geoGebraActivityPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
|
48
|
+
});
|
49
|
+
|
50
|
+
geoGebraActivityPage.tests.verifyPointsLabelAndInputFieldForNonScoredScoringType();
|
51
|
+
|
52
|
+
geoGebraActivityPage.tests.verifyScoringSectionContentsForNonScoredScoringType();
|
53
|
+
|
54
|
+
geoGebraActivityPage.tests.verifyCSSAndA11yOfDisabledPointsInputField();
|
55
|
+
});
|
56
|
+
});
|
@@ -0,0 +1,106 @@
|
|
1
|
+
import { correctAnswerViewPage, geoGebraActivityPage, itemPreviewPage, studentViewPage, gradingViewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
|
6
|
+
const views = utilities.getViews(gradingAndCorrectAnsView);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
describe('Create item page - Desmos: Grading view, Correct answer view contents', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
if (views.includes('Grading view')) {
|
15
|
+
describe('Grading view contents', { tags: 'smoke' }, () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
geoGebraActivityPage.steps.addQuestionInstructions();
|
21
|
+
geoGebraActivityPage.steps.addGeoGebraResourceLink();
|
22
|
+
geoGebraActivityPage.steps.addInputToWidthInputField(450);
|
23
|
+
geoGebraActivityPage.steps.addInputToHeightInputField(400);
|
24
|
+
geoGebraActivityPage.steps.allotPoints(10);
|
25
|
+
geoGebraActivityPage.steps.clickOnSaveQuestionButton();
|
26
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
27
|
+
//Global variable issue, not working inside before
|
28
|
+
itemPreviewPage.referenceID()
|
29
|
+
.invoke('text')
|
30
|
+
.then(($refID) => {
|
31
|
+
itemReferenceID = $refID;
|
32
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
33
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.geoGebraCanvasPreviewTab(), 'visible');
|
34
|
+
geoGebraActivityPage.steps.provideStudentResponseInStudentView();
|
35
|
+
studentViewPage.steps.submitResponse();
|
36
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
37
|
+
});
|
38
|
+
});
|
39
|
+
|
40
|
+
it('Question instructions should be visible', () => {
|
41
|
+
utilities.verifyInnerText(geoGebraActivityPage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
42
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.questionInstructionsText(), 'visible');
|
43
|
+
});
|
44
|
+
|
45
|
+
it('The geoGebra resource should be displayed as per the set dimensions', () => {
|
46
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.geoGebraCanvasPreviewTab(), 'visible');
|
47
|
+
geoGebraActivityPage.steps.verifyCanvasWidthPreviewTab(450);
|
48
|
+
geoGebraActivityPage.steps.verifyCanvasHeightPreviewTab(400);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('All the geoGebra resource tools should be visible', () => {
|
52
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.geoGebraResourceToolbarToolPreviewTab(), 'visible');
|
53
|
+
utilities.verifyElementCount(geoGebraActivityPage.geoGebraResourceToolbarToolPreviewTab(), '11');
|
54
|
+
});
|
55
|
+
|
56
|
+
it('Empty score input field and total score should be displayed', () => {
|
57
|
+
gradingViewPage.steps.verifyGradingViewScore('', 10);
|
58
|
+
});
|
59
|
+
|
60
|
+
it('Accessibility of content in the response field', { tags: 'a11y' }, () => {
|
61
|
+
cy.checkAccessibility(geoGebraActivityPage.geoGebraCanvasWrapperPreviewTab());
|
62
|
+
});
|
63
|
+
});
|
64
|
+
}
|
65
|
+
|
66
|
+
//Need to re-visit once https://redmine.zeuslearning.com/issues/555456 is resolved
|
67
|
+
if (views.includes('Correct answer view')) {
|
68
|
+
describe('Correct answer view contents', { tags: 'smoke' }, () => {
|
69
|
+
abortEarlySetup();
|
70
|
+
before(() => {
|
71
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
72
|
+
cy.barsPreLoaderWait();
|
73
|
+
geoGebraActivityPage.steps.addQuestionInstructions();
|
74
|
+
geoGebraActivityPage.steps.addGeoGebraResourceLink();
|
75
|
+
geoGebraActivityPage.steps.addInputToWidthInputField(450);
|
76
|
+
geoGebraActivityPage.steps.addInputToHeightInputField(400);
|
77
|
+
geoGebraActivityPage.steps.allotPoints(10);
|
78
|
+
geoGebraActivityPage.steps.clickOnSaveQuestionButton();
|
79
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
80
|
+
//Global variable issue, not working inside before
|
81
|
+
itemPreviewPage.referenceID()
|
82
|
+
.invoke('text')
|
83
|
+
.then(($refID) => {
|
84
|
+
itemReferenceID = $refID
|
85
|
+
cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
|
86
|
+
});
|
87
|
+
});
|
88
|
+
|
89
|
+
it('Question instructions should be visible', () => {
|
90
|
+
utilities.verifyTextContent(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
91
|
+
utilities.verifyElementVisibilityState(correctAnswerViewPage.correctAnswerViewQuestionInstructions(), 'visible');
|
92
|
+
});
|
93
|
+
|
94
|
+
it('\'This is a manual scored question\' help text should be displayed in the correct answer view', () => {
|
95
|
+
utilities.verifyTextContent(correctAnswerViewPage.manualScoredQuestionHelpText(), 'This is a manual scored question.');
|
96
|
+
utilities.verifyElementVisibilityState(correctAnswerViewPage.manualScoredQuestionHelpText(), 'visible');
|
97
|
+
});
|
98
|
+
|
99
|
+
it('The points alloted to the question should be displayed', () => {
|
100
|
+
correctAnswerViewPage.steps.verifyAvailablePoints(10);
|
101
|
+
});
|
102
|
+
|
103
|
+
//Need to add CSS and A11y here once updated designs are available for correct answer
|
104
|
+
});
|
105
|
+
}
|
106
|
+
});
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import { dialogBoxBase, geoGebraActivityPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
describe('Create item page - GeoGebra activity: Question instructions', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Header section contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
});
|
16
|
+
|
17
|
+
geoGebraActivityPage.tests.verifyCreateQuestionPageQuestionTypeHeader('GeoGebra activity');
|
18
|
+
});
|
19
|
+
|
20
|
+
describe('Tabs section', () => {
|
21
|
+
abortEarlySetup();
|
22
|
+
before(() => {
|
23
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
24
|
+
cy.barsPreLoaderWait();
|
25
|
+
});
|
26
|
+
|
27
|
+
geoGebraActivityPage.tests.verifyTabsSection();
|
28
|
+
});
|
29
|
+
|
30
|
+
describe('Cancel button', () => {
|
31
|
+
abortEarlySetup();
|
32
|
+
before(() => {
|
33
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
34
|
+
cy.barsPreLoaderWait();
|
35
|
+
});
|
36
|
+
|
37
|
+
geoGebraActivityPage.tests.verifyCancelButton('GeoGebra activity')
|
38
|
+
});
|
39
|
+
|
40
|
+
describe('Save Question button', () => {
|
41
|
+
abortEarlySetup();
|
42
|
+
before(() => {
|
43
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
44
|
+
cy.barsPreLoaderWait();
|
45
|
+
});
|
46
|
+
|
47
|
+
describe('Validation error messages', () => {
|
48
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
49
|
+
|
50
|
+
it('Validation error messages should be displayed below required input fields', () => {
|
51
|
+
geoGebraActivityPage.steps.verifyQuestionInstructionsErrorMessage();
|
52
|
+
utilities.verifyInnerText(utilities.getNthElement(geoGebraActivityPage.errorMessage(), 1), 'Error: Resource link is required.');
|
53
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(geoGebraActivityPage.errorMessage(), 1), 'visible');
|
54
|
+
geoGebraActivityPage.steps.verifyPointsFieldErrorMessage();
|
55
|
+
});
|
56
|
+
|
57
|
+
it('Validation error messages should disappear when required input fields are filled', () => {
|
58
|
+
geoGebraActivityPage.steps.addTextInQuestionInstructionsInputField('Select correct option from dropdown');
|
59
|
+
geoGebraActivityPage.steps.addGeoGebraResourceLink();
|
60
|
+
geoGebraActivityPage.steps.allotPoints(10);
|
61
|
+
geoGebraActivityPage.steps.verifyErrorMessageIsNotDisplayed();
|
62
|
+
});
|
63
|
+
|
64
|
+
geoGebraActivityPage.tests.verifyCreateItemWrapperContentsA11y();
|
65
|
+
});
|
66
|
+
|
67
|
+
describe('Saving a question', () => {
|
68
|
+
it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
69
|
+
geoGebraActivityPage.steps.saveAQuestionAndVerifySnackbar();
|
70
|
+
});
|
71
|
+
geoGebraActivityPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
72
|
+
});
|
73
|
+
});
|
74
|
+
});
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { geoGebraActivityPage, itemPreviewPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
let previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view'];
|
6
|
+
const views = utilities.getViews(previewContentViews);
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
9
|
+
describe('Create item page - GeoGebra activity: Preview contents', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
views.forEach((view) => {
|
15
|
+
describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
switch (view) {
|
19
|
+
case 'Question preview':
|
20
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
21
|
+
cy.barsPreLoaderWait();
|
22
|
+
geoGebraActivityPage.steps.addQuestionInstructions();
|
23
|
+
geoGebraActivityPage.steps.addGeoGebraResourceLink();
|
24
|
+
geoGebraActivityPage.steps.addInputToWidthInputField(450);
|
25
|
+
geoGebraActivityPage.steps.addInputToHeightInputField(400);
|
26
|
+
geoGebraActivityPage.steps.allotPoints(10);
|
27
|
+
geoGebraActivityPage.steps.switchToPreviewTab();
|
28
|
+
break;
|
29
|
+
case 'Item view':
|
30
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
31
|
+
break;
|
32
|
+
case 'Item preview':
|
33
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
34
|
+
geoGebraActivityPage.steps.switchToPreviewTab();
|
35
|
+
break;
|
36
|
+
case 'Student view':
|
37
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
38
|
+
break;
|
39
|
+
default:
|
40
|
+
throw new Error('Invalid view');
|
41
|
+
}
|
42
|
+
});
|
43
|
+
|
44
|
+
after(() => {
|
45
|
+
if (view === 'Question preview') {
|
46
|
+
geoGebraActivityPage.steps.clickOnSaveQuestionButton();
|
47
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
48
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
49
|
+
}
|
50
|
+
});
|
51
|
+
|
52
|
+
it('Question instructions should be visible', () => {
|
53
|
+
utilities.verifyInnerText(geoGebraActivityPage.questionInstructionsText(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
|
54
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.questionInstructionsText(), 'visible');
|
55
|
+
});
|
56
|
+
|
57
|
+
it('The geoGebra resource should be displayed as per the set dimensions', () => {
|
58
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.geoGebraCanvasPreviewTab(), 'visible');
|
59
|
+
geoGebraActivityPage.steps.verifyCanvasWidthPreviewTab(450);
|
60
|
+
geoGebraActivityPage.steps.verifyCanvasHeightPreviewTab(400);
|
61
|
+
});
|
62
|
+
|
63
|
+
it('Full screen button should be displayed in the geoGebra resource', () => {
|
64
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.geoGebraResourceFullScreenButtonPreviewTab(), 'visible');
|
65
|
+
});
|
66
|
+
|
67
|
+
it('All the geoGebra resource tools should be visible', () => {
|
68
|
+
utilities.verifyElementVisibilityState(geoGebraActivityPage.geoGebraResourceToolbarToolPreviewTab(), 'visible');
|
69
|
+
utilities.verifyElementCount(geoGebraActivityPage.geoGebraResourceToolbarToolPreviewTab(), '11');
|
70
|
+
});
|
71
|
+
|
72
|
+
it('CSS of preview tab contents', { tags: 'css' }, () => {
|
73
|
+
utilities.verifyCSS(geoGebraActivityPage.questionInstructionsText(), {
|
74
|
+
'color': css.color.text,
|
75
|
+
'font-size': css.fontSize.default,
|
76
|
+
'font-weight': css.fontWeight.regular
|
77
|
+
});
|
78
|
+
utilities.verifyCSS(geoGebraActivityPage.geoGebraCanvasWrapperPreviewTab().find('.GeoGebraFrame'), {
|
79
|
+
'border': `1px solid ${css.color.geoGebraCanvasBorder}`
|
80
|
+
});
|
81
|
+
utilities.verifyCSS(geoGebraActivityPage.geoGebraCanvasPreviewTab(), {
|
82
|
+
'font-size': css.fontSize.default
|
83
|
+
});
|
84
|
+
});
|
85
|
+
|
86
|
+
it('Accessibility of preview tab contents', { tags: 'a11y' }, () => {
|
87
|
+
cy.checkAccessibility(geoGebraActivityPage.geoGebraCanvasWrapperPreviewTab().parents('[class*="GeogebraActivityPreviewstyle__Wrapper"]'));
|
88
|
+
});
|
89
|
+
});
|
90
|
+
});
|
91
|
+
});
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { geoGebraActivityPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create item page - GeoGebra activity: Question instructions', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Question instructions input field - Edit tab', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
});
|
15
|
+
|
16
|
+
geoGebraActivityPage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Question instructions input field - Preview tab', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
geoGebraActivityPage.steps.navigateToCreateQuestion('GeoGebra activity');
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
});
|
25
|
+
|
26
|
+
geoGebraActivityPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
27
|
+
});
|
28
|
+
});
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import { graphingPage } from "../../../../pages";
|
2
|
+
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create item page - Graphing: Penalty scoring and Round negative score to zero', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Question preview: Auto scored - All or nothing: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
graphingPage.steps.addTextInQuestionInstructionsInputField('Plot the graph');
|
15
|
+
graphingPage.steps.selectToolOptions(['Circle', 'Polygon']);
|
16
|
+
graphingPage.steps.checkPatternBackground();
|
17
|
+
graphingPage.steps.checkSnapToGridCheckbox();
|
18
|
+
graphingPage.steps.selectGraphToolOptionEditTab('Line');
|
19
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
20
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: -5, yRange: 20 }]);
|
21
|
+
graphingPage.steps.selectGraphToolOptionEditTab('Circle');
|
22
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
23
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 0, xRange: 20, y: 0, yRange: 20 }, { x: 0, xRange: 20, y: 5, yRange: 20 }]);
|
24
|
+
graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Polygon');
|
25
|
+
graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
26
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
27
|
+
graphingPage.steps.selectGraphToolOptionSpecifyCorrectAnswer('Vector');
|
28
|
+
graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
29
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 6, xRange: 20, y: 0, yRange: 20 }, { x: 6, xRange: 20, y: 5, yRange: 20 }]);
|
30
|
+
graphingPage.steps.allotPoints(20);
|
31
|
+
});
|
32
|
+
|
33
|
+
//Penalty points for the entire question
|
34
|
+
it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
|
35
|
+
graphingPage.steps.expandPenaltyScoringDropdown();
|
36
|
+
graphingPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
|
37
|
+
graphingPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
|
38
|
+
graphingPage.steps.allotPenaltyPoints(2);
|
39
|
+
graphingPage.steps.switchToPreviewTab();
|
40
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
|
41
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
42
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
43
|
+
graphingPage.steps.verifyPreviewScore(-2, 20);
|
44
|
+
});
|
45
|
+
|
46
|
+
it('When the user attempts the question partially correct along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
|
47
|
+
graphingPage.steps.resetQuestionPreview();
|
48
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
|
49
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: -4, yRange: 20 }, { x: -3, xRange: 20, y: 4, yRange: 20 }]);
|
50
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
|
51
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
52
|
+
graphingPage.steps.verifyPreviewScore(-2, 20);
|
53
|
+
});
|
54
|
+
|
55
|
+
it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
|
56
|
+
graphingPage.steps.resetQuestionPreview();
|
57
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
|
58
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: 4, yRange: 20 }, { x: 3, xRange: 20, y: -4, yRange: 20 }, { x: -3, xRange: 20, y: 4, yRange: 20 }]);
|
59
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Polygon');
|
60
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -6, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 7, yRange: 20 }, { x: -4, xRange: 20, y: 9, yRange: 20 }, { x: -6, xRange: 20, y: 9, yRange: 20 }]);
|
61
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
|
62
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
63
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
64
|
+
graphingPage.steps.verifyPreviewScore(-2, 20);
|
65
|
+
});
|
66
|
+
|
67
|
+
it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
|
68
|
+
graphingPage.steps.switchToEditTab();
|
69
|
+
graphingPage.steps.expandMinimumScoringDropdown();
|
70
|
+
graphingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
|
71
|
+
graphingPage.steps.allotMinimumPoints(3);
|
72
|
+
graphingPage.steps.switchToPreviewTab();
|
73
|
+
graphingPage.steps.selectGraphToolOptionPreviewTab('Circle');
|
74
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
75
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: -2, xRange: 20, y: 1, yRange: 20 }, { x: -4, xRange: 20, y: 1, yRange: 20 }]);
|
76
|
+
graphingPage.steps.verifyPreviewScore(3, 20);
|
77
|
+
});
|
78
|
+
});
|
79
|
+
});
|