itemengine-cypress-automation 1.0.299-minorUpdated7thFeb-2e116a9.0 → 1.0.299-minorUpdated7thFeb-2458641.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -15,6 +15,7 @@ ENV CI=1
15
15
  RUN chmod +x ./deploy/e2e/run.sh
16
16
  RUN chmod +x ./deploy/smoke/run.sh
17
17
  RUN chmod +x ./deploy/migration/run.sh
18
+ RUN chmod +x ./deploy/essayQuestion/run.sh
18
19
 
19
20
  RUN npm ci
20
21
 
@@ -0,0 +1,30 @@
1
+ global:
2
+ team: itemengine
3
+ name: item-engine-ui-essay-response
4
+ type: integration_test
5
+
6
+ variables:
7
+ START_TIME: "$(date +%s)"
8
+
9
+ deployment:
10
+ job:
11
+ backoffLimit: 25
12
+ activeDeadlineSeconds: 7200
13
+ parallelism: 7
14
+ completions: 7
15
+
16
+ image:
17
+ cmd: /ie-e2e/deploy/essayQuestion/run.sh
18
+
19
+ resources:
20
+ limits:
21
+ memory: 8446Mi
22
+ cpu: 5000m
23
+ requests:
24
+ memory: 4096Mi
25
+ cpu: 2000m
26
+
27
+ env:
28
+ instance:
29
+ - name: START_TIME
30
+ value: "${{ variables.START_TIME }}"
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+ env=$STAGE
3
+ echo Environment to test: $env
4
+ echo START_TIME: $START_TIME
5
+ echo "Running Essay Response question test"
6
+
7
+ npm run spinnaker:essayResponse
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.299-minorUpdated7thFeb-2e116a9.0",
3
+ "version": "1.0.299-minorUpdated7thFeb-2458641.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,8 @@
17
17
  "cy:ildev": "cypress open --env fileConfig=ildev",
18
18
  "cy:ilprod": "cypress open --env fileConfig=ilprod",
19
19
  "cy:ilqa": "cypress open --env fileConfig=ilqa",
20
- "cy:ilstage": "cypress open --env fileConfig=ilstage"
20
+ "cy:ilstage": "cypress open --env fileConfig=ilstage",
21
+ "spinnaker:essayResponse": "node scripts/questions.mjs --env theme=ilc,questionType=EssayResponse,grepTags=-css+-a11y"
21
22
  },
22
23
  "repository": {
23
24
  "type": "git",
@@ -0,0 +1,3 @@
1
+ import { runSorryCypressQuestions } from "./sorry-cypress.mjs";
2
+
3
+ runSorryCypressQuestions();
@@ -172,4 +172,24 @@ export async function runSorryCypressLocalMigration() {
172
172
  let command = `npx cypress run --browser chrome --env fileConfig=ilqa,theme=ilc,migrationQuestionTypes=${questionTypes} --spec "cypress/e2e/migration/*.js"`;
173
173
  console.log(`command: ${command}`);
174
174
  execSync(command, { stdio: "inherit" });
175
- }
175
+ }
176
+
177
+ // Functions to execute cypress tests specific to Question Types
178
+ export function runSorryCypressQuestions() {
179
+ process.env.CYPRESS_API_URL = "https://cypress-director.imaginelearning.tech/";
180
+ const user = OS.userInfo().username;
181
+ startTime = Math.round(Date.now() / 1000000);
182
+ ciBuildId = setCiBuildId(user, startTime);
183
+ const envArgs = setCommandLineEnvArgs();
184
+ console.log("🚀 ~ runSorryCypressQuestions ~ envArgs:", envArgs)
185
+
186
+ // Extracting questionType from envArgs
187
+ const match = envArgs.match(/questionType=([^,]+)/);
188
+ console.log("🚀 ~ runSorryCypressQuestions ~ match:", match)
189
+ const questionType = match ? match[1] : "**"; // Default to "**" if not found
190
+ console.log("🚀 ~ runSorryCypressQuestions ~ questionType:", questionType)
191
+
192
+ let command = `cy2 run --parallel --browser chrome --record --key imaginelearning/itemengine-cypress-automation --ci-build-id ${ciBuildId} ${envArgs} --spec "cypress/e2e/ILC/${questionType}/*.js"`;
193
+ console.log(`command: ${command}`);
194
+ execSync(command, { stdio: "inherit" });
195
+ }