itemengine-cypress-automation 1.0.127 → 1.0.129

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.
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse", "essayResponseBasic", "mcq"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100);//["d15153f9-fe28-4407-851e-bc2d36551711", "2f4fd7c7-8d5a-48b8-96fa-5d729238033f", "0715a48c-4c1f-4eed-8058-793ad9402f89", "9835f858-9866-43ad-a79b-d8da59723d3b"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(0, 100);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(900, 1000);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(900, 1000);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(100, 200);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(100, 200);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(200, 300);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(200, 300);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(300, 400);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(300, 400);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(400, 500);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(400, 500);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(500, 600);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(500, 600);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(600, 700);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(600, 700);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(700, 800);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(700, 800);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,39 +2,9 @@ import { autoScoredScoringPreviewTab } from "../../pages/components";
2
2
  import utilities from "../../support/helpers/utilities";
3
3
  import { extractLrnQuestionData, lrnPage } from "../../support/migrationHelpers/extractLrnQuestionData";
4
4
  import lrnQuestionTypesENUM from "../../support/migrationHelpers/lrnQestionTypesENUM";
5
- import { iePage, verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
6
6
 
7
- Cypress.Commands.add('learnosityLoaderWait', () => {
8
- // cy.get('.lrn-spinner')
9
- // .should('be.visible');
10
- lrnPage.questionsLoader()
11
- .should('not.be.visible');
12
- lrnPage.questionWrapper()
13
- .eq(0)
14
- .should('be.visible');
15
- });
16
-
17
- Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
18
- iePage.questionWrapper()
19
- .then((elements) => {
20
- if (retries <= 0) {
21
- throw new Error('Itemengine questions did not lazy load in time');
22
- };
23
- if (elements.length < count) {
24
- iePage.questionWrapper()
25
- .last()
26
- .scrollIntoView()
27
- .wait(1000);
28
- cy.lazyLoadPreviewQuestions(count, retries - 1)
29
- };
30
- cy.log('All question parts loaded');
31
- });
32
- iePage.barsPreloader()
33
- .should('not.exist');
34
- cy.learnosityLoaderWait();
35
- })
36
-
37
- const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["essayResponse"]
7
+ const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
39
9
  let lrnMcqTypesRegex = /Multiple choice – standard|Multiple choice – multiple response|True or false|Multiple choice – block layout/;
40
10
  let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
@@ -43,7 +13,7 @@ let lrnEssayResponseRegex = /Math essay with rich text|Essay with rich text/
43
13
  let lrnQuestionDataArr = [];
44
14
  let lrnGradingDataArr = [];
45
15
 
46
- let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(800, 900);//["0715a48c-4c1f-4eed-8058-793ad9402f89", "c476e9ca-2ac6-4ebc-b548-241ef3cd13bb"]
16
+ let referenceIds = JSON.parse(Cypress.env('referenceIds')).slice(800, 900);//["85f864fd-8ce9-4d9d-a326-afb13963d6bd", "6ff35364-0fb6-4cc4-b09c-426f6199e3d6", "d5644e39-1f23-4c4d-a6ad-f80fee66cb62"]
47
17
 
48
18
  if (referenceIds.length > 0) {
49
19
  describe('Migration item check for MCQ questions', () => {
@@ -89,6 +59,7 @@ if (referenceIds.length > 0) {
89
59
  case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImage(lrnQuestionDataArr, index);
90
60
  case lrnQuestionTypesENUM.essayResponse: return extractLrnQuestionData.essayResponse(lrnQuestionDataArr, index);
91
61
  case lrnQuestionTypesENUM.essayResponseBasic: return extractLrnQuestionData.essayResponseBasic(lrnQuestionDataArr, index);
62
+ case lrnQuestionTypesENUM.drawingResponse: return extractLrnQuestionData.drawingResponse(lrnQuestionDataArr, index);
92
63
  default: throw new Error('Invalid lrn question type');
93
64
  }
94
65
  }
@@ -107,6 +78,7 @@ if (referenceIds.length > 0) {
107
78
  case 'textEntryMathImage': return verifyIeQuestionData.textEntryMathImage(questionData, index);
108
79
  case 'essayResponse': return verifyIeQuestionData.essayResponse(questionData, index);
109
80
  case 'essayResponseBasic': return verifyIeQuestionData.essayResponseBasic(questionData, index);
81
+ case 'drawingResponse': return verifyIeQuestionData.drawingResponse(questionData, index);
110
82
  default: throw new Error('Invalid ngie question type');
111
83
  }
112
84
  });
@@ -125,15 +97,9 @@ if (referenceIds.length > 0) {
125
97
  currQuestionType = lrnQuestionTypesENUM.mcq
126
98
  }
127
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
128
- switch (currQuestionType) {
129
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
130
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
131
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.essayResponse:
133
- case lrnQuestionTypesENUM.essayResponseBasic:
134
- return;
135
- default: throw new Error('Invalid lrn question type');
136
- }
100
+ if (currQuestionType === lrnQuestionTypesENUM.mcq) extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
101
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMath) extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
102
+ else if (currQuestionType === lrnQuestionTypesENUM.textEntryMathImage) extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
137
103
  }
138
104
  });
139
105
  }
@@ -2,6 +2,8 @@ import crypto from 'crypto';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import "cypress-real-events/support";
4
4
  import 'cypress-file-upload';
5
+ import { iePage } from './migrationHelpers/verifyIeQuestionData';
6
+ import { lrnPage } from './migrationHelpers/extractLrnQuestionData';
5
7
  require('cy-verify-downloads').addCustomCommand();
6
8
  //import addContext from "mochawesome/addContext";
7
9
 
@@ -140,4 +142,34 @@ Cypress.Commands.add('barsPreLoaderWait', () => {
140
142
  cy.get('[id="question-item-instruction-loader"]')
141
143
  .find('img')
142
144
  .should('not.be.visible');
143
- });
145
+ });
146
+
147
+ Cypress.Commands.add('learnosityLoaderWait', () => {
148
+ // cy.get('.lrn-spinner')
149
+ // .should('be.visible');
150
+ lrnPage.questionsLoader()
151
+ .should('not.be.visible');
152
+ lrnPage.questionWrapper()
153
+ .eq(0)
154
+ .should('be.visible');
155
+ });
156
+
157
+ Cypress.Commands.add('lazyLoadPreviewQuestions', (count, retries = 5) => {
158
+ iePage.questionWrapper()
159
+ .then((elements) => {
160
+ if (retries <= 0) {
161
+ throw new Error('Itemengine questions did not lazy load in time');
162
+ };
163
+ if (elements.length < count) {
164
+ iePage.questionWrapper()
165
+ .last()
166
+ .scrollIntoView()
167
+ .wait(1000);
168
+ cy.lazyLoadPreviewQuestions(count, retries - 1)
169
+ };
170
+ cy.log('All question parts loaded');
171
+ });
172
+ iePage.barsPreloader()
173
+ .should('not.exist');
174
+ cy.learnosityLoaderWait();
175
+ })
@@ -0,0 +1,12 @@
1
+ const drawingToolbarOptionsENUM = {
2
+ "Scribble": "Scribble",
3
+ "Line": "line",
4
+ "Compass": "compass",
5
+ "Eraser": "item eraser",
6
+ "Clear": "clear all",
7
+ "Undo": "undo",
8
+ "Redo": "redo",
9
+ "Text": "text",
10
+ }
11
+
12
+ export default drawingToolbarOptionsENUM;
@@ -17,6 +17,9 @@ export const lrnPage = {
17
17
  essayResponseFooter: () => cy.get('.lrn-toolbar-footer'),
18
18
  essayResponseToolbarWordCountWrapper: () => cy.get('.lrn_toolbar_right'),
19
19
  essayResponseWordLimit: () => cy.get('.lrn_word_limit'),
20
+ drawingToolbar: () => cy.get('.lrn_toolbar'),
21
+ drawingToolbarButton: () => cy.get('.lrn_btn'),
22
+ drawingCanvasImage: () => cy.get('.lrn-canvas-container .lrn-image-source'),
20
23
  steps: {
21
24
  checkShowAnswersToggle: () => {
22
25
  lrnPage.showAnswersToggle()
@@ -328,6 +331,41 @@ export const extractLrnQuestionData = {
328
331
  });
329
332
  lrnQuestionDataArr.push(obj);
330
333
  },
334
+
335
+ drawingResponse: (lrnQuestionDataArr, index) => {
336
+ let obj = {};
337
+ cy.log(`Extracting the question instructions and options from question ${index}`);
338
+ obj.questionIndex = index;
339
+ obj.questionType = 'drawingResponse'
340
+ lrnPage.questionWrapper()
341
+ .eq(index)
342
+ .within(() => {
343
+ lrnPage.questionInstructions()
344
+ .then(($ins) => {
345
+ let text = $ins[0].innerText;
346
+ obj.previewQuestionInstructions = text;
347
+ });
348
+ let toolbarButtons = [];
349
+ lrnPage.drawingToolbar()
350
+ .eq(0)
351
+ .within(() => {
352
+ lrnPage.drawingToolbarButton()
353
+ .each(($button) => {
354
+ let ariaLabel = $button[0].attributes["aria-label"].nodeValue;
355
+ toolbarButtons.push(ariaLabel);
356
+ });
357
+ });
358
+ obj.toolbarButtons = toolbarButtons;
359
+ lrnPage.drawingCanvasImage()
360
+ .then(($img) => {
361
+ let backgroundCanvasImage = $img[0].alt;
362
+ obj.backgroundCanvasImage = backgroundCanvasImage;
363
+ let backgroundImageWidth = $img[0].style.width;
364
+ obj.backgroundImageWidth = backgroundImageWidth;
365
+ });
366
+ });
367
+ lrnQuestionDataArr.push(obj);
368
+ },
331
369
  /* singleSelection: (lrnQuestionDataArr, index) => {
332
370
  let obj = {};
333
371
  cy.log(`Extracting the question instructions and options from question ${index}`);
@@ -4,6 +4,7 @@ const lrnQuestionTypesENUM = {
4
4
  textEntryMathImage: 'Cloze math with image',
5
5
  essayResponse: 'essayResponse',
6
6
  essayResponseBasic: 'Essay with plain text',
7
+ drawingResponse: 'Drawing',
7
8
  singleSelection: 'Multiple choice – standard',
8
9
  multipleSelection: 'Multiple choice – multiple response',
9
10
  trueOrFalse: 'True or false',
@@ -1,6 +1,7 @@
1
1
  import { essayResponsePage, multipleSelectionPage } from "../../pages";
2
2
  import { singleSelectionPage } from "../../pages/singleSelectionPage"
3
3
  import utilities from "../helpers/utilities";
4
+ import drawingToolbarOptionsENUM from "./drawingToolbarOptionsENUM";
4
5
  import essayResponseToolbarOptionsENUM from "./essayResponseToolbarOptionsENUM";
5
6
 
6
7
  export const iePage = {
@@ -16,6 +17,8 @@ export const iePage = {
16
17
  essayResponseWordLimit: () => cy.get('.input-limit-label'),
17
18
  essayResponseWordCount: () => cy.get('[class*="indexstyle__WordCharCountWrapper"]'),
18
19
  essayResponseFooter: () => cy.get('.essay-character-view-wrapper'),
20
+ drawingResponseToolbarButton: () => cy.get('[class*="DrawingToolButtonstyled__Container"] svg'),
21
+ drawingResponseLowerCanvas: () => cy.get('.lower-canvas'),
19
22
  };
20
23
 
21
24
  export const verifyIeQuestionData = {
@@ -228,6 +231,35 @@ export const verifyIeQuestionData = {
228
231
  });
229
232
  },
230
233
 
234
+ drawingResponse: (expectedQuestionData, index) => {
235
+ cy.get('[class*="DrawingResponsePreviewstyles__Question"]')
236
+ .eq(index)
237
+ .within(() => {
238
+ utilities.verifyInnerText(singleSelectionPage.questionInstructionsText(), expectedQuestionData.previewQuestionInstructions);
239
+ let ieButtonsActual = [];
240
+ let ieButtonsExpected = expectedQuestionData.toolbarButtons.map((button) => {
241
+ return drawingToolbarOptionsENUM[button];
242
+ });
243
+ iePage.drawingResponseToolbarButton()
244
+ .each(($button) => {
245
+ let ariaLabel = $button[0].attributes["aria-label"].nodeValue;
246
+ ieButtonsActual.push(ariaLabel);
247
+ }).then(() => {
248
+ expect(ieButtonsActual).to.have.deep.members(ieButtonsExpected);
249
+ });
250
+ iePage.drawingResponseLowerCanvas()
251
+ .then(($canvas) => {
252
+ let ariaLabel = $canvas[0].attributes["aria-label"].nodeValue;
253
+ if (expectedQuestionData.backgroundCanvasImage) {
254
+ expect(ariaLabel).to.be.eq(expectedQuestionData.backgroundCanvasImage);
255
+ } else {
256
+ expect(ariaLabel).to.be.eq('Image');
257
+ }
258
+ //need to verify backgroundImageWidth currently it is varying in all drawing response migrated items
259
+ });
260
+ });
261
+ },
262
+
231
263
  /* singleSelection: (expectedQuestionData, index) => {
232
264
  cy.get('.ngie-single-select')
233
265
  .eq(index)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.127",
3
+ "version": "1.0.129",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {