itemengine-cypress-automation 1.0.128 → 1.0.129

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,37 +2,7 @@ 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";
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
- })
5
+ import { verifyIeQuestionData } from "../../support/migrationHelpers/verifyIeQuestionData";
36
6
 
37
7
  const migrationQuestionTypes = Cypress.env('migrationQuestionTypes');//["drawingResponse"]
38
8
  const migrationQuestionTypesLrn = migrationQuestionTypes.map((questionType) => lrnQuestionTypesENUM[questionType]);
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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', () => {
@@ -127,16 +97,9 @@ if (referenceIds.length > 0) {
127
97
  currQuestionType = lrnQuestionTypesENUM.mcq
128
98
  }
129
99
  if (migrationQuestionTypesLrn.includes(currQuestionType)) {
130
- switch (currQuestionType) {
131
- case lrnQuestionTypesENUM.mcq: return extractLrnQuestionData.mcqGrading(lrnGradingDataArr, index);
132
- case lrnQuestionTypesENUM.textEntryMath: return extractLrnQuestionData.textEntryMathGrading(lrnGradingDataArr, index);
133
- case lrnQuestionTypesENUM.textEntryMathImage: return extractLrnQuestionData.textEntryMathImageGrading(lrnGradingDataArr, index);
134
- case lrnQuestionTypesENUM.essayResponse:
135
- case lrnQuestionTypesENUM.essayResponseBasic:
136
- case lrnQuestionTypesENUM.drawingResponse:
137
- return;
138
- default: throw new Error('Invalid lrn question type');
139
- }
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);
140
103
  }
141
104
  });
142
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
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.128",
3
+ "version": "1.0.129",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {