@autometa/test-builder 0.4.2 → 1.0.0-rc.1
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/README.md +1 -1
- package/dist/build-test-plan.d.ts +2 -0
- package/dist/index.cjs +1133 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -161
- package/dist/index.js +1047 -649
- package/dist/index.js.map +1 -1
- package/dist/internal/nodes.d.ts +69 -0
- package/dist/internal/scope-resolution.d.ts +4 -0
- package/dist/internal/summaries.d.ts +6 -0
- package/dist/internal/test-plan-builder.d.ts +55 -0
- package/dist/internal/utils.d.ts +18 -0
- package/dist/types.d.ts +113 -0
- package/package.json +29 -31
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -4
- package/.turbo/turbo-coverage.log +0 -36
- package/.turbo/turbo-lint$colon$fix.log +0 -4
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-lint:fix.log +0 -4
- package/.turbo/turbo-prettify.log +0 -6
- package/.turbo/turbo-test.log +0 -21
- package/CHANGELOG.md +0 -654
- package/dist/esm/index.js +0 -700
- package/dist/esm/index.js.map +0 -1
- package/dist/index.d.cts +0 -161
- package/tsup.config.ts +0 -14
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bridges/bridge.ts","../../src/bridges/bridge-search.ts","../../src/bridges/bridge-query.ts","../../src/gherkin-walker.ts","../../src/scope-search.ts","../../src/test-builder.ts"],"sourcesContent":["import { App } from \"@autometa/app\";\nimport {\n Background,\n DataTable,\n Example,\n Examples,\n Feature,\n GherkinNode,\n Rule,\n Scenario,\n ScenarioOutline,\n Step,\n} from \"@autometa/gherkin\";\nimport { BackgroundScope, GlobalScope } from \"@autometa/scopes\";\nimport {\n FeatureScope,\n RuleScope,\n ScenarioOutlineScope,\n ScenarioScope,\n Scope,\n StepScope,\n} from \"@autometa/scopes\";\n\nexport abstract class GherkinCodeBridge {\n abstract data: { gherkin: GherkinNode; scope: Scope };\n}\nexport class GlobalBridge extends GherkinCodeBridge {\n readonly data: { gherkin: GherkinNode; scope: GlobalScope };\n constructor(scope: GlobalScope) {\n super();\n const nullNode = class extends GherkinNode {\n keyword = \"none\";\n };\n this.data = {\n scope,\n gherkin: new nullNode(),\n };\n }\n}\nexport class FeatureBridge extends GherkinCodeBridge {\n data: { gherkin: Feature; scope: FeatureScope };\n background: BackgroundBridge;\n scenarios: (ScenarioBridge | ScenarioOutlineBridge)[] = [];\n rules: RuleBridge[] = [];\n steps: StepBridge[] = [];\n\n accumulateTags() {\n const scenarioTags = this.scenarios.map((scenario) => scenario.accumulateTags()).flat();\n const ruleTags = this.rules.map((rule) => rule.accumulateTags()).flat();\n const allTags = [...this.data.gherkin.tags, ...scenarioTags, ...ruleTags];\n return [...new Set(allTags)];\n }\n}\nexport class BackgroundBridge extends GherkinCodeBridge {\n data: { gherkin: Background; scope: BackgroundScope };\n steps: StepBridge[] = [];\n}\n\nexport class RuleBridge extends GherkinCodeBridge {\n data: { gherkin: Rule; scope: RuleScope };\n background: BackgroundBridge;\n scenarios: (ScenarioBridge | ScenarioOutlineBridge)[] = [];\n steps: StepBridge[] = [];\n\n accumulateTags() {\n const scenarioTags = this.scenarios.map((scenario) => scenario.accumulateTags()).flat();\n const allTags = [...this.data.gherkin.tags, ...scenarioTags];\n return [...new Set(allTags)];\n }\n}\n\nexport class ScenarioBridge extends GherkinCodeBridge {\n data: { gherkin: Scenario; scope: ScenarioScope };\n steps: StepBridge[] = [];\n report: {\n passed?: boolean;\n error?: Error;\n } = {};\n\n get title() {\n return this.data.scope.title(this.data.gherkin);\n }\n get tags() {\n return [...this.data.gherkin.tags];\n }\n\n accumulateTags() {\n return this.tags;\n }\n}\nexport class ExampleBridge extends GherkinCodeBridge {\n data: { gherkin: Example; scope: ScenarioScope };\n steps: StepBridge[] = [];\n report: {\n passed?: boolean;\n error?: Error;\n } = {};\n get title() {\n return this.data.scope.title(this.data.gherkin);\n }\n get tags() {\n return [...this.data.gherkin.tags];\n }\n\n accumulateTags() {\n return this.tags;\n }\n}\nexport class ScenarioOutlineBridge extends GherkinCodeBridge {\n data: { gherkin: ScenarioOutline; scope: ScenarioOutlineScope };\n examples: ExamplesBridge[] = [];\n steps: StepBridge[] = [];\n get title() {\n return this.data.scope.title(this.data.gherkin);\n }\n get tags() {\n return [...this.data.gherkin.tags];\n }\n\n accumulateTags() {\n const exampleTags = this.examples.map((example) => example.tags).flat();\n const allTags = [...this.data.gherkin.tags, ...exampleTags];\n return [...new Set(allTags)];\n }\n}\n\nexport class ExamplesBridge extends GherkinCodeBridge {\n data: { gherkin: Examples; scope: ScenarioOutlineScope };\n scenarios: ScenarioBridge[] = [];\n steps: StepBridge[] = [];\n get title() {\n return this.data.scope.title(this.data.gherkin);\n }\n \n get tags() {\n return [...this.data.gherkin.tags];\n }\n\n accumulateTags() {\n const scenarioTags = this.scenarios.map((scenario) => scenario.accumulateTags()).flat();\n const allTags = [...this.data.gherkin.tags, ...scenarioTags];\n return [...new Set(allTags)];\n }\n}\n\nexport class StepBridge extends GherkinCodeBridge {\n data: {\n gherkin: Step;\n scope: StepScope<string, DataTable | undefined>;\n args: undefined | ((app: App) => unknown[]);\n };\n\n get args() {\n return this.data.args;\n }\n\n get expressionText() {\n return this.data.scope.expression.source;\n }\n}\n","import { AutomationError } from \"@autometa/errors\";\nimport {\n ExamplesBridge,\n FeatureBridge,\n GherkinCodeBridge,\n ScenarioBridge,\n ScenarioOutlineBridge,\n RuleBridge,\n} from \"./bridge\";\n\nexport function find(\n bridge: FeatureBridge | RuleBridge | ScenarioOutlineBridge,\n testName: string\n): GherkinCodeBridge | undefined {\n if (bridge instanceof FeatureBridge) {\n return findByFeature(bridge, testName);\n }\n if (bridge instanceof RuleBridge) {\n return findByRule(bridge, testName);\n }\n if (bridge instanceof ScenarioOutlineBridge) {\n return findScenarioOutlineOrChild(bridge, testName);\n }\n\n throw new AutomationError(`Could not find test matching ${testName}`);\n}\nfunction findByFeature(\n feature: FeatureBridge,\n testName: string\n): GherkinCodeBridge | undefined {\n const title = feature.data.scope.title(feature.data.gherkin);\n const byScenario = findTestTypes(feature.scenarios, testName, title);\n if (byScenario) {\n return byScenario;\n }\n const byRule = findRuleTypes(feature.rules, testName, title);\n if (byRule) {\n return byRule;\n }\n}\nfunction findByRule(\n rule: RuleBridge,\n testName: string\n): GherkinCodeBridge | undefined {\n const title = rule.data.scope.title(rule.data.gherkin);\n const byScenario = findTestTypes(rule.scenarios, testName, title);\n if (byScenario) {\n return byScenario;\n }\n const byRule = findRuleOrChild(rule, testName, title);\n if (byRule) {\n return byRule;\n }\n}\n\nexport function findTestTypes(\n scenarios: (ScenarioBridge | ScenarioOutlineBridge | ExamplesBridge)[],\n testName: string,\n from?: string\n) {\n for (const scenario of scenarios) {\n if (scenario instanceof ScenarioOutlineBridge) {\n const found = findScenarioOutlineOrChild(scenario, testName, from);\n if (found) {\n return found;\n }\n }\n if (scenario instanceof ExamplesBridge) {\n const found = findExamplesOrChild(scenario, testName, from);\n if (found) {\n return found;\n }\n }\n if (scenario instanceof ScenarioBridge) {\n const found = findScenario(scenario, testName, from);\n if (found) {\n return found;\n }\n }\n }\n}\n\nexport function findRuleTypes(\n rules: RuleBridge[],\n testName: string,\n from?: string\n) {\n for (const rule of rules) {\n const found = findRuleOrChild(rule, testName, from);\n if (found) {\n return found;\n }\n }\n}\n\nexport function findRuleOrChild(\n rule: RuleBridge,\n testName: string,\n from?: string\n) {\n const {\n data: { scope, gherkin },\n } = rule;\n const title = scope.title(gherkin);\n if (testName === title) {\n return rule;\n }\n if (from) {\n const fullTitle = `${from} ${title}`;\n if (fullTitle === testName) {\n return rule;\n }\n }\n const newFrom = appendPath(from, title);\n return findTestTypes(rule.scenarios, testName, newFrom);\n}\n\nexport function findScenarioOutlineOrChild(\n outline: ScenarioOutlineBridge,\n testName: string,\n from?: string\n) {\n const {\n data: { scope, gherkin },\n } = outline;\n const title = scope.title(gherkin);\n if (testName === title) {\n return outline;\n }\n if (from) {\n const fullTitle = `${from} ${title}`;\n if (fullTitle === testName) {\n return outline;\n }\n }\n for (const example of outline.examples) {\n const newFrom = appendPath(from, title);\n const found = findExamplesOrChild(example, testName, newFrom);\n if (found) {\n return found;\n }\n }\n}\n\nfunction appendPath(from: string | undefined, title: string) {\n return from ? `${from} ${title}` : title;\n}\n\nexport function findExamplesOrChild(\n example: ExamplesBridge,\n testName: string,\n from?: string\n) {\n const {\n data: { gherkin },\n } = example;\n const title = `${gherkin.keyword}: ${gherkin.name}`;\n if (testName === title) {\n return example;\n }\n if (from) {\n const fullTitle = `${from} ${title}`;\n if (fullTitle === testName) {\n return example;\n }\n }\n for (const scenario of example.scenarios) {\n const newFrom = appendPath(from, title);\n const found = findScenario(scenario, testName, newFrom);\n if (found) {\n return found;\n }\n }\n}\n\nexport function findScenario(\n scenario: ScenarioBridge,\n testName: string,\n from?: string\n) {\n const {\n data: { scope, gherkin },\n } = scenario;\n const title = scope.title(gherkin);\n if (testName === title) {\n return scenario;\n }\n if (from) {\n const fullTitle = `${from} ${title}`;\n if (fullTitle === testName) {\n return scenario;\n }\n }\n}\n","import { Background, GherkinNode } from \"@autometa/gherkin\";\nimport {\n FeatureBridge,\n RuleBridge,\n ScenarioBridge,\n ScenarioOutlineBridge,\n} from \".\";\n\nfunction failed(bridge: FeatureBridge | RuleBridge | ScenarioOutlineBridge) {\n const accumulator: ScenarioBridge[] = [];\n if (bridge instanceof ScenarioOutlineBridge) {\n return failedOutline(bridge);\n }\n for (const scenario of bridge.scenarios) {\n if (scenario instanceof ScenarioOutlineBridge) {\n accumulator.push(...failedOutline(scenario));\n } else if (scenario.report.error !== undefined) {\n accumulator.push(scenario);\n }\n }\n if (bridge instanceof FeatureBridge) {\n accumulator.push(...failedRule(bridge));\n }\n return accumulator;\n}\n\nfunction failedOutline(bridge: ScenarioOutlineBridge) {\n const accumulator: ScenarioBridge[] = [];\n\n for (const example of bridge.examples) {\n for (const scenario of example.scenarios) {\n if (scenario.report.error) {\n accumulator.push(scenario);\n }\n }\n }\n return accumulator;\n}\n\nfunction failedRule(bridge: FeatureBridge) {\n const accumulator: ScenarioBridge[] = [];\n for (const rule of bridge.rules) {\n for (const scenario of rule.scenarios) {\n if (scenario instanceof ScenarioOutlineBridge) {\n accumulator.push(...failedOutline(scenario));\n } else if (scenario.report.error) {\n accumulator.push(scenario);\n }\n }\n }\n return accumulator;\n}\n\nfunction gherkinToTestNames(\n node: GherkinNode,\n path = \"\",\n accumulator: string[] = []\n) {\n if (!(\"name\" in node) || node instanceof Background) {\n return;\n }\n const title = `${node.keyword}: ${node.name}`;\n const fullPath = path ? `${path} ${title}` : title;\n accumulator.push(fullPath);\n if (!node.children) {\n return;\n }\n for (const child of node.children) {\n if (!(\"name\" in child) || child instanceof Background) {\n continue;\n }\n gherkinToTestNames(child, fullPath, accumulator);\n }\n return accumulator;\n}\n\nexport const Query = {\n find: {\n failed,\n },\n testNames: gherkinToTestNames,\n};\n","import {\n Background,\n Examples,\n Feature,\n GherkinNode,\n Rule,\n Scenario,\n ScenarioOutline,\n Step,\n} from \"@autometa/gherkin\";\nimport { AutomationError } from \"@autometa/errors\";\nimport { Example } from \"@autometa/gherkin\";\n\nexport type WalkFunction<T extends GherkinNode, TAccumulator, TReturn> = (\n node: T,\n accumulator: TAccumulator,\n lastNode?: GherkinNode\n) => TReturn;\n\nexport type WalkFunctionMap<TAccumulator> = {\n onFeature?: WalkFunction<Feature, TAccumulator, TAccumulator>;\n onRule?: WalkFunction<Rule, TAccumulator, TAccumulator>;\n onBackground?: WalkFunction<Background, TAccumulator, TAccumulator>;\n onScenario?: WalkFunction<Scenario, TAccumulator, TAccumulator>;\n onScenarioOutline?: WalkFunction<ScenarioOutline, TAccumulator, TAccumulator>;\n onExamples?: WalkFunction<Examples, TAccumulator, TAccumulator>;\n onExample?: WalkFunction<Example, TAccumulator, TAccumulator>;\n onStep?: WalkFunction<Step, TAccumulator, TAccumulator>;\n};\n\nexport class GherkinWalker {\n static walk<TAccumulator>(\n walkFunction: WalkFunctionMap<TAccumulator>,\n childNode: GherkinNode,\n accumulator: TAccumulator,\n parentNode?: GherkinNode\n ) {\n if (accumulator === undefined) {\n throw new AutomationError(\n `An accumulator must be defined to continue the walker from ${\n childNode.constructor.name\n }${JSON.stringify(childNode)}`\n );\n }\n this.#walkNode(childNode, accumulator, walkFunction, parentNode);\n return accumulator;\n }\n\n static #walkNode<TAccumulator>(\n child: GherkinNode,\n accumulator: TAccumulator,\n walkFunction: WalkFunctionMap<TAccumulator>,\n lastNode?: GherkinNode\n ) {\n if (child instanceof Feature && walkFunction.onFeature) {\n const acc = walkFunction.onFeature(child, accumulator, lastNode);\n return this.#walkChildren(child, acc, walkFunction);\n }\n\n if (child instanceof Rule && walkFunction.onRule) {\n const acc = walkFunction.onRule(child, accumulator, lastNode);\n return this.#walkChildren(child, acc, walkFunction);\n }\n\n if (child instanceof Examples) {\n const acc = walkFunction.onExamples?.(child, accumulator, lastNode);\n return this.#walkChildren(child, acc, walkFunction);\n }\n\n if (child instanceof Example) {\n const acc = walkFunction.onExample?.(child, accumulator, lastNode);\n return this.#walkChildren(child, acc, walkFunction);\n }\n\n if (child instanceof Scenario) {\n const acc = walkFunction.onScenario?.(child, accumulator, lastNode);\n return this.#walkChildren(child, acc, walkFunction);\n }\n\n if (child instanceof ScenarioOutline) {\n const acc = walkFunction.onScenarioOutline?.(\n child,\n accumulator,\n lastNode\n );\n return this.#walkChildren(child, acc, walkFunction);\n }\n\n if (child instanceof Background) {\n const acc = walkFunction?.onBackground?.(child, accumulator, lastNode);\n return this.#walkChildren(child, acc, walkFunction);\n }\n\n if (child instanceof Step) {\n const acc = walkFunction.onStep?.(child, accumulator, lastNode);\n return this.#walkChildren(child, acc, walkFunction);\n }\n }\n\n static #walkChildren<TAccumulator>(\n child: GherkinNode,\n accumulator: TAccumulator,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n walkFunction: WalkFunctionMap<any>\n ) {\n for (const node of child.children) {\n this.walk(walkFunction, node, accumulator, child);\n }\n }\n}\n","import { AutomationError } from \"@autometa/errors\";\nimport { StepKeyword } from \"@autometa/gherkin\";\nimport { StepType } from \"@autometa/gherkin\";\nimport {\n Scope,\n RuleScope,\n ScenarioScope,\n ScenarioOutlineScope,\n BackgroundScope,\n} from \"@autometa/scopes\";\nimport { Empty_Function } from \"@autometa/scopes\";\n\nexport function scope(value: Scope) {\n return {\n findRule: (name: string) => {\n const found = value.closedScopes.find((child) => {\n return child instanceof RuleScope && child.name === name;\n }) as RuleScope | undefined;\n if (!found) {\n const rule = new RuleScope(\n name,\n Empty_Function,\n undefined,\n value.hooks,\n value.steps\n );\n value.attach(rule);\n return rule;\n }\n return found;\n },\n findScenario: (name: string) => {\n const found = value.closedScopes.find((child) => {\n return (\n child instanceof ScenarioScope &&\n child.name === name &&\n !(child instanceof ScenarioOutlineScope)\n );\n }) as ScenarioScope;\n if (!found) {\n const scenario = new ScenarioScope(\n name,\n Empty_Function,\n undefined,\n value.hooks,\n value.steps\n );\n value.attach(scenario);\n return scenario;\n }\n return found;\n },\n findBackground: ({ name }: { name?: string }): BackgroundScope => {\n const found = value.closedScopes.find((child) => {\n return child instanceof BackgroundScope;\n }) as BackgroundScope | undefined;\n if (found && found.name !== name) {\n throw new AutomationError(\n `Could not find background matching ${name} but found ${found?.name}`\n );\n }\n if (found) {\n return found;\n }\n\n const bgScope = new BackgroundScope(\n name,\n Empty_Function,\n value.hooks,\n value.steps\n );\n value.attach(bgScope);\n return bgScope;\n },\n findScenarioOutline: (name: string): ScenarioOutlineScope => {\n const found = value.closedScopes.find((child) => {\n return child instanceof ScenarioOutlineScope && child.name === name;\n }) as ScenarioOutlineScope | undefined;\n if (!found) {\n const scenarioOutline = new ScenarioOutlineScope(\n name,\n Empty_Function,\n undefined,\n value.hooks,\n value.steps\n );\n value.attach(scenarioOutline);\n return scenarioOutline;\n }\n return found;\n },\n findExample(name: string): ScenarioScope {\n const found = value.closedScopes.find((child) => {\n if (!(child instanceof ScenarioScope)) {\n return false;\n }\n return child.name === name;\n }) as ScenarioScope;\n if (!found) {\n const scenario = new ScenarioScope(\n name,\n Empty_Function,\n undefined,\n value.hooks,\n value.steps\n );\n value.attach(scenario);\n return scenario;\n }\n return found;\n },\n findStep: (keywordType: StepType, keyword: StepKeyword, name: string) => {\n return value.steps.find(keywordType, keyword, name);\n },\n };\n}\n","import {\n FeatureScope,\n RuleScope,\n ScenarioOutlineScope,\n StepCache,\n} from \"@autometa/scopes\";\nimport {\n BackgroundBridge,\n ExampleBridge,\n ExamplesBridge,\n FeatureBridge,\n GherkinCodeBridge,\n RuleBridge,\n ScenarioBridge,\n ScenarioOutlineBridge,\n StepBridge,\n} from \"./bridges\";\nimport { GherkinWalker } from \"./gherkin-walker\";\nimport { scope } from \"./scope-search\";\nimport { Bind } from \"@autometa/bind-decorator\";\nimport { Example, Feature, GherkinNode, Scenario } from \"@autometa/gherkin\";\nimport { raise } from \"@autometa/errors\";\nimport { StepKeyword, StepType } from \"@autometa/types\";\nexport class TestBuilder {\n constructor(readonly feature: Feature) {}\n @Bind\n onFeatureExecuted(featureScope: FeatureScope) {\n const bridge = new FeatureBridge();\n GherkinWalker.walk<GherkinCodeBridge>(\n {\n onFeature: (feature, accumulator) => {\n accumulator.data = { gherkin: feature, scope: featureScope };\n return accumulator;\n },\n onRule: (rule, accumulator) => {\n const ruleScope = scope(featureScope).findRule(\n rule.name\n ) as RuleScope;\n const bridge = new RuleBridge();\n bridge.data = { gherkin: rule, scope: ruleScope };\n (accumulator as FeatureBridge).rules.push(bridge);\n return bridge;\n },\n onScenario: (gherkin, accumulator) => {\n const scenarioScope = scope(accumulator.data.scope).findScenario(\n gherkin.name\n );\n const bridge = new ScenarioBridge();\n bridge.data = { gherkin, scope: scenarioScope };\n (accumulator as FeatureBridge | RuleBridge).scenarios.push(bridge);\n // if accumulator is a outline, push to examples\n\n return bridge;\n },\n onScenarioOutline: (gherkin, accumulator) => {\n const outlineScope = scope(\n accumulator.data.scope\n ).findScenarioOutline(gherkin.name);\n const bridge = new ScenarioOutlineBridge();\n bridge.data = { gherkin, scope: outlineScope };\n (accumulator as FeatureBridge | RuleBridge).scenarios.push(bridge);\n return bridge;\n },\n onExamples: (gherkin, accumulator) => {\n const outlineScope = accumulator.data.scope as ScenarioOutlineScope;\n const bridge = new ExamplesBridge();\n bridge.data = { gherkin, scope: outlineScope };\n (accumulator as ScenarioOutlineBridge).examples.push(bridge);\n return bridge;\n },\n onExample(gherkin, accumulator) {\n if (gherkin.table === undefined) {\n raise(\n `Example ${gherkin.name} has no Example Table data. A Row of data is required.`\n );\n }\n const title = gherkin.name;\n\n const exampleScope = scope(accumulator.data.scope).findExample(title);\n const bridge = new ExampleBridge();\n bridge.data = { gherkin, scope: exampleScope };\n const acc = accumulator as ExamplesBridge;\n acc.scenarios.push(bridge);\n return bridge;\n },\n onBackground(gherkin, accumulator) {\n const backgroundScope = scope(accumulator.data.scope).findBackground({\n name: gherkin.name,\n });\n const bridge = new BackgroundBridge();\n bridge.data = { gherkin, scope: backgroundScope };\n const acc = accumulator as FeatureBridge | RuleBridge;\n acc.background = bridge;\n return bridge;\n },\n onStep: (step, accumulator) => {\n const {\n data: { scope: parentScope, gherkin },\n } = accumulator;\n const { keyword, keywordType, text } = step;\n const cache = parentScope.steps;\n const existing = getStep(\n accumulator,\n gherkin,\n cache,\n keywordType,\n keyword,\n text\n );\n const bridge = new StepBridge();\n const acc = accumulator as\n | BackgroundBridge\n | ScenarioBridge\n | RuleBridge\n | FeatureBridge;\n\n if (existing) {\n bridge.data = {\n gherkin: step,\n scope: existing.step,\n args: existing.args,\n };\n } else {\n raise(`No step definition matching ${step.keyword} ${step.text}`);\n }\n\n acc.steps.push(bridge);\n return accumulator;\n },\n },\n this.feature,\n bridge\n );\n return bridge;\n }\n}\nfunction getStep(\n accumulator: GherkinCodeBridge,\n gherkin: GherkinNode,\n cache: StepCache,\n keywordType: StepType,\n keyword: StepKeyword,\n text: string\n) {\n try {\n if (accumulator instanceof ExampleBridge) {\n const scenario = gherkin as Example;\n if (scenario.table) {\n return cache.findByExample(keywordType, keyword, text, scenario.table);\n }\n }\n return cache.find(keywordType, keyword, text);\n } catch (e) {\n const cause = e as Error;\n const { title } = gherkin as Scenario;\n raise(`'${title}' could not find a step definition`, { cause });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EAME;AAAA,OAKK;AAWA,IAAe,oBAAf,MAAiC;AAExC;AACO,IAAM,eAAN,cAA2B,kBAAkB;AAAA,EAElD,YAAYA,QAAoB;AAC9B,UAAM;AACN,UAAM,WAAW,cAAc,YAAY;AAAA,MAA1B;AAAA;AACf,uBAAU;AAAA;AAAA,IACZ;AACA,SAAK,OAAO;AAAA,MACV,OAAAA;AAAA,MACA,SAAS,IAAI,SAAS;AAAA,IACxB;AAAA,EACF;AACF;AACO,IAAM,gBAAN,cAA4B,kBAAkB;AAAA,EAA9C;AAAA;AAGL,qBAAwD,CAAC;AACzD,iBAAsB,CAAC;AACvB,iBAAsB,CAAC;AAAA;AAAA,EAEvB,iBAAiB;AACf,UAAM,eAAe,KAAK,UAAU,IAAI,CAAC,aAAa,SAAS,eAAe,CAAC,EAAE,KAAK;AACtF,UAAM,WAAW,KAAK,MAAM,IAAI,CAAC,SAAS,KAAK,eAAe,CAAC,EAAE,KAAK;AACtE,UAAM,UAAU,CAAC,GAAG,KAAK,KAAK,QAAQ,MAAM,GAAG,cAAc,GAAG,QAAQ;AACxE,WAAO,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC;AAAA,EAC7B;AACF;AACO,IAAM,mBAAN,cAA+B,kBAAkB;AAAA,EAAjD;AAAA;AAEL,iBAAsB,CAAC;AAAA;AACzB;AAEO,IAAM,aAAN,cAAyB,kBAAkB;AAAA,EAA3C;AAAA;AAGL,qBAAwD,CAAC;AACzD,iBAAsB,CAAC;AAAA;AAAA,EAEvB,iBAAiB;AACf,UAAM,eAAe,KAAK,UAAU,IAAI,CAA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AAa,SAAS,IAAI;AAAA,EAC9C,SAAS,GAAG;AACV,UAAM,QAAQ;AACd,UAAM,EAAE,MAAM,IAAI;AAClB,UAAM,IAAI,KAAK,sCAAsC,EAAE,MAAM,CAAC;AAAA,EAChE;AACF;","names":["scope","scope","Background","Background","Background","Examples","Feature","Rule","Scenario","ScenarioOutline","Step","AutomationError","Example","AutomationError","Feature","Rule","Examples","Example","Scenario","ScenarioOutline","Background","Step","AutomationError","bridge"]}
|
package/dist/index.d.cts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import * as _autometa_app from '@autometa/app';
|
|
2
|
-
import { App } from '@autometa/app';
|
|
3
|
-
import { GherkinNode, Feature, Background, Rule, Scenario, Example, ScenarioOutline, Examples, Step, DataTable, StepType, StepKeyword } from '@autometa/gherkin';
|
|
4
|
-
import * as _autometa_scopes from '@autometa/scopes';
|
|
5
|
-
import { Scope, GlobalScope, FeatureScope, BackgroundScope, RuleScope, ScenarioScope, ScenarioOutlineScope, StepScope } from '@autometa/scopes';
|
|
6
|
-
|
|
7
|
-
declare abstract class GherkinCodeBridge {
|
|
8
|
-
abstract data: {
|
|
9
|
-
gherkin: GherkinNode;
|
|
10
|
-
scope: Scope;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
declare class GlobalBridge extends GherkinCodeBridge {
|
|
14
|
-
readonly data: {
|
|
15
|
-
gherkin: GherkinNode;
|
|
16
|
-
scope: GlobalScope;
|
|
17
|
-
};
|
|
18
|
-
constructor(scope: GlobalScope);
|
|
19
|
-
}
|
|
20
|
-
declare class FeatureBridge extends GherkinCodeBridge {
|
|
21
|
-
data: {
|
|
22
|
-
gherkin: Feature;
|
|
23
|
-
scope: FeatureScope;
|
|
24
|
-
};
|
|
25
|
-
background: BackgroundBridge;
|
|
26
|
-
scenarios: (ScenarioBridge | ScenarioOutlineBridge)[];
|
|
27
|
-
rules: RuleBridge[];
|
|
28
|
-
steps: StepBridge[];
|
|
29
|
-
accumulateTags(): string[];
|
|
30
|
-
}
|
|
31
|
-
declare class BackgroundBridge extends GherkinCodeBridge {
|
|
32
|
-
data: {
|
|
33
|
-
gherkin: Background;
|
|
34
|
-
scope: BackgroundScope;
|
|
35
|
-
};
|
|
36
|
-
steps: StepBridge[];
|
|
37
|
-
}
|
|
38
|
-
declare class RuleBridge extends GherkinCodeBridge {
|
|
39
|
-
data: {
|
|
40
|
-
gherkin: Rule;
|
|
41
|
-
scope: RuleScope;
|
|
42
|
-
};
|
|
43
|
-
background: BackgroundBridge;
|
|
44
|
-
scenarios: (ScenarioBridge | ScenarioOutlineBridge)[];
|
|
45
|
-
steps: StepBridge[];
|
|
46
|
-
accumulateTags(): string[];
|
|
47
|
-
}
|
|
48
|
-
declare class ScenarioBridge extends GherkinCodeBridge {
|
|
49
|
-
data: {
|
|
50
|
-
gherkin: Scenario;
|
|
51
|
-
scope: ScenarioScope;
|
|
52
|
-
};
|
|
53
|
-
steps: StepBridge[];
|
|
54
|
-
report: {
|
|
55
|
-
passed?: boolean;
|
|
56
|
-
error?: Error;
|
|
57
|
-
};
|
|
58
|
-
get title(): string;
|
|
59
|
-
get tags(): string[];
|
|
60
|
-
accumulateTags(): string[];
|
|
61
|
-
}
|
|
62
|
-
declare class ExampleBridge extends GherkinCodeBridge {
|
|
63
|
-
data: {
|
|
64
|
-
gherkin: Example;
|
|
65
|
-
scope: ScenarioScope;
|
|
66
|
-
};
|
|
67
|
-
steps: StepBridge[];
|
|
68
|
-
report: {
|
|
69
|
-
passed?: boolean;
|
|
70
|
-
error?: Error;
|
|
71
|
-
};
|
|
72
|
-
get title(): string;
|
|
73
|
-
get tags(): string[];
|
|
74
|
-
accumulateTags(): string[];
|
|
75
|
-
}
|
|
76
|
-
declare class ScenarioOutlineBridge extends GherkinCodeBridge {
|
|
77
|
-
data: {
|
|
78
|
-
gherkin: ScenarioOutline;
|
|
79
|
-
scope: ScenarioOutlineScope;
|
|
80
|
-
};
|
|
81
|
-
examples: ExamplesBridge[];
|
|
82
|
-
steps: StepBridge[];
|
|
83
|
-
get title(): string;
|
|
84
|
-
get tags(): string[];
|
|
85
|
-
accumulateTags(): string[];
|
|
86
|
-
}
|
|
87
|
-
declare class ExamplesBridge extends GherkinCodeBridge {
|
|
88
|
-
data: {
|
|
89
|
-
gherkin: Examples;
|
|
90
|
-
scope: ScenarioOutlineScope;
|
|
91
|
-
};
|
|
92
|
-
scenarios: ScenarioBridge[];
|
|
93
|
-
steps: StepBridge[];
|
|
94
|
-
get title(): string;
|
|
95
|
-
get tags(): string[];
|
|
96
|
-
accumulateTags(): string[];
|
|
97
|
-
}
|
|
98
|
-
declare class StepBridge extends GherkinCodeBridge {
|
|
99
|
-
data: {
|
|
100
|
-
gherkin: Step;
|
|
101
|
-
scope: StepScope<string, DataTable | undefined>;
|
|
102
|
-
args: undefined | ((app: App) => unknown[]);
|
|
103
|
-
};
|
|
104
|
-
get args(): ((app: App) => unknown[]) | undefined;
|
|
105
|
-
get expressionText(): string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare function find(bridge: FeatureBridge | RuleBridge | ScenarioOutlineBridge, testName: string): GherkinCodeBridge | undefined;
|
|
109
|
-
declare function findTestTypes(scenarios: (ScenarioBridge | ScenarioOutlineBridge | ExamplesBridge)[], testName: string, from?: string): ScenarioBridge | ScenarioOutlineBridge | ExamplesBridge | undefined;
|
|
110
|
-
declare function findRuleTypes(rules: RuleBridge[], testName: string, from?: string): ScenarioBridge | ScenarioOutlineBridge | RuleBridge | ExamplesBridge | undefined;
|
|
111
|
-
declare function findRuleOrChild(rule: RuleBridge, testName: string, from?: string): ScenarioBridge | ScenarioOutlineBridge | RuleBridge | ExamplesBridge | undefined;
|
|
112
|
-
declare function findScenarioOutlineOrChild(outline: ScenarioOutlineBridge, testName: string, from?: string): ScenarioBridge | ScenarioOutlineBridge | ExamplesBridge | undefined;
|
|
113
|
-
declare function findExamplesOrChild(example: ExamplesBridge, testName: string, from?: string): ScenarioBridge | ExamplesBridge | undefined;
|
|
114
|
-
declare function findScenario(scenario: ScenarioBridge, testName: string, from?: string): ScenarioBridge | undefined;
|
|
115
|
-
|
|
116
|
-
declare function failed(bridge: FeatureBridge | RuleBridge | ScenarioOutlineBridge): ScenarioBridge[];
|
|
117
|
-
declare function gherkinToTestNames(node: GherkinNode, path?: string, accumulator?: string[]): string[] | undefined;
|
|
118
|
-
declare const Query: {
|
|
119
|
-
find: {
|
|
120
|
-
failed: typeof failed;
|
|
121
|
-
};
|
|
122
|
-
testNames: typeof gherkinToTestNames;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
declare class TestBuilder {
|
|
126
|
-
readonly feature: Feature;
|
|
127
|
-
constructor(feature: Feature);
|
|
128
|
-
onFeatureExecuted(featureScope: FeatureScope): FeatureBridge;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
declare function scope(value: Scope): {
|
|
132
|
-
findRule: (name: string) => RuleScope;
|
|
133
|
-
findScenario: (name: string) => ScenarioScope;
|
|
134
|
-
findBackground: ({ name }: {
|
|
135
|
-
name?: string | undefined;
|
|
136
|
-
}) => BackgroundScope;
|
|
137
|
-
findScenarioOutline: (name: string) => ScenarioOutlineScope;
|
|
138
|
-
findExample(name: string): ScenarioScope;
|
|
139
|
-
findStep: (keywordType: StepType, keyword: StepKeyword, name: string) => {
|
|
140
|
-
step: _autometa_scopes.CachedStep;
|
|
141
|
-
args: ((app: _autometa_app.App) => unknown[]) | undefined;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
type WalkFunction<T extends GherkinNode, TAccumulator, TReturn> = (node: T, accumulator: TAccumulator, lastNode?: GherkinNode) => TReturn;
|
|
146
|
-
type WalkFunctionMap<TAccumulator> = {
|
|
147
|
-
onFeature?: WalkFunction<Feature, TAccumulator, TAccumulator>;
|
|
148
|
-
onRule?: WalkFunction<Rule, TAccumulator, TAccumulator>;
|
|
149
|
-
onBackground?: WalkFunction<Background, TAccumulator, TAccumulator>;
|
|
150
|
-
onScenario?: WalkFunction<Scenario, TAccumulator, TAccumulator>;
|
|
151
|
-
onScenarioOutline?: WalkFunction<ScenarioOutline, TAccumulator, TAccumulator>;
|
|
152
|
-
onExamples?: WalkFunction<Examples, TAccumulator, TAccumulator>;
|
|
153
|
-
onExample?: WalkFunction<Example, TAccumulator, TAccumulator>;
|
|
154
|
-
onStep?: WalkFunction<Step, TAccumulator, TAccumulator>;
|
|
155
|
-
};
|
|
156
|
-
declare class GherkinWalker {
|
|
157
|
-
#private;
|
|
158
|
-
static walk<TAccumulator>(walkFunction: WalkFunctionMap<TAccumulator>, childNode: GherkinNode, accumulator: TAccumulator, parentNode?: GherkinNode): TAccumulator & ({} | null);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export { BackgroundBridge, ExampleBridge, ExamplesBridge, FeatureBridge, GherkinCodeBridge, GherkinWalker, GlobalBridge, Query, RuleBridge, ScenarioBridge, ScenarioOutlineBridge, StepBridge, TestBuilder, WalkFunction, WalkFunctionMap, find, findExamplesOrChild, findRuleOrChild, findRuleTypes, findScenario, findScenarioOutlineOrChild, findTestTypes, scope };
|
package/tsup.config.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
clean: true, // clean up the dist folder
|
|
5
|
-
format: ["cjs", "esm"], // generate cjs and esm files
|
|
6
|
-
dts: true,
|
|
7
|
-
sourcemap: true, // generate sourcemaps
|
|
8
|
-
skipNodeModulesBundle: true,
|
|
9
|
-
entryPoints: ["src/index.ts"],
|
|
10
|
-
target: "es2020",
|
|
11
|
-
outDir: "dist",
|
|
12
|
-
legacyOutput: true,
|
|
13
|
-
external: ["dist"],
|
|
14
|
-
});
|