@kogeet/scapin-core-agent 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"runstep.d.ts","sourceRoot":"","sources":["../../src/core/runstep.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAG5C,MAAM,CAAC,OAAO,OAAO,OAAO;IAE1B;;;;;OAKG;IACU,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAgBlF"}
1
+ {"version":3,"file":"runstep.d.ts","sourceRoot":"","sources":["../../src/core/runstep.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAG5C,MAAM,CAAC,OAAO,OAAO,OAAO;IAE1B;;;;;OAKG;IACU,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAqBlF"}
@@ -15,8 +15,14 @@ export default class RunStep {
15
15
  retour = await fct(stepCtx);
16
16
  }
17
17
  catch (e) {
18
- // erreur d'exécution de la fonction => codage
19
- report.error(`Function execution error : ${e.message}`);
18
+ const errMsg = e.message;
19
+ if (errMsg === 'LOCATOR_TIMEOUT') {
20
+ throw new Error('LOCATOR_TIMEOUT');
21
+ }
22
+ else {
23
+ // erreur d'exécution de la fonction => codage
24
+ report.error(`Function execution error : ${errMsg}`);
25
+ }
20
26
  }
21
27
  }
22
28
  return retour;
@@ -1 +1 @@
1
- {"version":3,"file":"runsteps.d.ts","sourceRoot":"","sources":["../../src/core/runsteps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAA;AAM5D,qBAAa,QAAQ;IACnB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,OAAO,CAA2B;IACnC,IAAI,EAAE,OAAO,CAAQ;IAEf,GAAG,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,GAAG,SAAS;YAwB1D,QAAQ;CAmBvB"}
1
+ {"version":3,"file":"runsteps.d.ts","sourceRoot":"","sources":["../../src/core/runsteps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAA;AAM5D,qBAAa,QAAQ;IACnB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,OAAO,CAA2B;IACnC,IAAI,EAAE,OAAO,CAAQ;IAEf,GAAG,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,GAAG,SAAS;YAoB1D,QAAQ;CAwBvB"}
@@ -13,10 +13,6 @@ export class RunSteps {
13
13
  context.resetVariables();
14
14
  for (const step of rundata) {
15
15
  await this.runAStep(step);
16
- // suppression de la prise en compte du stop si erreur parce qu'il fait bugger l'automatisation des campagnes
17
- // if (stopIfError) {
18
- // break
19
- // }
20
16
  if (this.stop) {
21
17
  break;
22
18
  }
@@ -36,11 +32,17 @@ export class RunSteps {
36
32
  stepResult = await this.runstep.run(this.stepCtx, step.lib, step.fn);
37
33
  }
38
34
  catch (e) {
39
- report.warning('Unexpected error : ' + e.message);
35
+ const errMsg = e.message;
36
+ if (errMsg === 'LOCATOR_TIMEOUT') {
37
+ report.error('Fatal error : Unable to find element that match mapping data');
38
+ this.stop = true;
39
+ }
40
+ else {
41
+ report.warning('Unexpected error : ' + errMsg);
42
+ }
40
43
  stepResult = false;
41
44
  }
42
45
  report.stepEnd(stepResult);
43
- // wsServer.send(report.getJsonStepReport(this.ctx, this.stepCtx))
44
46
  wSocketIo.report(report.getJsonStepReport(this.stepCtx), report.getStepStatus());
45
47
  return report.getStopOnError();
46
48
  }
package/bin/index.d.ts CHANGED
@@ -2,5 +2,8 @@ import { Context, context } from "./core/context.js";
2
2
  import { Report, report } from "./core/report.js";
3
3
  import sagent from "./core/app.sagent.js";
4
4
  import wSocketIo from "./core/wsocket.io.js";
5
- export { sagent, context, Context, report, Report, wSocketIo };
5
+ import StepContext from "./core/step.context.js";
6
+ import type { RunParamModel } from "./models/run.model.js";
7
+ export { sagent, context, Context, report, Report, wSocketIo, StepContext };
8
+ export type { RunParamModel };
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAE5C,OAAO,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACV,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,WAAW,EACZ,CAAA;AAED,YAAY,EAAE,aAAa,EAAE,CAAA"}
package/bin/index.js CHANGED
@@ -2,4 +2,5 @@ import { Context, context } from "./core/context.js";
2
2
  import { Report, report } from "./core/report.js";
3
3
  import sagent from "./core/app.sagent.js";
4
4
  import wSocketIo from "./core/wsocket.io.js";
5
- export { sagent, context, Context, report, Report, wSocketIo };
5
+ import StepContext from "./core/step.context.js";
6
+ export { sagent, context, Context, report, Report, wSocketIo, StepContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kogeet/scapin-core-agent",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Scapin Core Agent",
5
5
  "author": "Loïc Griveau",
6
6
  "license": "MIT",