itemengine-cypress-automation 1.0.348 → 1.0.350-feature-thinkSphere-01c175a.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.
@@ -1,6 +1,6 @@
1
1
  import utilities from "../../support/helpers/utilities";
2
2
  import { dialogBoxBase } from "../dialogBoxBase";
3
- import { createQuestionBasePage } from "../components/createQuestionBasePage.js";
3
+ import { createQuestionBasePage } from "../components";
4
4
  import { questionInstructionsComponent } from "../components/questionInstructionsComponent";
5
5
 
6
6
  const css = Cypress.env('css');
@@ -7,6 +7,7 @@ const selectors = {
7
7
  tooltipText: () => cy.get('[class*="MuiTooltip-tooltip"]:visible'),
8
8
  snackbar: () => cy.get('.MuiSnackbarContent-message'),
9
9
  snackbarCloseButton: () => cy.get('.MuiSnackbarContent-action'),
10
+ popoverContainer: () => cy.get('.ngie-popover-container'),
10
11
  //Remove :visible https://redmine.zeuslearning.com/issues/564243 gets resolved
11
12
  errorMessage: () => cy.get('.error-text-message:visible'),
12
13
  nextGenCreateItemWrapper: () => cy.get('#nextgen-assess-create-item'),
@@ -17,7 +18,9 @@ const selectors = {
17
18
  tickIconForOptionButtons: () => cy.get('.ngie-toggle-button-tick-icon'),
18
19
  errorIcon: () => cy.get('[id="Icon_material-error"]'),
19
20
  alertMessage: () => cy.get('[role="alert"]:visible'),
20
- warningIcon: () => cy.get('[class*="WarningIcon"]')
21
+ warningIcon: () => cy.get('[class*="WarningIcon"]'),
22
+ buttonDesktopViewToggle: () => cy.get('[aria-label*="Desktop View toggle button"]'),
23
+ buttonMobileViewToggle: () => cy.get('[aria-label*="Mobile View toggle button"]'),
21
24
  }
22
25
 
23
26
  const steps = {
@@ -227,7 +227,7 @@ const tests = {
227
227
  it('When user has made some edits/changes and clicks on cancel button, a popup should be displayed with message \'Are you sure you want to leave this page? Your changes have not been saved.\'', () => {
228
228
  selectQuestionResourceToolPage.steps.selectQuestionType(questionType);
229
229
  questionInstructionsComponent.steps.addTextInQuestionInstructionsInputField('Edited');
230
- if (questionType !== 'feedback scale' && questionType !== 'highlight image') {
230
+ if (questionType !== 'feedback scale' && questionType !== 'highlight image' && questionType !== 'think sphere') {
231
231
  scoringSectionBaseEditTab.steps.allotPoints(20);
232
232
  };
233
233
  createQuestionBasePage.cancelButton()
@@ -31,10 +31,11 @@ const steps = {
31
31
  }
32
32
 
33
33
  const tests = {
34
- verifyDefaultToolDropdown:(toolOptionsArray)=>{
35
- it('\'Default tool\' label and dropdown should be displayed with \'Point\' option selected by default', () => {
34
+ verifyDefaultToolDropdown:(toolOptionsArray, defaultTool)=>{
35
+ const defaultSelectedTool = defaultTool || toolOptionsArray[0];
36
+ it(`\'Default tool\' label and dropdown should be displayed with \'${defaultSelectedTool}\' option selected by default`, () => {
36
37
  utilities.verifyInnerText(defaultToolDropdown.defaultToolDropdownLabel(), 'Default tool');
37
- utilities.verifyInnerText(defaultToolDropdown.defaultToolDropdown(), toolOptionsArray[0]);
38
+ utilities.verifyInnerText(defaultToolDropdown.defaultToolDropdown(), defaultSelectedTool);
38
39
  });
39
40
 
40
41
  it(`${toolOptionsArray} options should be displayed when the user expands the \'Default tool\' dropdown`, () => {
@@ -53,19 +54,19 @@ const tests = {
53
54
  'font-size': css.fontSize.normal,
54
55
  'font-weight': css.fontWeight.semibold
55
56
  });
56
- utilities.verifyCSS(defaultToolDropdown.defaultToolDropdownOptions('Point'), {
57
+ utilities.verifyCSS(defaultToolDropdown.defaultToolDropdownOptions(toolOptionsArray[0]), {
57
58
  'color': css.color.liText,
58
59
  'background-color': css.color.liTextSelectedBg,
59
60
  'font-size': css.fontSize.default,
60
61
  'font-weight': css.fontWeight.regular
61
62
  });
62
- utilities.verifyCSS(defaultToolDropdown.defaultToolDropdownOptions('Segment'), {
63
+ utilities.verifyCSS(defaultToolDropdown.defaultToolDropdownOptions(toolOptionsArray[1]), {
63
64
  'color': css.color.liText,
64
65
  'background-color': css.color.transparent,
65
66
  'font-size': css.fontSize.default,
66
67
  'font-weight': css.fontWeight.regular
67
68
  });
68
- defaultToolDropdown.steps.selectOptionFromDefaultToolDropdown('Point');
69
+ defaultToolDropdown.steps.selectOptionFromDefaultToolDropdown(defaultSelectedTool);
69
70
  });
70
71
  }
71
72
  }
@@ -4,6 +4,7 @@ const css = Cypress.env('css');
4
4
 
5
5
  const selectors = {
6
6
  dialogBox: () => cy.get('[aria-labelledby="alert-dialog-title"]'),
7
+ dialogBoxRoot: () => cy.get('[class*="MuiDialog-paper"]'),
7
8
  dialogBoxTitle: () => cy.get('.dialog-title'),
8
9
  dialogBoxContent: () => cy.get('[class*="dialog-content"]'),
9
10
  buttonReject: () => cy.get('[data-testid="reject-button"]'),
@@ -102,4 +103,4 @@ export const dialogBoxBase = {
102
103
  ...selectors,
103
104
  steps,
104
105
  tests
105
- }
106
+ };
@@ -45,6 +45,7 @@ export * from './gridFillPage';
45
45
  export * from './geoGebraToolsPage';
46
46
  export * from './matchingPage';
47
47
  export * from './brainingCampManipulativePage';
48
+ export * from './thinkSpherePage';
48
49
  export * from './numberLinePage';
49
50
  export * from './textSelectionPage';
50
51
  export * from './chartsBarPage';
@@ -52,4 +53,4 @@ export * from './chartsLinePage';
52
53
  export * from './numberLineLabelPage';
53
54
  export * from './chartsDotPlotPage';
54
55
  export * from './imageHighlightPage';
55
- export * from './compassPage';
56
+ export * from './compassPage';
@@ -15,7 +15,8 @@ const selectors = {
15
15
  },
16
16
  selectAQuestionHeaderText: () => cy.get('[class*="QuestionResourceToolstyles__HeaderText"]'),
17
17
  questionTypeCategory: () => cy.get('[class*="QuestionResourceToolstyles__CategorySection"]'),
18
- resourceTypeCategory: () => cy.get('.MuiCard-root')
18
+ resourceTypeCategory: () => cy.get('.MuiCard-root'),
19
+ cancelCreateQuestionButton: () => cy.get('[class*="QuestionResourceToolstyles__CreateItemHeader"] .ngie-btn-outlined').contains('cancel'),
19
20
  }
20
21
 
21
22
  const questionTypeCategoryMap = {
@@ -64,7 +65,12 @@ const steps = {
64
65
  selectQuestionResourceToolPage.resourceAndToolOptionTitle(resourceCategory)
65
66
  .click();
66
67
  }
67
- }
68
+ },
69
+
70
+ clickOnCancelCreateQuestionButton: () => {
71
+ selectQuestionResourceToolPage.cancelCreateQuestionButton()
72
+ .click();
73
+ },
68
74
  }
69
75
 
70
76
  export const selectQuestionResourceToolPage = {