@autometa/runner 0.2.58 → 0.3.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/CHANGELOG.md +25 -0
- package/dist/esm/index.js +24 -14
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @autometa/runner
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 98d911f: feat: replace tsyringe with custom DI solution
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [98d911f]
|
|
12
|
+
- @autometa/jest-executor@0.4.0
|
|
13
|
+
- @autometa/coordinator@0.3.0
|
|
14
|
+
- @autometa/injection@0.1.0
|
|
15
|
+
- @autometa/http@1.2.0
|
|
16
|
+
- @autometa/app@0.3.0
|
|
17
|
+
- @autometa/config@0.1.19
|
|
18
|
+
- @autometa/scopes@0.4.12
|
|
19
|
+
- @autometa/test-builder@0.1.41
|
|
20
|
+
|
|
21
|
+
## 0.2.59
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [4bbe6fc]
|
|
26
|
+
- @autometa/http@1.1.0
|
|
27
|
+
|
|
3
28
|
## 0.2.58
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -30,10 +30,12 @@ __export(src_exports, {
|
|
|
30
30
|
App: () => App,
|
|
31
31
|
AppType: () => AppType,
|
|
32
32
|
AutomationError: () => AutomationError,
|
|
33
|
-
AutometaApp: () =>
|
|
34
|
-
AutometaWorld: () =>
|
|
33
|
+
AutometaApp: () => AutometaApp,
|
|
34
|
+
AutometaWorld: () => AutometaWorld,
|
|
35
35
|
Before: () => Before2,
|
|
36
36
|
Bind: () => Bind,
|
|
37
|
+
Constructor: () => Constructor,
|
|
38
|
+
Container: () => Container,
|
|
37
39
|
DataTable: () => DataTable,
|
|
38
40
|
Dates: () => Dates,
|
|
39
41
|
Feature: () => Feature2,
|
|
@@ -42,6 +44,8 @@ __export(src_exports, {
|
|
|
42
44
|
GetAssignedValues: () => GetAssignedValues,
|
|
43
45
|
Given: () => Given2,
|
|
44
46
|
HTable: () => HTable,
|
|
47
|
+
INJECTION_SCOPE: () => INJECTION_SCOPE,
|
|
48
|
+
InjectionScope: () => InjectionScope,
|
|
45
49
|
MTable: () => MTable,
|
|
46
50
|
Pass: () => Pass,
|
|
47
51
|
Rule: () => Rule2,
|
|
@@ -58,7 +62,6 @@ __export(src_exports, {
|
|
|
58
62
|
World: () => World,
|
|
59
63
|
defineConfig: () => defineConfig,
|
|
60
64
|
defineParameterType: () => defineParameterType,
|
|
61
|
-
getApp: () => getApp,
|
|
62
65
|
makeTestEmitter: () => makeTestEmitter,
|
|
63
66
|
raise: () => raise
|
|
64
67
|
});
|
|
@@ -284,13 +287,15 @@ var executor = execute;
|
|
|
284
287
|
// src/app.ts
|
|
285
288
|
import "@autometa/types";
|
|
286
289
|
import { AppType as at } from "@autometa/app";
|
|
290
|
+
import { AutometaApp, AutometaWorld, App, World } from "@autometa/app";
|
|
287
291
|
import {
|
|
288
292
|
Fixture,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
293
|
+
INJECTION_SCOPE,
|
|
294
|
+
InjectionScope,
|
|
295
|
+
Token,
|
|
296
|
+
Container,
|
|
297
|
+
Constructor
|
|
298
|
+
} from "@autometa/injection";
|
|
294
299
|
var OPTS = {};
|
|
295
300
|
var AppType = at.bind(null, OPTS);
|
|
296
301
|
|
|
@@ -318,9 +323,7 @@ Global.onFeatureExecuted = (feature, caller) => {
|
|
|
318
323
|
|
|
319
324
|
// src/index.ts
|
|
320
325
|
__reExport(src_exports, events_exports);
|
|
321
|
-
import { getApp } from "@autometa/app";
|
|
322
326
|
export * from "@autometa/phrases";
|
|
323
|
-
import { App, World, AutometaApp as AutometaApp2, AutometaWorld as AutometaWorld2 } from "@autometa/app";
|
|
324
327
|
import { Dates, Time } from "@autometa/datetime";
|
|
325
328
|
import { AutomationError, raise } from "@autometa/errors";
|
|
326
329
|
import { DataTable, HTable, VTable, MTable } from "@autometa/gherkin";
|
|
@@ -328,7 +331,11 @@ import { Bind } from "@autometa/bind-decorator";
|
|
|
328
331
|
import { Types } from "@autometa/scopes";
|
|
329
332
|
export * from "@autometa/http";
|
|
330
333
|
export * from "@autometa/asserters";
|
|
331
|
-
import {
|
|
334
|
+
import {
|
|
335
|
+
GetAccessedCount,
|
|
336
|
+
GetAssignedValues,
|
|
337
|
+
TrackAccess
|
|
338
|
+
} from "@autometa/fixture-proxies";
|
|
332
339
|
function Feature2(...args) {
|
|
333
340
|
return Feature(...args);
|
|
334
341
|
}
|
|
@@ -353,10 +360,12 @@ export {
|
|
|
353
360
|
App,
|
|
354
361
|
AppType,
|
|
355
362
|
AutomationError,
|
|
356
|
-
|
|
357
|
-
|
|
363
|
+
AutometaApp,
|
|
364
|
+
AutometaWorld,
|
|
358
365
|
Before2 as Before,
|
|
359
366
|
Bind,
|
|
367
|
+
Constructor,
|
|
368
|
+
Container,
|
|
360
369
|
DataTable,
|
|
361
370
|
Dates,
|
|
362
371
|
Feature2 as Feature,
|
|
@@ -365,6 +374,8 @@ export {
|
|
|
365
374
|
GetAssignedValues,
|
|
366
375
|
Given2 as Given,
|
|
367
376
|
HTable,
|
|
377
|
+
INJECTION_SCOPE,
|
|
378
|
+
InjectionScope,
|
|
368
379
|
MTable,
|
|
369
380
|
Pass,
|
|
370
381
|
Rule2 as Rule,
|
|
@@ -381,7 +392,6 @@ export {
|
|
|
381
392
|
World,
|
|
382
393
|
defineConfig,
|
|
383
394
|
defineParameterType,
|
|
384
|
-
getApp,
|
|
385
395
|
makeTestEmitter,
|
|
386
396
|
raise
|
|
387
397
|
};
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/config.ts","../../src/parameters.ts","../../src/scopes.ts","../../src/events.ts","../../src/event-logger.ts","../../src/executor.ts","../../src/app.ts"],"sourcesContent":["import type {\n FeatureAction,\n FeatureScope,\n ScenarioAction,\n ScenarioScope,\n SizedTimeout,\n TestTimeout\n} from \"@autometa/scopes\";\n\nexport { defineConfig } from \"./config\";\nexport { defineParameterType } from \"./parameters\";\nimport {\n Feature as FeatureDefinition,\n Scenario as ScenarioDefinition,\n ScenarioOutline as ScenarioOutlineDefinition,\n Rule as RuleDefinition,\n Given as GivenDefinition,\n When as WhenDefinition,\n Then as ThenDefinition,\n Before as BeforeDefinition,\n After as AfterDefinition,\n Teardown as TeardownDefinition,\n Setup as SetupDefinition\n} from \"./scopes\";\nimport { RuleAction } from \"@autometa/scopes\";\nexport { getApp } from \"@autometa/app\";\nimport { RuleScope } from \"@autometa/scopes\";\nexport { Pass } from \"./scopes\";\nexport * from \"@autometa/phrases\";\nexport { App, World, AutometaApp, AutometaWorld } from \"@autometa/app\";\nexport { AppType, Fixture } from \"./app\";\nexport { Dates, Time } from \"@autometa/datetime\";\nexport { AutomationError, raise } from \"@autometa/errors\";\nexport { DataTable, HTable, VTable, MTable } from \"@autometa/gherkin\";\nexport { Bind } from \"@autometa/bind-decorator\";\nexport { Types } from \"@autometa/scopes\";\nexport * from \"./events\";\nexport * from \"@autometa/http\";\nexport * from \"@autometa/asserters\";\nexport { GetAccessedCount, GetAssignedValues, TrackAccess } from \"@autometa/fixture-proxies\";\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n *\n * ``ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * Feature('../features/my-feature.feature')\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber stle.\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n */\nexport function Feature(filepath: string): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n * // 10 second timeout\n * Feature('../features/my-feature.feature', 10_000)\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber style.\n *\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n * @param timeout The timeout in milliseconds to apply to all tests within the feature.\n */\nexport function Feature(filepath: string, timeout: number): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout as a `TestTimeout` which is a tuple of `[durationNumber, 'ms' | 's' | 'm' | 'h']`\n * which will be applied to all tests within the feature.\n *\n * i.e. `[10, 's']` is a 10 second timeout. `[1, 'm']` is a 1 minute timeout.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('../features/my-feature.feature', [10, 's'])\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * };\n *\n * ```\n *\n * @param filepath\n * @param timeout\n */\nexport function Feature(filepath: string, timeout: TestTimeout): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * })\n * ```ts\n *\n * If defined in the Gherkin, it will also use any Globally defined Step Definitions which match,\n * if none is defined locally. If a Step Definition is defined both globally and locally,\n * the most local definition will be used. This applies to sub-scopes like Scenarios and Rules\n * also.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n *\n * Scenario('My Scenario', () => {\n * Given('I have a step', () => {})\n * })\n *\n * Rule('My Rule', () => {\n * Given('I have a step', () => {})\n * })\n *\n * @param testDefinition\n * @param filepath\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string\n): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * }, 10_000)\n * ```\n * @param testDefinition the Feature definition callback\n * @param filepath\n * @param timeout\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string,\n timeout: number\n): FeatureScope;\nexport function Feature(\n ...args: (FeatureAction | string | TestTimeout)[]\n): FeatureScope {\n return FeatureDefinition(...args);\n}\n\nexport function Scenario(title: string, action: ScenarioAction): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function Scenario(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioDefinition(...args);\n}\n\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function ScenarioOutline(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioOutlineDefinition(...args);\n}\n\nexport function Rule(title: string, action: RuleAction): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: number\n): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: SizedTimeout\n): RuleScope;\nexport function Rule(\n ...args: (string | RuleAction | SizedTimeout | number)[]\n): RuleScope {\n return RuleDefinition(...args);\n}\n/**\n * Defines a `Given` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n * \n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n * \n * N.b. The App instance is shared between all step definitions and hooks within\n * the context of a scenario, but cannot be accessed from the same step in a different\n * scenario.\n * \n * ```ts\n * import { Given } from '@autometa/runner'\n * \n * Given('I have a step', (app) => {\n * app.world.someData = 'some value'\n * })\n * // using destructuring\n * Given('I have a step', ({ world }) => {\n * world.someData = 'some value'\n * })\n * ```\n * \n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n * \n * ```ts\n * import { Given } from '@autometa/runner'\n * \n * // matches 'Given I have a step with a 'blue' value'\n * Given('I have a step with a {string} value', (value, { world }) => {\n * world.someData = value\n * })\n * \n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Given = GivenDefinition;\n/**\n * Defines a `When` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n * \n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n * \n * N.b. The App instance is shared between all step definitions and hooks within\n * \n * ```ts\n * import { When } from '@autometa/runner'\n * \n * When('I do something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * When('I do something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n * \n * ```ts\n * import { When } from '@autometa/runner'\n * \n * // matches 'When I do something with a 'blue' value'\n * When('I do something with a {string} value', async (value, { webdriver }) => {\n * await webdriver.click(`#some-button-${value}`)\n * })\n * \n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const When = WhenDefinition;\n\n/**\n * Defines a `Then` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n * \n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n * \n * N.b. The App instance is shared between all step definitions and hooks within\n * \n * ```ts\n * import { Then } from '@autometa/runner'\n * \n * Then('I expect something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Then('I expect something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n * \n * ```ts\n * import { Then } from '@autometa/runner'\n * \n * // matches 'Then I expect something with a 'blue' value'\n * Then('I expect something with a {string} value', async (value, { world }) => {\n * expect(world.someData).toBe(value)\n * })\n * \n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Then = ThenDefinition;\n\n/**\n * Defines a `Before` hook. Executes before each scenario.\n * \n * ```ts\n * import { Before } from '@autometa/runner'\n * \n * Before(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Before(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const Before = BeforeDefinition;\n\n/**\n * Defines a `After` hook. Executes after each scenario.\n * \n * ```ts\n * import { After } from '@autometa/runner'\n * \n * After(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * After(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const After = AfterDefinition;\n\n/**\n * Defines a `Setup` hook. Executes before all scenarios.\n * Setups are scoped, meaning a Setup defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n * \n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleton fixture.\n * \n * ```ts\n * import { Setup } from '@autometa/runner'\n * \n * Setup(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Setup(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const Teardown = TeardownDefinition;\n\n/**\n * Defines a `Teardown` hook. Executes after all scenarios have completed.\n * Teardowns are scoped, meaning a Teardown defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n * \n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleston fixture.\n * ```ts\n * import { Teardown } from '@autometa/runner'\n * \n * Teardown(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Teardown(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const Setup = SetupDefinition;\n\n\n","import {\n Config,\n TestExecutorConfig,\n defineConfig as dc\n} from \"@autometa/config\";\n\nexport const CONFIG = new Config(new Map<string, TestExecutorConfig>());\nexport const defineConfig = dc.bind(null, CONFIG);\n","import { ParameterTypeRegistry } from \"@cucumber/cucumber-expressions\";\nimport {\n BooleanParam,\n DateParam,\n NumberParam,\n PrimitiveParam,\n OrdinalParam,\n TextParam,\n defineParameterType as dpt\n} from \"@autometa/cucumber-expressions\";\n\nexport const PARAM_REGISTRY = new ParameterTypeRegistry();\n\n/**\n * Defines a parameter type for use in step definitions.\n * \n * ```ts\n * import { Color } from '../support/color';\n * \n * defineParameterType({\n * name: \"color\",\n * regexpPattern: /red|blue|yellow/,\n * transform: (value: string) => Color(value)\n * })\n * \n * // using regex arrays\n * defineParameterType({\n * name: \"color\",\n * regexpPattern: [/red/, /blue/, /yellow/],\n * transform: (value: string) => Color(value)\n * })\n * ```\n */\nexport const defineParameterType = dpt.bind(null, PARAM_REGISTRY);\n\ndefineParameterType(\n NumberParam,\n BooleanParam,\n PrimitiveParam,\n TextParam,\n DateParam,\n OrdinalParam\n);\n","import { PARAM_REGISTRY } from \"./parameters\";\nimport { GetCucumberFunctions, Pass } from \"@autometa/scopes\";\nimport { Coordinator } from \"@autometa/coordinator\";\nimport { CONFIG } from \"./config\";\nimport { makeTestEmitter } from \"./events\";\nimport { executor } from \"./executor\";\nimport { OPTS } from \"./app\";\nconst {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Global\n} = GetCucumberFunctions(PARAM_REGISTRY);\nconst coordinator = new Coordinator(Global, CONFIG, OPTS);\nGlobal.onFeatureExecuted = (feature, caller) => {\n const groupLogger = CONFIG.current.test?.groupLogging ?? false;\n const events = makeTestEmitter({ groupLogger });\n coordinator.run(feature, caller, events, executor);\n};\n\nexport {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Pass\n};\n","import { TestEventEmitter } from \"@autometa/events\";\nimport { CONFIG } from \"./config\";\nexport * from \"@autometa/events\";\nimport { GroupLogEvents } from \"./event-logger\";\nimport p from \"path\";\nexport function makeTestEmitter(opts: { groupLogger: boolean }) {\n const events = CONFIG.current.events;\n const emitter = new TestEventEmitter();\n if (opts.groupLogger) {\n emitter.load(new GroupLogEvents());\n }\n if (!events) {\n return emitter;\n }\n\n for (const event of events) {\n const isLocal = isRelativePath(event) || isAbsolutePath(event);\n if (isLocal) {\n const uriRoot = process.cwd();\n const uri = p.join(uriRoot, event);\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(uri);\n if('default' in listener && typeof listener.default === \"function\") {\n emitter.load(new listener.default());\n return emitter;\n }\n if('default' in listener && typeof listener.default === \"object\") {\n emitter.load(listener.default);\n return emitter;\n }\n if(typeof listener === \"function\") {\n emitter.load(new listener());\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(event);\n if('default' in listener) {\n emitter.load(listener.default);\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n\n return emitter;\n}\n\nfunction isRelativePath(path: string) {\n return path.startsWith(\".\");\n}\n\nfunction isAbsolutePath(path: string) {\n return p.isAbsolute(path);\n}\n","import {\n EndAfterOpts,\n EndBeforeOpts,\n EndFeatureOpts,\n EndRuleOpts,\n EndScenarioOpts,\n EndScenarioOutlineOpts,\n EndSetupOpts,\n EndStepOpts,\n EndTeardownOpts,\n EventSubscriber,\n StartAfterOpts,\n StartBeforeOpts,\n StartFeatureOpts,\n StartRuleOpts,\n StartScenarioOpts,\n StartScenarioOutlineOpts,\n StartSetupOpts,\n StartStepOpts,\n StartTeardownOpts\n} from \"@autometa/events\";\nimport colors from \"colors-cli\";\nexport class GroupLogEvents implements EventSubscriber {\n onFeatureStart({ title }: StartFeatureOpts) {\n console.group(title);\n console.group();\n }\n onFeatureEnd({ title, status }: EndFeatureOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioStart({ title }: StartScenarioOpts): void {\n console.group(title);\n console.group();\n }\n onScenarioEnd({ title, status }: EndScenarioOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioOutlineStart(opts: StartScenarioOutlineOpts): void {\n console.group(opts.title);\n console.group();\n }\n onScenarioOutlineEnd({ title, status }: EndScenarioOutlineOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onRuleStart({ title }: StartRuleOpts): void {\n console.group(title);\n console.group();\n }\n onRuleEnd({ title, status }: EndRuleOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onStepStart({ title }: StartStepOpts) {\n console.group(title);\n console.group();\n }\n onStepEnd({ title, status }: EndStepOpts) {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onBeforeStart({ title, status }: StartBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onBeforeEnd({ title, status }: EndBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onAfterStart({ title, status }: StartAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onAfterEnd({ title, status }: EndAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onTeardownStart({ title, status }: StartTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onTeardownEnd({ title, status }: EndTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onSetupStart({title, status}: StartSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.group(title);\n console.group();\n }\n onSetupEnd({ title, status }: EndSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n}\nfunction colorStatus(\n status: \"FAILED\" | \"PASSED\" | \"SKIPPED\" | \"BROKEN\" | undefined,\n text: string\n) {\n switch (status) {\n case \"FAILED\":\n return `${colors.red(\"x\")} ${text}`;\n case \"PASSED\":\n return `${colors.green(\"✔️\")} ${text}`;\n case \"SKIPPED\":\n return `${colors.yellow(\"⊘\")} ${text}`;\n default:\n return text;\n }\n}\n","import { execute } from \"@autometa/jest-executor\";\n\nexport const executor = execute;\n","import \"@autometa/types\";\nimport { AppType as at } from \"@autometa/app\";\nimport { CoordinatorOpts } from \"@autometa/coordinator\";\nexport {\n Fixture,\n LIFE_CYCLE,\n Lifecycle,\n AutometaApp,\n AutometaWorld\n} from \"@autometa/app\";\nexport const OPTS = {} as Record<string, CoordinatorOpts>;\nexport const AppType = at.bind(null, OPTS);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA,qBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,eAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA,EACE;AAAA,EA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QAAQ,IAAI;AACxD,OAAO,oBAAoB,CAAC,SAAS,WAAW;AAC9C,QAAM,cAAc,OAAO,QAAQ,MAAM,gBAAgB;AACzD,QAAM,SAAS,gBAAgB,EAAE,YAAY,CAAC;AAC9C,cAAY,IAAI,SAAS,QAAQ,QAAQ,QAAQ;AACnD;;;AHUA,wBAAc;AAXd,SAAS,cAAc;AAGvB,cAAc;AACd,SAAS,KAAK,OAAO,eAAAC,cAAa,iBAAAC,sBAAqB;AAEvD,SAAS,OAAO,YAAY;AAC5B,SAAS,iBAAiB,aAAa;AACvC,SAAS,WAAW,QAAQ,QAAQ,cAAc;AAClD,SAAS,YAAY;AACrB,SAAS,aAAa;AAEtB,cAAc;AACd,cAAc;AACd,SAAS,kBAAkB,mBAAmB,mBAAmB;AA0L1D,SAASC,YACX,MACW;AACd,SAAO,QAAkB,GAAG,IAAI;AAClC;AAaO,SAASC,aACX,MACY;AACf,SAAO,SAAmB,GAAG,IAAI;AACnC;AAgBO,SAASC,oBACX,MACY;AACf,SAAO,gBAA0B,GAAG,IAAI;AAC1C;AAaO,SAASC,SACX,MACQ;AACX,SAAO,KAAe,GAAG,IAAI;AAC/B;AAuCO,IAAMC,SAAQ;AAsCd,IAAMC,QAAO;AAuCb,IAAMC,QAAO;AAoBb,IAAMC,UAAS;AAoBf,IAAMC,SAAQ;AA0Bd,IAAMC,YAAW;AAyBjB,IAAMC,SAAQ;","names":["After","AutometaApp","AutometaWorld","Before","Feature","Given","Rule","Scenario","ScenarioOutline","Setup","Teardown","Then","When","listener","AutometaApp","AutometaWorld","Feature","Scenario","ScenarioOutline","Rule","Given","When","Then","Before","After","Teardown","Setup"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/config.ts","../../src/parameters.ts","../../src/scopes.ts","../../src/events.ts","../../src/event-logger.ts","../../src/executor.ts","../../src/app.ts"],"sourcesContent":["import type {\n FeatureAction,\n FeatureScope,\n ScenarioAction,\n ScenarioScope,\n SizedTimeout,\n TestTimeout\n} from \"@autometa/scopes\";\n\nexport { defineConfig } from \"./config\";\nexport { defineParameterType } from \"./parameters\";\nimport {\n Feature as FeatureDefinition,\n Scenario as ScenarioDefinition,\n ScenarioOutline as ScenarioOutlineDefinition,\n Rule as RuleDefinition,\n Given as GivenDefinition,\n When as WhenDefinition,\n Then as ThenDefinition,\n Before as BeforeDefinition,\n After as AfterDefinition,\n Teardown as TeardownDefinition,\n Setup as SetupDefinition\n} from \"./scopes\";\nimport { RuleAction } from \"@autometa/scopes\";\nimport { RuleScope } from \"@autometa/scopes\";\nexport { Pass } from \"./scopes\";\nexport * from \"@autometa/phrases\";\nexport {\n AppType,\n Fixture,\n Container,\n Constructor,\n AutometaApp,\n AutometaWorld,\n App,\n World,\n INJECTION_SCOPE,\n InjectionScope\n} from \"./app\";\nexport { Dates, Time } from \"@autometa/datetime\";\nexport { AutomationError, raise } from \"@autometa/errors\";\nexport { DataTable, HTable, VTable, MTable } from \"@autometa/gherkin\";\nexport { Bind } from \"@autometa/bind-decorator\";\nexport { Types } from \"@autometa/scopes\";\nexport * from \"./events\";\nexport * from \"@autometa/http\";\nexport * from \"@autometa/asserters\";\nexport {\n GetAccessedCount,\n GetAssignedValues,\n TrackAccess\n} from \"@autometa/fixture-proxies\";\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n *\n * ``ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * Feature('../features/my-feature.feature')\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber stle.\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n */\nexport function Feature(filepath: string): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n * // 10 second timeout\n * Feature('../features/my-feature.feature', 10_000)\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber style.\n *\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n * @param timeout The timeout in milliseconds to apply to all tests within the feature.\n */\nexport function Feature(filepath: string, timeout: number): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout as a `TestTimeout` which is a tuple of `[durationNumber, 'ms' | 's' | 'm' | 'h']`\n * which will be applied to all tests within the feature.\n *\n * i.e. `[10, 's']` is a 10 second timeout. `[1, 'm']` is a 1 minute timeout.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('../features/my-feature.feature', [10, 's'])\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * };\n *\n * ```\n *\n * @param filepath\n * @param timeout\n */\nexport function Feature(filepath: string, timeout: TestTimeout): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * })\n * ```\n *\n * If defined in the Gherkin, it will also use any Globally defined Step Definitions which match,\n * if none is defined locally. If a Step Definition is defined both globally and locally,\n * the most local definition will be used. This applies to sub-scopes like Scenarios and Rules\n * also.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n *\n * Scenario('My Scenario', () => {\n * Given('I have a step', () => {})\n * })\n *\n * Rule('My Rule', () => {\n * Given('I have a step', () => {})\n * })\n *\n * @param testDefinition\n * @param filepath\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string\n): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * }, 10_000)\n * ```\n * @param testDefinition the Feature definition callback\n * @param filepath\n * @param timeout\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string,\n timeout: number\n): FeatureScope;\nexport function Feature(\n ...args: (FeatureAction | string | TestTimeout)[]\n): FeatureScope {\n return FeatureDefinition(...args);\n}\n\nexport function Scenario(title: string, action: ScenarioAction): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function Scenario(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioDefinition(...args);\n}\n\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function ScenarioOutline(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioOutlineDefinition(...args);\n}\n\nexport function Rule(title: string, action: RuleAction): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: number\n): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: SizedTimeout\n): RuleScope;\nexport function Rule(\n ...args: (string | RuleAction | SizedTimeout | number)[]\n): RuleScope {\n return RuleDefinition(...args);\n}\n/**\n * Defines a `Given` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n *\n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n *\n * N.b. The App instance is shared between all step definitions and hooks within\n * the context of a scenario, but cannot be accessed from the same step in a different\n * scenario.\n *\n * ```ts\n * import { Given } from '@autometa/runner'\n *\n * Given('I have a step', (app) => {\n * app.world.someData = 'some value'\n * })\n * // using destructuring\n * Given('I have a step', ({ world }) => {\n * world.someData = 'some value'\n * })\n * ```\n *\n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n *\n * ```ts\n * import { Given } from '@autometa/runner'\n *\n * // matches 'Given I have a step with a 'blue' value'\n * Given('I have a step with a {string} value', (value, { world }) => {\n * world.someData = value\n * })\n *\n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Given = GivenDefinition;\n/**\n * Defines a `When` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n *\n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n *\n * N.b. The App instance is shared between all step definitions and hooks within\n *\n * ```ts\n * import { When } from '@autometa/runner'\n *\n * When('I do something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * When('I do something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n *\n * ```ts\n * import { When } from '@autometa/runner'\n *\n * // matches 'When I do something with a 'blue' value'\n * When('I do something with a {string} value', async (value, { webdriver }) => {\n * await webdriver.click(`#some-button-${value}`)\n * })\n *\n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const When = WhenDefinition;\n\n/**\n * Defines a `Then` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n *\n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n *\n * N.b. The App instance is shared between all step definitions and hooks within\n *\n * ```ts\n * import { Then } from '@autometa/runner'\n *\n * Then('I expect something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Then('I expect something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n *\n * ```ts\n * import { Then } from '@autometa/runner'\n *\n * // matches 'Then I expect something with a 'blue' value'\n * Then('I expect something with a {string} value', async (value, { world }) => {\n * expect(world.someData).toBe(value)\n * })\n *\n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Then = ThenDefinition;\n\n/**\n * Defines a `Before` hook. Executes before each scenario.\n *\n * ```ts\n * import { Before } from '@autometa/runner'\n *\n * Before(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Before(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const Before = BeforeDefinition;\n\n/**\n * Defines a `After` hook. Executes after each scenario.\n *\n * ```ts\n * import { After } from '@autometa/runner'\n *\n * After(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * After(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const After = AfterDefinition;\n\n/**\n * Defines a `Setup` hook. Executes before all scenarios.\n * Setups are scoped, meaning a Setup defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n *\n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleton fixture.\n *\n * ```ts\n * import { Setup } from '@autometa/runner'\n *\n * Setup(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Setup(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const Teardown = TeardownDefinition;\n\n/**\n * Defines a `Teardown` hook. Executes after all scenarios have completed.\n * Teardowns are scoped, meaning a Teardown defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n *\n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleston fixture.\n * ```ts\n * import { Teardown } from '@autometa/runner'\n *\n * Teardown(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Teardown(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const Setup = SetupDefinition;\n","import {\n Config,\n TestExecutorConfig,\n defineConfig as dc\n} from \"@autometa/config\";\n\nexport const CONFIG = new Config(new Map<string, TestExecutorConfig>());\nexport const defineConfig = dc.bind(null, CONFIG);\n","import { ParameterTypeRegistry } from \"@cucumber/cucumber-expressions\";\nimport {\n BooleanParam,\n DateParam,\n NumberParam,\n PrimitiveParam,\n OrdinalParam,\n TextParam,\n defineParameterType as dpt\n} from \"@autometa/cucumber-expressions\";\n\nexport const PARAM_REGISTRY = new ParameterTypeRegistry();\n\n/**\n * Defines a parameter type for use in step definitions.\n * \n * ```ts\n * import { Color } from '../support/color';\n * \n * defineParameterType({\n * name: \"color\",\n * regexpPattern: /red|blue|yellow/,\n * transform: (value: string) => Color(value)\n * })\n * \n * // using regex arrays\n * defineParameterType({\n * name: \"color\",\n * regexpPattern: [/red/, /blue/, /yellow/],\n * transform: (value: string) => Color(value)\n * })\n * ```\n */\nexport const defineParameterType = dpt.bind(null, PARAM_REGISTRY);\n\ndefineParameterType(\n NumberParam,\n BooleanParam,\n PrimitiveParam,\n TextParam,\n DateParam,\n OrdinalParam\n);\n","import { PARAM_REGISTRY } from \"./parameters\";\nimport { GetCucumberFunctions, Pass } from \"@autometa/scopes\";\nimport { Coordinator } from \"@autometa/coordinator\";\nimport { CONFIG } from \"./config\";\nimport { makeTestEmitter } from \"./events\";\nimport { executor } from \"./executor\";\nimport { OPTS } from \"./app\";\nconst {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Global\n} = GetCucumberFunctions(PARAM_REGISTRY);\nconst coordinator = new Coordinator(Global, CONFIG, OPTS);\nGlobal.onFeatureExecuted = (feature, caller) => {\n const groupLogger = CONFIG.current.test?.groupLogging ?? false;\n const events = makeTestEmitter({ groupLogger });\n coordinator.run(feature, caller, events, executor);\n};\n\nexport {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Pass\n};\n","import { TestEventEmitter } from \"@autometa/events\";\nimport { CONFIG } from \"./config\";\nexport * from \"@autometa/events\";\nimport { GroupLogEvents } from \"./event-logger\";\nimport p from \"path\";\nexport function makeTestEmitter(opts: { groupLogger: boolean }) {\n const events = CONFIG.current.events;\n const emitter = new TestEventEmitter();\n if (opts.groupLogger) {\n emitter.load(new GroupLogEvents());\n }\n if (!events) {\n return emitter;\n }\n\n for (const event of events) {\n const isLocal = isRelativePath(event) || isAbsolutePath(event);\n if (isLocal) {\n const uriRoot = process.cwd();\n const uri = p.join(uriRoot, event);\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(uri);\n if('default' in listener && typeof listener.default === \"function\") {\n emitter.load(new listener.default());\n return emitter;\n }\n if('default' in listener && typeof listener.default === \"object\") {\n emitter.load(listener.default);\n return emitter;\n }\n if(typeof listener === \"function\") {\n emitter.load(new listener());\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(event);\n if('default' in listener) {\n emitter.load(listener.default);\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n\n return emitter;\n}\n\nfunction isRelativePath(path: string) {\n return path.startsWith(\".\");\n}\n\nfunction isAbsolutePath(path: string) {\n return p.isAbsolute(path);\n}\n","import {\n EndAfterOpts,\n EndBeforeOpts,\n EndFeatureOpts,\n EndRuleOpts,\n EndScenarioOpts,\n EndScenarioOutlineOpts,\n EndSetupOpts,\n EndStepOpts,\n EndTeardownOpts,\n EventSubscriber,\n StartAfterOpts,\n StartBeforeOpts,\n StartFeatureOpts,\n StartRuleOpts,\n StartScenarioOpts,\n StartScenarioOutlineOpts,\n StartSetupOpts,\n StartStepOpts,\n StartTeardownOpts\n} from \"@autometa/events\";\nimport colors from \"colors-cli\";\nexport class GroupLogEvents implements EventSubscriber {\n onFeatureStart({ title }: StartFeatureOpts) {\n console.group(title);\n console.group();\n }\n onFeatureEnd({ title, status }: EndFeatureOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioStart({ title }: StartScenarioOpts): void {\n console.group(title);\n console.group();\n }\n onScenarioEnd({ title, status }: EndScenarioOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioOutlineStart(opts: StartScenarioOutlineOpts): void {\n console.group(opts.title);\n console.group();\n }\n onScenarioOutlineEnd({ title, status }: EndScenarioOutlineOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onRuleStart({ title }: StartRuleOpts): void {\n console.group(title);\n console.group();\n }\n onRuleEnd({ title, status }: EndRuleOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onStepStart({ title }: StartStepOpts) {\n console.group(title);\n console.group();\n }\n onStepEnd({ title, status }: EndStepOpts) {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onBeforeStart({ title, status }: StartBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onBeforeEnd({ title, status }: EndBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onAfterStart({ title, status }: StartAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onAfterEnd({ title, status }: EndAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onTeardownStart({ title, status }: StartTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onTeardownEnd({ title, status }: EndTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onSetupStart({title, status}: StartSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.group(title);\n console.group();\n }\n onSetupEnd({ title, status }: EndSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n}\nfunction colorStatus(\n status: \"FAILED\" | \"PASSED\" | \"SKIPPED\" | \"BROKEN\" | undefined,\n text: string\n) {\n switch (status) {\n case \"FAILED\":\n return `${colors.red(\"x\")} ${text}`;\n case \"PASSED\":\n return `${colors.green(\"✔️\")} ${text}`;\n case \"SKIPPED\":\n return `${colors.yellow(\"⊘\")} ${text}`;\n default:\n return text;\n }\n}\n","import { execute } from \"@autometa/jest-executor\";\n\nexport const executor = execute;\n","import \"@autometa/types\";\nimport { AppType as at } from \"@autometa/app\";\nimport { CoordinatorOpts } from \"@autometa/coordinator\";\nexport { AutometaApp, AutometaWorld, App, World } from \"@autometa/app\";\nexport {\n Fixture,\n INJECTION_SCOPE,\n InjectionScope,\n Token,\n Container,\n Constructor\n} from \"@autometa/injection\";\nexport const OPTS = {} as Record<string, CoordinatorOpts>;\n/**\n * Marks a class as being the `App` of the test framework. The `App` is the\n * entry point for the test framework. The App will be made available as the final\n * argument in the Step Definition Callbacks.\n *\n * ```ts\n *\n * @AppType(World)\n * @Constructor(MyClient)\n * class App {\n * constructor(readonly myCLient: MyClient) {}\n * }\n * ```\n * Or with tokens\n * \n * ```ts\n * import from \"@autometa/runner\";\n * import { World } from \"./default.world\";\n * @AppType(World)\n * @Constructor(HTTP, Token(\"MyClient\"))\n * class App {\n * constructor(readonly http: HTTP, readonly myClient: MyClient) {}\n * }\n * ```\n */\nexport const AppType = at.bind(null, OPTS);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,eAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,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A;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI,qBAAqB,cAAc;AACvC,IAAM,cAAc,IAAI,YAAY,QAAQ,QAAQ,IAAI;AACxD,OAAO,oBAAoB,CAAC,SAAS,WAAW;AAC9C,QAAM,cAAc,OAAO,QAAQ,MAAM,gBAAgB;AACzD,QAAM,SAAS,gBAAgB,EAAE,YAAY,CAAC;AAC9C,cAAY,IAAI,SAAS,QAAQ,QAAQ,QAAQ;AACnD;;;AHmBA,wBAAc;AAlBd,cAAc;AAad,SAAS,OAAO,YAAY;AAC5B,SAAS,iBAAiB,aAAa;AACvC,SAAS,WAAW,QAAQ,QAAQ,cAAc;AAClD,SAAS,YAAY;AACrB,SAAS,aAAa;AAEtB,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA0LA,SAASC,YACX,MACW;AACd,SAAO,QAAkB,GAAG,IAAI;AAClC;AAaO,SAASC,aACX,MACY;AACf,SAAO,SAAmB,GAAG,IAAI;AACnC;AAgBO,SAASC,oBACX,MACY;AACf,SAAO,gBAA0B,GAAG,IAAI;AAC1C;AAaO,SAASC,SACX,MACQ;AACX,SAAO,KAAe,GAAG,IAAI;AAC/B;AAuCO,IAAMC,SAAQ;AAsCd,IAAMC,QAAO;AAuCb,IAAMC,QAAO;AAoBb,IAAMC,UAAS;AAoBf,IAAMC,SAAQ;AA0Bd,IAAMC,YAAW;AAyBjB,IAAMC,SAAQ;","names":["After","Before","Feature","Given","Rule","Scenario","ScenarioOutline","Setup","Teardown","Then","When","listener","Feature","Scenario","ScenarioOutline","Rule","Given","When","Then","Before","After","Teardown","Setup"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -6,9 +6,9 @@ import * as _autometa_gherkin from '@autometa/gherkin';
|
|
|
6
6
|
export { DataTable, HTable, MTable, VTable } from '@autometa/gherkin';
|
|
7
7
|
import * as _autometa_config from '@autometa/config';
|
|
8
8
|
import * as _autometa_cucumber_expressions from '@autometa/cucumber-expressions';
|
|
9
|
-
import * as _autometa_app from '@autometa/app';
|
|
10
|
-
export { App, AutometaApp, AutometaWorld, Fixture, World, getApp } from '@autometa/app';
|
|
11
9
|
export * from '@autometa/phrases';
|
|
10
|
+
import * as _autometa_app from '@autometa/app';
|
|
11
|
+
export { App, AutometaApp, AutometaWorld, World } from '@autometa/app';
|
|
12
12
|
export { Dates, Time } from '@autometa/datetime';
|
|
13
13
|
export { AutomationError, raise } from '@autometa/errors';
|
|
14
14
|
export { Bind } from '@autometa/bind-decorator';
|
|
@@ -17,6 +17,7 @@ export * from '@autometa/events';
|
|
|
17
17
|
export * from '@autometa/http';
|
|
18
18
|
export * from '@autometa/asserters';
|
|
19
19
|
export { GetAccessedCount, GetAssignedValues, TrackAccess } from '@autometa/fixture-proxies';
|
|
20
|
+
export { Constructor, Container, Fixture, INJECTION_SCOPE, InjectionScope } from '@autometa/injection';
|
|
20
21
|
|
|
21
22
|
declare const defineConfig: (...args: {
|
|
22
23
|
runner: "jest" | "vitest";
|
|
@@ -66,6 +67,31 @@ declare const defineConfig: (...args: {
|
|
|
66
67
|
*/
|
|
67
68
|
declare const defineParameterType: (...args: _autometa_cucumber_expressions.ParamTypeDefinition[]) => void;
|
|
68
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Marks a class as being the `App` of the test framework. The `App` is the
|
|
72
|
+
* entry point for the test framework. The App will be made available as the final
|
|
73
|
+
* argument in the Step Definition Callbacks.
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
*
|
|
77
|
+
* @AppType(World)
|
|
78
|
+
* @Constructor(MyClient)
|
|
79
|
+
* class App {
|
|
80
|
+
* constructor(readonly myCLient: MyClient) {}
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
* Or with tokens
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* import from "@autometa/runner";
|
|
87
|
+
* import { World } from "./default.world";
|
|
88
|
+
* @AppType(World)
|
|
89
|
+
* @Constructor(HTTP, Token("MyClient"))
|
|
90
|
+
* class App {
|
|
91
|
+
* constructor(readonly http: HTTP, readonly myClient: MyClient) {}
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
69
95
|
declare const AppType: (world: _autometa_types.Class<_autometa_app.AutometaWorld>, environment?: string | undefined) => (target: _autometa_types.Class<unknown>) => void;
|
|
70
96
|
|
|
71
97
|
declare function makeTestEmitter(opts: {
|
|
@@ -201,7 +227,7 @@ declare function Feature(filepath: string, timeout: TestTimeout): FeatureScope;
|
|
|
201
227
|
* When('I do something', () => {})
|
|
202
228
|
* Then('I expect something', () => {})
|
|
203
229
|
* })
|
|
204
|
-
* ```
|
|
230
|
+
* ```
|
|
205
231
|
*
|
|
206
232
|
* If defined in the Gherkin, it will also use any Globally defined Step Definitions which match,
|
|
207
233
|
* if none is defined locally. If a Step Definition is defined both globally and locally,
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ import * as _autometa_gherkin from '@autometa/gherkin';
|
|
|
6
6
|
export { DataTable, HTable, MTable, VTable } from '@autometa/gherkin';
|
|
7
7
|
import * as _autometa_config from '@autometa/config';
|
|
8
8
|
import * as _autometa_cucumber_expressions from '@autometa/cucumber-expressions';
|
|
9
|
-
import * as _autometa_app from '@autometa/app';
|
|
10
|
-
export { App, AutometaApp, AutometaWorld, Fixture, World, getApp } from '@autometa/app';
|
|
11
9
|
export * from '@autometa/phrases';
|
|
10
|
+
import * as _autometa_app from '@autometa/app';
|
|
11
|
+
export { App, AutometaApp, AutometaWorld, World } from '@autometa/app';
|
|
12
12
|
export { Dates, Time } from '@autometa/datetime';
|
|
13
13
|
export { AutomationError, raise } from '@autometa/errors';
|
|
14
14
|
export { Bind } from '@autometa/bind-decorator';
|
|
@@ -17,6 +17,7 @@ export * from '@autometa/events';
|
|
|
17
17
|
export * from '@autometa/http';
|
|
18
18
|
export * from '@autometa/asserters';
|
|
19
19
|
export { GetAccessedCount, GetAssignedValues, TrackAccess } from '@autometa/fixture-proxies';
|
|
20
|
+
export { Constructor, Container, Fixture, INJECTION_SCOPE, InjectionScope } from '@autometa/injection';
|
|
20
21
|
|
|
21
22
|
declare const defineConfig: (...args: {
|
|
22
23
|
runner: "jest" | "vitest";
|
|
@@ -66,6 +67,31 @@ declare const defineConfig: (...args: {
|
|
|
66
67
|
*/
|
|
67
68
|
declare const defineParameterType: (...args: _autometa_cucumber_expressions.ParamTypeDefinition[]) => void;
|
|
68
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Marks a class as being the `App` of the test framework. The `App` is the
|
|
72
|
+
* entry point for the test framework. The App will be made available as the final
|
|
73
|
+
* argument in the Step Definition Callbacks.
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
*
|
|
77
|
+
* @AppType(World)
|
|
78
|
+
* @Constructor(MyClient)
|
|
79
|
+
* class App {
|
|
80
|
+
* constructor(readonly myCLient: MyClient) {}
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
* Or with tokens
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* import from "@autometa/runner";
|
|
87
|
+
* import { World } from "./default.world";
|
|
88
|
+
* @AppType(World)
|
|
89
|
+
* @Constructor(HTTP, Token("MyClient"))
|
|
90
|
+
* class App {
|
|
91
|
+
* constructor(readonly http: HTTP, readonly myClient: MyClient) {}
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
69
95
|
declare const AppType: (world: _autometa_types.Class<_autometa_app.AutometaWorld>, environment?: string | undefined) => (target: _autometa_types.Class<unknown>) => void;
|
|
70
96
|
|
|
71
97
|
declare function makeTestEmitter(opts: {
|
|
@@ -201,7 +227,7 @@ declare function Feature(filepath: string, timeout: TestTimeout): FeatureScope;
|
|
|
201
227
|
* When('I do something', () => {})
|
|
202
228
|
* Then('I expect something', () => {})
|
|
203
229
|
* })
|
|
204
|
-
* ```
|
|
230
|
+
* ```
|
|
205
231
|
*
|
|
206
232
|
* If defined in the Gherkin, it will also use any Globally defined Step Definitions which match,
|
|
207
233
|
* if none is defined locally. If a Step Definition is defined both globally and locally,
|
package/dist/index.js
CHANGED
|
@@ -32,21 +32,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
32
|
var src_exports = {};
|
|
33
33
|
__export(src_exports, {
|
|
34
34
|
After: () => After2,
|
|
35
|
-
App: () =>
|
|
35
|
+
App: () => import_app2.App,
|
|
36
36
|
AppType: () => AppType,
|
|
37
37
|
AutomationError: () => import_errors.AutomationError,
|
|
38
|
-
AutometaApp: () =>
|
|
39
|
-
AutometaWorld: () =>
|
|
38
|
+
AutometaApp: () => import_app2.AutometaApp,
|
|
39
|
+
AutometaWorld: () => import_app2.AutometaWorld,
|
|
40
40
|
Before: () => Before2,
|
|
41
41
|
Bind: () => import_bind_decorator.Bind,
|
|
42
|
+
Constructor: () => import_injection.Constructor,
|
|
43
|
+
Container: () => import_injection.Container,
|
|
42
44
|
DataTable: () => import_gherkin.DataTable,
|
|
43
45
|
Dates: () => import_datetime.Dates,
|
|
44
46
|
Feature: () => Feature2,
|
|
45
|
-
Fixture: () =>
|
|
47
|
+
Fixture: () => import_injection.Fixture,
|
|
46
48
|
GetAccessedCount: () => import_fixture_proxies.GetAccessedCount,
|
|
47
49
|
GetAssignedValues: () => import_fixture_proxies.GetAssignedValues,
|
|
48
50
|
Given: () => Given2,
|
|
49
51
|
HTable: () => import_gherkin.HTable,
|
|
52
|
+
INJECTION_SCOPE: () => import_injection.INJECTION_SCOPE,
|
|
53
|
+
InjectionScope: () => import_injection.InjectionScope,
|
|
50
54
|
MTable: () => import_gherkin.MTable,
|
|
51
55
|
Pass: () => import_scopes.Pass,
|
|
52
56
|
Rule: () => Rule2,
|
|
@@ -60,10 +64,9 @@ __export(src_exports, {
|
|
|
60
64
|
Types: () => import_scopes4.Types,
|
|
61
65
|
VTable: () => import_gherkin.VTable,
|
|
62
66
|
When: () => When2,
|
|
63
|
-
World: () =>
|
|
67
|
+
World: () => import_app2.World,
|
|
64
68
|
defineConfig: () => defineConfig,
|
|
65
69
|
defineParameterType: () => defineParameterType,
|
|
66
|
-
getApp: () => import_app4.getApp,
|
|
67
70
|
makeTestEmitter: () => makeTestEmitter,
|
|
68
71
|
raise: () => import_errors.raise
|
|
69
72
|
});
|
|
@@ -279,6 +282,7 @@ var executor = import_jest_executor.execute;
|
|
|
279
282
|
var import_types = require("@autometa/types");
|
|
280
283
|
var import_app = require("@autometa/app");
|
|
281
284
|
var import_app2 = require("@autometa/app");
|
|
285
|
+
var import_injection = require("@autometa/injection");
|
|
282
286
|
var OPTS = {};
|
|
283
287
|
var AppType = import_app.AppType.bind(null, OPTS);
|
|
284
288
|
|
|
@@ -305,9 +309,7 @@ Global.onFeatureExecuted = (feature, caller) => {
|
|
|
305
309
|
};
|
|
306
310
|
|
|
307
311
|
// src/index.ts
|
|
308
|
-
var import_app4 = require("@autometa/app");
|
|
309
312
|
__reExport(src_exports, require("@autometa/phrases"), module.exports);
|
|
310
|
-
var import_app5 = require("@autometa/app");
|
|
311
313
|
var import_datetime = require("@autometa/datetime");
|
|
312
314
|
var import_errors = require("@autometa/errors");
|
|
313
315
|
var import_gherkin = require("@autometa/gherkin");
|
|
@@ -346,6 +348,8 @@ var Setup2 = Setup;
|
|
|
346
348
|
AutometaWorld,
|
|
347
349
|
Before,
|
|
348
350
|
Bind,
|
|
351
|
+
Constructor,
|
|
352
|
+
Container,
|
|
349
353
|
DataTable,
|
|
350
354
|
Dates,
|
|
351
355
|
Feature,
|
|
@@ -354,6 +358,8 @@ var Setup2 = Setup;
|
|
|
354
358
|
GetAssignedValues,
|
|
355
359
|
Given,
|
|
356
360
|
HTable,
|
|
361
|
+
INJECTION_SCOPE,
|
|
362
|
+
InjectionScope,
|
|
357
363
|
MTable,
|
|
358
364
|
Pass,
|
|
359
365
|
Rule,
|
|
@@ -370,7 +376,6 @@ var Setup2 = Setup;
|
|
|
370
376
|
World,
|
|
371
377
|
defineConfig,
|
|
372
378
|
defineParameterType,
|
|
373
|
-
getApp,
|
|
374
379
|
makeTestEmitter,
|
|
375
380
|
raise,
|
|
376
381
|
...require("@autometa/phrases"),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/config.ts","../src/parameters.ts","../src/scopes.ts","../src/events.ts","../src/event-logger.ts","../src/executor.ts","../src/app.ts"],"sourcesContent":["import type {\n FeatureAction,\n FeatureScope,\n ScenarioAction,\n ScenarioScope,\n SizedTimeout,\n TestTimeout\n} from \"@autometa/scopes\";\n\nexport { defineConfig } from \"./config\";\nexport { defineParameterType } from \"./parameters\";\nimport {\n Feature as FeatureDefinition,\n Scenario as ScenarioDefinition,\n ScenarioOutline as ScenarioOutlineDefinition,\n Rule as RuleDefinition,\n Given as GivenDefinition,\n When as WhenDefinition,\n Then as ThenDefinition,\n Before as BeforeDefinition,\n After as AfterDefinition,\n Teardown as TeardownDefinition,\n Setup as SetupDefinition\n} from \"./scopes\";\nimport { RuleAction } from \"@autometa/scopes\";\nexport { getApp } from \"@autometa/app\";\nimport { RuleScope } from \"@autometa/scopes\";\nexport { Pass } from \"./scopes\";\nexport * from \"@autometa/phrases\";\nexport { App, World, AutometaApp, AutometaWorld } from \"@autometa/app\";\nexport { AppType, Fixture } from \"./app\";\nexport { Dates, Time } from \"@autometa/datetime\";\nexport { AutomationError, raise } from \"@autometa/errors\";\nexport { DataTable, HTable, VTable, MTable } from \"@autometa/gherkin\";\nexport { Bind } from \"@autometa/bind-decorator\";\nexport { Types } from \"@autometa/scopes\";\nexport * from \"./events\";\nexport * from \"@autometa/http\";\nexport * from \"@autometa/asserters\";\nexport { GetAccessedCount, GetAssignedValues, TrackAccess } from \"@autometa/fixture-proxies\";\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n *\n * ``ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * Feature('../features/my-feature.feature')\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber stle.\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n */\nexport function Feature(filepath: string): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n * // 10 second timeout\n * Feature('../features/my-feature.feature', 10_000)\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber style.\n *\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n * @param timeout The timeout in milliseconds to apply to all tests within the feature.\n */\nexport function Feature(filepath: string, timeout: number): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout as a `TestTimeout` which is a tuple of `[durationNumber, 'ms' | 's' | 'm' | 'h']`\n * which will be applied to all tests within the feature.\n *\n * i.e. `[10, 's']` is a 10 second timeout. `[1, 'm']` is a 1 minute timeout.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('../features/my-feature.feature', [10, 's'])\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * };\n *\n * ```\n *\n * @param filepath\n * @param timeout\n */\nexport function Feature(filepath: string, timeout: TestTimeout): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * })\n * ```ts\n *\n * If defined in the Gherkin, it will also use any Globally defined Step Definitions which match,\n * if none is defined locally. If a Step Definition is defined both globally and locally,\n * the most local definition will be used. This applies to sub-scopes like Scenarios and Rules\n * also.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n *\n * Scenario('My Scenario', () => {\n * Given('I have a step', () => {})\n * })\n *\n * Rule('My Rule', () => {\n * Given('I have a step', () => {})\n * })\n *\n * @param testDefinition\n * @param filepath\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string\n): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * }, 10_000)\n * ```\n * @param testDefinition the Feature definition callback\n * @param filepath\n * @param timeout\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string,\n timeout: number\n): FeatureScope;\nexport function Feature(\n ...args: (FeatureAction | string | TestTimeout)[]\n): FeatureScope {\n return FeatureDefinition(...args);\n}\n\nexport function Scenario(title: string, action: ScenarioAction): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function Scenario(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioDefinition(...args);\n}\n\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function ScenarioOutline(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioOutlineDefinition(...args);\n}\n\nexport function Rule(title: string, action: RuleAction): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: number\n): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: SizedTimeout\n): RuleScope;\nexport function Rule(\n ...args: (string | RuleAction | SizedTimeout | number)[]\n): RuleScope {\n return RuleDefinition(...args);\n}\n/**\n * Defines a `Given` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n * \n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n * \n * N.b. The App instance is shared between all step definitions and hooks within\n * the context of a scenario, but cannot be accessed from the same step in a different\n * scenario.\n * \n * ```ts\n * import { Given } from '@autometa/runner'\n * \n * Given('I have a step', (app) => {\n * app.world.someData = 'some value'\n * })\n * // using destructuring\n * Given('I have a step', ({ world }) => {\n * world.someData = 'some value'\n * })\n * ```\n * \n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n * \n * ```ts\n * import { Given } from '@autometa/runner'\n * \n * // matches 'Given I have a step with a 'blue' value'\n * Given('I have a step with a {string} value', (value, { world }) => {\n * world.someData = value\n * })\n * \n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Given = GivenDefinition;\n/**\n * Defines a `When` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n * \n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n * \n * N.b. The App instance is shared between all step definitions and hooks within\n * \n * ```ts\n * import { When } from '@autometa/runner'\n * \n * When('I do something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * When('I do something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n * \n * ```ts\n * import { When } from '@autometa/runner'\n * \n * // matches 'When I do something with a 'blue' value'\n * When('I do something with a {string} value', async (value, { webdriver }) => {\n * await webdriver.click(`#some-button-${value}`)\n * })\n * \n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const When = WhenDefinition;\n\n/**\n * Defines a `Then` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n * \n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n * \n * N.b. The App instance is shared between all step definitions and hooks within\n * \n * ```ts\n * import { Then } from '@autometa/runner'\n * \n * Then('I expect something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Then('I expect something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n * \n * ```ts\n * import { Then } from '@autometa/runner'\n * \n * // matches 'Then I expect something with a 'blue' value'\n * Then('I expect something with a {string} value', async (value, { world }) => {\n * expect(world.someData).toBe(value)\n * })\n * \n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Then = ThenDefinition;\n\n/**\n * Defines a `Before` hook. Executes before each scenario.\n * \n * ```ts\n * import { Before } from '@autometa/runner'\n * \n * Before(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Before(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const Before = BeforeDefinition;\n\n/**\n * Defines a `After` hook. Executes after each scenario.\n * \n * ```ts\n * import { After } from '@autometa/runner'\n * \n * After(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * After(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const After = AfterDefinition;\n\n/**\n * Defines a `Setup` hook. Executes before all scenarios.\n * Setups are scoped, meaning a Setup defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n * \n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleton fixture.\n * \n * ```ts\n * import { Setup } from '@autometa/runner'\n * \n * Setup(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Setup(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const Teardown = TeardownDefinition;\n\n/**\n * Defines a `Teardown` hook. Executes after all scenarios have completed.\n * Teardowns are scoped, meaning a Teardown defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n * \n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleston fixture.\n * ```ts\n * import { Teardown } from '@autometa/runner'\n * \n * Teardown(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n * \n * // using destructuring\n * Teardown(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n * \n * @param action The hook action to execute.\n */\nexport const Setup = SetupDefinition;\n\n\n","import {\n Config,\n TestExecutorConfig,\n defineConfig as dc\n} from \"@autometa/config\";\n\nexport const CONFIG = new Config(new Map<string, TestExecutorConfig>());\nexport const defineConfig = dc.bind(null, CONFIG);\n","import { ParameterTypeRegistry } from \"@cucumber/cucumber-expressions\";\nimport {\n BooleanParam,\n DateParam,\n NumberParam,\n PrimitiveParam,\n OrdinalParam,\n TextParam,\n defineParameterType as dpt\n} from \"@autometa/cucumber-expressions\";\n\nexport const PARAM_REGISTRY = new ParameterTypeRegistry();\n\n/**\n * Defines a parameter type for use in step definitions.\n * \n * ```ts\n * import { Color } from '../support/color';\n * \n * defineParameterType({\n * name: \"color\",\n * regexpPattern: /red|blue|yellow/,\n * transform: (value: string) => Color(value)\n * })\n * \n * // using regex arrays\n * defineParameterType({\n * name: \"color\",\n * regexpPattern: [/red/, /blue/, /yellow/],\n * transform: (value: string) => Color(value)\n * })\n * ```\n */\nexport const defineParameterType = dpt.bind(null, PARAM_REGISTRY);\n\ndefineParameterType(\n NumberParam,\n BooleanParam,\n PrimitiveParam,\n TextParam,\n DateParam,\n OrdinalParam\n);\n","import { PARAM_REGISTRY } from \"./parameters\";\nimport { GetCucumberFunctions, Pass } from \"@autometa/scopes\";\nimport { Coordinator } from \"@autometa/coordinator\";\nimport { CONFIG } from \"./config\";\nimport { makeTestEmitter } from \"./events\";\nimport { executor } from \"./executor\";\nimport { OPTS } from \"./app\";\nconst {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Global\n} = GetCucumberFunctions(PARAM_REGISTRY);\nconst coordinator = new Coordinator(Global, CONFIG, OPTS);\nGlobal.onFeatureExecuted = (feature, caller) => {\n const groupLogger = CONFIG.current.test?.groupLogging ?? false;\n const events = makeTestEmitter({ groupLogger });\n coordinator.run(feature, caller, events, executor);\n};\n\nexport {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Pass\n};\n","import { TestEventEmitter } from \"@autometa/events\";\nimport { CONFIG } from \"./config\";\nexport * from \"@autometa/events\";\nimport { GroupLogEvents } from \"./event-logger\";\nimport p from \"path\";\nexport function makeTestEmitter(opts: { groupLogger: boolean }) {\n const events = CONFIG.current.events;\n const emitter = new TestEventEmitter();\n if (opts.groupLogger) {\n emitter.load(new GroupLogEvents());\n }\n if (!events) {\n return emitter;\n }\n\n for (const event of events) {\n const isLocal = isRelativePath(event) || isAbsolutePath(event);\n if (isLocal) {\n const uriRoot = process.cwd();\n const uri = p.join(uriRoot, event);\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(uri);\n if('default' in listener && typeof listener.default === \"function\") {\n emitter.load(new listener.default());\n return emitter;\n }\n if('default' in listener && typeof listener.default === \"object\") {\n emitter.load(listener.default);\n return emitter;\n }\n if(typeof listener === \"function\") {\n emitter.load(new listener());\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(event);\n if('default' in listener) {\n emitter.load(listener.default);\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n\n return emitter;\n}\n\nfunction isRelativePath(path: string) {\n return path.startsWith(\".\");\n}\n\nfunction isAbsolutePath(path: string) {\n return p.isAbsolute(path);\n}\n","import {\n EndAfterOpts,\n EndBeforeOpts,\n EndFeatureOpts,\n EndRuleOpts,\n EndScenarioOpts,\n EndScenarioOutlineOpts,\n EndSetupOpts,\n EndStepOpts,\n EndTeardownOpts,\n EventSubscriber,\n StartAfterOpts,\n StartBeforeOpts,\n StartFeatureOpts,\n StartRuleOpts,\n StartScenarioOpts,\n StartScenarioOutlineOpts,\n StartSetupOpts,\n StartStepOpts,\n StartTeardownOpts\n} from \"@autometa/events\";\nimport colors from \"colors-cli\";\nexport class GroupLogEvents implements EventSubscriber {\n onFeatureStart({ title }: StartFeatureOpts) {\n console.group(title);\n console.group();\n }\n onFeatureEnd({ title, status }: EndFeatureOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioStart({ title }: StartScenarioOpts): void {\n console.group(title);\n console.group();\n }\n onScenarioEnd({ title, status }: EndScenarioOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioOutlineStart(opts: StartScenarioOutlineOpts): void {\n console.group(opts.title);\n console.group();\n }\n onScenarioOutlineEnd({ title, status }: EndScenarioOutlineOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onRuleStart({ title }: StartRuleOpts): void {\n console.group(title);\n console.group();\n }\n onRuleEnd({ title, status }: EndRuleOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onStepStart({ title }: StartStepOpts) {\n console.group(title);\n console.group();\n }\n onStepEnd({ title, status }: EndStepOpts) {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onBeforeStart({ title, status }: StartBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onBeforeEnd({ title, status }: EndBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onAfterStart({ title, status }: StartAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onAfterEnd({ title, status }: EndAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onTeardownStart({ title, status }: StartTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onTeardownEnd({ title, status }: EndTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onSetupStart({title, status}: StartSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.group(title);\n console.group();\n }\n onSetupEnd({ title, status }: EndSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n}\nfunction colorStatus(\n status: \"FAILED\" | \"PASSED\" | \"SKIPPED\" | \"BROKEN\" | undefined,\n text: string\n) {\n switch (status) {\n case \"FAILED\":\n return `${colors.red(\"x\")} ${text}`;\n case \"PASSED\":\n return `${colors.green(\"✔️\")} ${text}`;\n case \"SKIPPED\":\n return `${colors.yellow(\"⊘\")} ${text}`;\n default:\n return text;\n }\n}\n","import { execute } from \"@autometa/jest-executor\";\n\nexport const executor = execute;\n","import \"@autometa/types\";\nimport { AppType as at } from \"@autometa/app\";\nimport { CoordinatorOpts } from \"@autometa/coordinator\";\nexport {\n Fixture,\n LIFE_CYCLE,\n Lifecycle,\n AutometaApp,\n AutometaWorld\n} from \"@autometa/app\";\nexport const OPTS = {} as Record<string, CoordinatorOpts>;\nexport const AppType = at.bind(null, OPTS);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,eAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA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ACzD,QAAM,SAAS,gBAAgB,EAAE,YAAY,CAAC;AAC9C,cAAY,IAAI,SAAS,QAAQ,QAAQ,QAAQ;AACnD;;;AHDA,IAAAC,cAAuB;AAGvB,wBAAc,8BA5Bd;AA6BA,IAAAA,cAAuD;AAEvD,sBAA4B;AAC5B,oBAAuC;AACvC,qBAAkD;AAClD,4BAAqB;AACrB,IAAAC,iBAAsB;AACtB,wBAAc,gBApCd;AAqCA,wBAAc,2BArCd;AAsCA,wBAAc,gCAtCd;AAuCA,6BAAiE;AA0L1D,SAASC,YACX,MACW;AACd,SAAO,QAAkB,GAAG,IAAI;AAClC;AAaO,SAASC,aACX,MACY;AACf,SAAO,SAAmB,GAAG,IAAI;AACnC;AAgBO,SAASC,oBACX,MACY;AACf,SAAO,gBAA0B,GAAG,IAAI;AAC1C;AAaO,SAASC,SACX,MACQ;AACX,SAAO,KAAe,GAAG,IAAI;AAC/B;AAuCO,IAAMC,SAAQ;AAsCd,IAAMC,QAAO;AAuCb,IAAMC,QAAO;AAoBb,IAAMC,UAAS;AAoBf,IAAMC,SAAQ;AA0Bd,IAAMC,YAAW;AAyBjB,IAAMC,SAAQ;","names":["After","Before","Feature","Given","Rule","Scenario","ScenarioOutline","Setup","Teardown","Then","When","dc","import_cucumber_expressions","dpt","colors","p","listener","import_app","at","import_app","import_scopes","Feature","Scenario","ScenarioOutline","Rule","Given","When","Then","Before","After","Teardown","Setup"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/config.ts","../src/parameters.ts","../src/scopes.ts","../src/events.ts","../src/event-logger.ts","../src/executor.ts","../src/app.ts"],"sourcesContent":["import type {\n FeatureAction,\n FeatureScope,\n ScenarioAction,\n ScenarioScope,\n SizedTimeout,\n TestTimeout\n} from \"@autometa/scopes\";\n\nexport { defineConfig } from \"./config\";\nexport { defineParameterType } from \"./parameters\";\nimport {\n Feature as FeatureDefinition,\n Scenario as ScenarioDefinition,\n ScenarioOutline as ScenarioOutlineDefinition,\n Rule as RuleDefinition,\n Given as GivenDefinition,\n When as WhenDefinition,\n Then as ThenDefinition,\n Before as BeforeDefinition,\n After as AfterDefinition,\n Teardown as TeardownDefinition,\n Setup as SetupDefinition\n} from \"./scopes\";\nimport { RuleAction } from \"@autometa/scopes\";\nimport { RuleScope } from \"@autometa/scopes\";\nexport { Pass } from \"./scopes\";\nexport * from \"@autometa/phrases\";\nexport {\n AppType,\n Fixture,\n Container,\n Constructor,\n AutometaApp,\n AutometaWorld,\n App,\n World,\n INJECTION_SCOPE,\n InjectionScope\n} from \"./app\";\nexport { Dates, Time } from \"@autometa/datetime\";\nexport { AutomationError, raise } from \"@autometa/errors\";\nexport { DataTable, HTable, VTable, MTable } from \"@autometa/gherkin\";\nexport { Bind } from \"@autometa/bind-decorator\";\nexport { Types } from \"@autometa/scopes\";\nexport * from \"./events\";\nexport * from \"@autometa/http\";\nexport * from \"@autometa/asserters\";\nexport {\n GetAccessedCount,\n GetAssignedValues,\n TrackAccess\n} from \"@autometa/fixture-proxies\";\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n *\n * ``ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * Feature('../features/my-feature.feature')\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber stle.\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n */\nexport function Feature(filepath: string): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n * // 10 second timeout\n * Feature('../features/my-feature.feature', 10_000)\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * }\n * ```\n *\n * Global steps are defined in standard Cucumber style.\n *\n * ```ts\n * // ./test/steps/my-steps.ts\n * import { Given, When, Then } from '@autometa/runner'\n *\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * ```\n * @param filepath The absolute, relative, or 'feature root' path to the `.feature` file.\n * @param timeout The timeout in milliseconds to apply to all tests within the feature.\n */\nexport function Feature(filepath: string, timeout: number): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and globally defined Step Definitions.\n * Accepts a timeout as a `TestTimeout` which is a tuple of `[durationNumber, 'ms' | 's' | 'm' | 'h']`\n * which will be applied to all tests within the feature.\n *\n * i.e. `[10, 's']` is a 10 second timeout. `[1, 'm']` is a 1 minute timeout.\n *\n * ```ts\n * // using relative path\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('../features/my-feature.feature', [10, 's'])\n * ```\n *\n * Steps will be automatically assembled from Globally defined Step Definitions,\n * if a step definition root and app root are defined.\n *\n * ```ts\n * import { defineConfig } from '@autometa/runner'\n *\n * defineConfig({\n * ...\n * roots: {\n * steps: ['./test/steps'],\n * app: ['./app'],\n * },\n * };\n *\n * ```\n *\n * @param filepath\n * @param timeout\n */\nexport function Feature(filepath: string, timeout: TestTimeout): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * })\n * ```\n *\n * If defined in the Gherkin, it will also use any Globally defined Step Definitions which match,\n * if none is defined locally. If a Step Definition is defined both globally and locally,\n * the most local definition will be used. This applies to sub-scopes like Scenarios and Rules\n * also.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n *\n * Scenario('My Scenario', () => {\n * Given('I have a step', () => {})\n * })\n *\n * Rule('My Rule', () => {\n * Given('I have a step', () => {})\n * })\n *\n * @param testDefinition\n * @param filepath\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string\n): FeatureScope;\n/**\n * Executes a gherkin `.feature` file. Assembles Tests\n * using the Cucumber file and optionally locally defined steps,\n * mixed with optionally globally defined Step Definitions.\n * Accepts a timeout in milliseconds which will be applied to\n * all tests within the feature.\n *\n * ```ts\n * import { Feature } from '@autometa/runner'\n *\n * // 10 second timeout\n * Feature('My Feature', () => {\n * Given('I have a step', () => {})\n * When('I do something', () => {})\n * Then('I expect something', () => {})\n * }, 10_000)\n * ```\n * @param testDefinition the Feature definition callback\n * @param filepath\n * @param timeout\n */\nexport function Feature(\n testDefinition: FeatureAction,\n filepath: string,\n timeout: number\n): FeatureScope;\nexport function Feature(\n ...args: (FeatureAction | string | TestTimeout)[]\n): FeatureScope {\n return FeatureDefinition(...args);\n}\n\nexport function Scenario(title: string, action: ScenarioAction): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function Scenario(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function Scenario(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioDefinition(...args);\n}\n\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: number\n): ScenarioScope;\nexport function ScenarioOutline(\n title: string,\n action: ScenarioAction,\n timeout: SizedTimeout\n): ScenarioScope;\nexport function ScenarioOutline(\n ...args: (string | ScenarioAction | SizedTimeout | number)[]\n): ScenarioScope {\n return ScenarioOutlineDefinition(...args);\n}\n\nexport function Rule(title: string, action: RuleAction): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: number\n): RuleScope;\nexport function Rule(\n title: string,\n action: RuleAction,\n timeout: SizedTimeout\n): RuleScope;\nexport function Rule(\n ...args: (string | RuleAction | SizedTimeout | number)[]\n): RuleScope {\n return RuleDefinition(...args);\n}\n/**\n * Defines a `Given` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n *\n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n *\n * N.b. The App instance is shared between all step definitions and hooks within\n * the context of a scenario, but cannot be accessed from the same step in a different\n * scenario.\n *\n * ```ts\n * import { Given } from '@autometa/runner'\n *\n * Given('I have a step', (app) => {\n * app.world.someData = 'some value'\n * })\n * // using destructuring\n * Given('I have a step', ({ world }) => {\n * world.someData = 'some value'\n * })\n * ```\n *\n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n *\n * ```ts\n * import { Given } from '@autometa/runner'\n *\n * // matches 'Given I have a step with a 'blue' value'\n * Given('I have a step with a {string} value', (value, { world }) => {\n * world.someData = value\n * })\n *\n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Given = GivenDefinition;\n/**\n * Defines a `When` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n *\n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n *\n * N.b. The App instance is shared between all step definitions and hooks within\n *\n * ```ts\n * import { When } from '@autometa/runner'\n *\n * When('I do something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * When('I do something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n *\n * ```ts\n * import { When } from '@autometa/runner'\n *\n * // matches 'When I do something with a 'blue' value'\n * When('I do something with a {string} value', async (value, { webdriver }) => {\n * await webdriver.click(`#some-button-${value}`)\n * })\n *\n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const When = WhenDefinition;\n\n/**\n * Defines a `Then` step definition. Matches a gherkin step\n * as either a string literal match, or a Cucumber Expression.\n *\n * The callback function is passed as it's last (or only) argument\n * a copy of the `App` object which also contains a reference to the World.\n * This can be used to access features, or store data across steps within a test.\n *\n * N.b. The App instance is shared between all step definitions and hooks within\n *\n * ```ts\n * import { Then } from '@autometa/runner'\n *\n * Then('I expect something', async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Then('I expect something', async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * Steps also support Cucumber Expressions, which can be used to match\n * dynamic values in the step.\n *\n * ```ts\n * import { Then } from '@autometa/runner'\n *\n * // matches 'Then I expect something with a 'blue' value'\n * Then('I expect something with a {string} value', async (value, { world }) => {\n * expect(world.someData).toBe(value)\n * })\n *\n * @param pattern The step pattern to match.\n * @param action The step action to execute.\n */\nexport const Then = ThenDefinition;\n\n/**\n * Defines a `Before` hook. Executes before each scenario.\n *\n * ```ts\n * import { Before } from '@autometa/runner'\n *\n * Before(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Before(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const Before = BeforeDefinition;\n\n/**\n * Defines a `After` hook. Executes after each scenario.\n *\n * ```ts\n * import { After } from '@autometa/runner'\n *\n * After(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * After(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const After = AfterDefinition;\n\n/**\n * Defines a `Setup` hook. Executes before all scenarios.\n * Setups are scoped, meaning a Setup defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n *\n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleton fixture.\n *\n * ```ts\n * import { Setup } from '@autometa/runner'\n *\n * Setup(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Setup(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const Teardown = TeardownDefinition;\n\n/**\n * Defines a `Teardown` hook. Executes after all scenarios have completed.\n * Teardowns are scoped, meaning a Teardown defined inside the scope of a rule\n * will only apply to scenarios within that rule.\n *\n * N.b the Setup Hook and Teardown Hook reference their own unique\n * copy of the App with it's own unique life cycle. Values stored here\n * will not be accessible in tests without a singleston fixture.\n * ```ts\n * import { Teardown } from '@autometa/runner'\n *\n * Teardown(async (app) => {\n * await app.webdriver.click('#some-button')\n * })\n *\n * // using destructuring\n * Teardown(async ({ webdriver }) => {\n * await webdriver.click('#some-button')\n * })\n * ```\n *\n * @param action The hook action to execute.\n */\nexport const Setup = SetupDefinition;\n","import {\n Config,\n TestExecutorConfig,\n defineConfig as dc\n} from \"@autometa/config\";\n\nexport const CONFIG = new Config(new Map<string, TestExecutorConfig>());\nexport const defineConfig = dc.bind(null, CONFIG);\n","import { ParameterTypeRegistry } from \"@cucumber/cucumber-expressions\";\nimport {\n BooleanParam,\n DateParam,\n NumberParam,\n PrimitiveParam,\n OrdinalParam,\n TextParam,\n defineParameterType as dpt\n} from \"@autometa/cucumber-expressions\";\n\nexport const PARAM_REGISTRY = new ParameterTypeRegistry();\n\n/**\n * Defines a parameter type for use in step definitions.\n * \n * ```ts\n * import { Color } from '../support/color';\n * \n * defineParameterType({\n * name: \"color\",\n * regexpPattern: /red|blue|yellow/,\n * transform: (value: string) => Color(value)\n * })\n * \n * // using regex arrays\n * defineParameterType({\n * name: \"color\",\n * regexpPattern: [/red/, /blue/, /yellow/],\n * transform: (value: string) => Color(value)\n * })\n * ```\n */\nexport const defineParameterType = dpt.bind(null, PARAM_REGISTRY);\n\ndefineParameterType(\n NumberParam,\n BooleanParam,\n PrimitiveParam,\n TextParam,\n DateParam,\n OrdinalParam\n);\n","import { PARAM_REGISTRY } from \"./parameters\";\nimport { GetCucumberFunctions, Pass } from \"@autometa/scopes\";\nimport { Coordinator } from \"@autometa/coordinator\";\nimport { CONFIG } from \"./config\";\nimport { makeTestEmitter } from \"./events\";\nimport { executor } from \"./executor\";\nimport { OPTS } from \"./app\";\nconst {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Global\n} = GetCucumberFunctions(PARAM_REGISTRY);\nconst coordinator = new Coordinator(Global, CONFIG, OPTS);\nGlobal.onFeatureExecuted = (feature, caller) => {\n const groupLogger = CONFIG.current.test?.groupLogging ?? false;\n const events = makeTestEmitter({ groupLogger });\n coordinator.run(feature, caller, events, executor);\n};\n\nexport {\n Feature,\n Scenario,\n ScenarioOutline,\n Rule,\n Given,\n When,\n Then,\n Before,\n After,\n Teardown,\n Setup,\n Pass\n};\n","import { TestEventEmitter } from \"@autometa/events\";\nimport { CONFIG } from \"./config\";\nexport * from \"@autometa/events\";\nimport { GroupLogEvents } from \"./event-logger\";\nimport p from \"path\";\nexport function makeTestEmitter(opts: { groupLogger: boolean }) {\n const events = CONFIG.current.events;\n const emitter = new TestEventEmitter();\n if (opts.groupLogger) {\n emitter.load(new GroupLogEvents());\n }\n if (!events) {\n return emitter;\n }\n\n for (const event of events) {\n const isLocal = isRelativePath(event) || isAbsolutePath(event);\n if (isLocal) {\n const uriRoot = process.cwd();\n const uri = p.join(uriRoot, event);\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(uri);\n if('default' in listener && typeof listener.default === \"function\") {\n emitter.load(new listener.default());\n return emitter;\n }\n if('default' in listener && typeof listener.default === \"object\") {\n emitter.load(listener.default);\n return emitter;\n }\n if(typeof listener === \"function\") {\n emitter.load(new listener());\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const listener = require(event);\n if('default' in listener) {\n emitter.load(listener.default);\n return emitter;\n }\n emitter.load(listener);\n return emitter;\n }\n\n return emitter;\n}\n\nfunction isRelativePath(path: string) {\n return path.startsWith(\".\");\n}\n\nfunction isAbsolutePath(path: string) {\n return p.isAbsolute(path);\n}\n","import {\n EndAfterOpts,\n EndBeforeOpts,\n EndFeatureOpts,\n EndRuleOpts,\n EndScenarioOpts,\n EndScenarioOutlineOpts,\n EndSetupOpts,\n EndStepOpts,\n EndTeardownOpts,\n EventSubscriber,\n StartAfterOpts,\n StartBeforeOpts,\n StartFeatureOpts,\n StartRuleOpts,\n StartScenarioOpts,\n StartScenarioOutlineOpts,\n StartSetupOpts,\n StartStepOpts,\n StartTeardownOpts\n} from \"@autometa/events\";\nimport colors from \"colors-cli\";\nexport class GroupLogEvents implements EventSubscriber {\n onFeatureStart({ title }: StartFeatureOpts) {\n console.group(title);\n console.group();\n }\n onFeatureEnd({ title, status }: EndFeatureOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioStart({ title }: StartScenarioOpts): void {\n console.group(title);\n console.group();\n }\n onScenarioEnd({ title, status }: EndScenarioOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onScenarioOutlineStart(opts: StartScenarioOutlineOpts): void {\n console.group(opts.title);\n console.group();\n }\n onScenarioOutlineEnd({ title, status }: EndScenarioOutlineOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onRuleStart({ title }: StartRuleOpts): void {\n console.group(title);\n console.group();\n }\n onRuleEnd({ title, status }: EndRuleOpts): void {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onStepStart({ title }: StartStepOpts) {\n console.group(title);\n console.group();\n }\n onStepEnd({ title, status }: EndStepOpts) {\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onBeforeStart({ title, status }: StartBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onBeforeEnd({ title, status }: EndBeforeOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onAfterStart({ title, status }: StartAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onAfterEnd({ title, status }: EndAfterOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onTeardownStart({ title, status }: StartTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.group(title);\n console.group();\n }\n onTeardownEnd({ title, status }: EndTeardownOpts): void {\n if (status === \"SKIPPED\") {\n return;\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n onSetupStart({title, status}: StartSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.group(title);\n console.group();\n }\n onSetupEnd({ title, status }: EndSetupOpts): void {\n if (status === \"SKIPPED\") {\n return\n }\n console.groupEnd();\n console.log(colorStatus(status, `Ending ${title}`));\n console.groupEnd();\n }\n}\nfunction colorStatus(\n status: \"FAILED\" | \"PASSED\" | \"SKIPPED\" | \"BROKEN\" | undefined,\n text: string\n) {\n switch (status) {\n case \"FAILED\":\n return `${colors.red(\"x\")} ${text}`;\n case \"PASSED\":\n return `${colors.green(\"✔️\")} ${text}`;\n case \"SKIPPED\":\n return `${colors.yellow(\"⊘\")} ${text}`;\n default:\n return text;\n }\n}\n","import { execute } from \"@autometa/jest-executor\";\n\nexport const executor = execute;\n","import \"@autometa/types\";\nimport { AppType as at } from \"@autometa/app\";\nimport { CoordinatorOpts } from \"@autometa/coordinator\";\nexport { AutometaApp, AutometaWorld, App, World } from \"@autometa/app\";\nexport {\n Fixture,\n INJECTION_SCOPE,\n InjectionScope,\n Token,\n Container,\n Constructor\n} from \"@autometa/injection\";\nexport const OPTS = {} as Record<string, CoordinatorOpts>;\n/**\n * Marks a class as being the `App` of the test framework. The `App` is the\n * entry point for the test framework. The App will be made available as the final\n * argument in the Step Definition Callbacks.\n *\n * ```ts\n *\n * @AppType(World)\n * @Constructor(MyClient)\n * class App {\n * constructor(readonly myCLient: MyClient) {}\n * }\n * ```\n * Or with tokens\n * \n * ```ts\n * import from \"@autometa/runner\";\n * import { World } from \"./default.world\";\n * @AppType(World)\n * @Constructor(HTTP, Token(\"MyClient\"))\n * class App {\n * constructor(readonly http: HTTP, readonly myClient: MyClient) {}\n * }\n * ```\n */\nexport const AppType = at.bind(null, OPTS);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,eAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAIO;AAEA,IAAM,SAAS,IAAI,qBAAO,oBAAI,IAAgC,CAAC;AAC/D,IAAM,eAAe,cAAAC,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wBAAc,8BA3Bd;AAwCA,sBAA4B;AAC5B,oBAAuC;AACvC,qBAAkD;AAClD,4BAAqB;AACrB,IAAAC,iBAAsB;AACtB,wBAAc,gBA7Cd;AA8CA,wBAAc,2BA9Cd;AA+CA,wBAAc,gCA/Cd;AAgDA,6BAIO;AA0LA,SAASC,YACX,MACW;AACd,SAAO,QAAkB,GAAG,IAAI;AAClC;AAaO,SAASC,aACX,MACY;AACf,SAAO,SAAmB,GAAG,IAAI;AACnC;AAgBO,SAASC,oBACX,MACY;AACf,SAAO,gBAA0B,GAAG,IAAI;AAC1C;AAaO,SAASC,SACX,MACQ;AACX,SAAO,KAAe,GAAG,IAAI;AAC/B;AAuCO,IAAMC,SAAQ;AAsCd,IAAMC,QAAO;AAuCb,IAAMC,QAAO;AAoBb,IAAMC,UAAS;AAoBf,IAAMC,SAAQ;AA0Bd,IAAMC,YAAW;AAyBjB,IAAMC,SAAQ;","names":["After","Before","Feature","Given","Rule","Scenario","ScenarioOutline","Setup","Teardown","Then","When","dc","import_cucumber_expressions","dpt","colors","p","listener","import_app","at","import_scopes","Feature","Scenario","ScenarioOutline","Rule","Given","When","Then","Before","After","Teardown","Setup"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autometa/runner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,22 +30,23 @@
|
|
|
30
30
|
"vitest": "0.34.6"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@autometa/app": "^0.
|
|
33
|
+
"@autometa/app": "^0.3.0",
|
|
34
34
|
"@autometa/asserters": "^0.1.8",
|
|
35
35
|
"@autometa/bind-decorator": "^0.5.1",
|
|
36
|
-
"@autometa/config": "^0.1.
|
|
37
|
-
"@autometa/coordinator": "^0.
|
|
36
|
+
"@autometa/config": "^0.1.19",
|
|
37
|
+
"@autometa/coordinator": "^0.3.0",
|
|
38
38
|
"@autometa/cucumber-expressions": "^0.3.11",
|
|
39
39
|
"@autometa/datetime": "^0.1.16",
|
|
40
40
|
"@autometa/errors": "^0.2.2",
|
|
41
41
|
"@autometa/events": "^0.2.10",
|
|
42
42
|
"@autometa/fixture-proxies": "^0.1.3",
|
|
43
43
|
"@autometa/gherkin": "^0.5.7",
|
|
44
|
-
"@autometa/http": "^1.0
|
|
45
|
-
"@autometa/
|
|
44
|
+
"@autometa/http": "^1.2.0",
|
|
45
|
+
"@autometa/injection": "^0.1.0",
|
|
46
|
+
"@autometa/jest-executor": "^0.4.0",
|
|
46
47
|
"@autometa/phrases": "^0.1.12",
|
|
47
|
-
"@autometa/scopes": "^0.4.
|
|
48
|
-
"@autometa/test-builder": "^0.1.
|
|
48
|
+
"@autometa/scopes": "^0.4.12",
|
|
49
|
+
"@autometa/test-builder": "^0.1.41",
|
|
49
50
|
"@autometa/types": "^0.4.1",
|
|
50
51
|
"@cucumber/cucumber-expressions": "^16.1.2",
|
|
51
52
|
"colors-cli": "^1.0.32"
|