pickle-jar 1.4.2 → 1.4.3
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 +12 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,7 +42,8 @@ In order to run the features and their steps, a test runner entry point must be
|
|
|
42
42
|
Create a file named `runner.ts` in the `<rootDir>/test` directory:
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
|
-
import {
|
|
45
|
+
import {workerData} from "worker_threads";
|
|
46
|
+
import {StepDefinition, testRunner} from "../src";
|
|
46
47
|
|
|
47
48
|
interface World {
|
|
48
49
|
password: string | undefined;
|
|
@@ -63,20 +64,11 @@ const stepDefinitions: StepDefinition<World>[] = [{
|
|
|
63
64
|
}
|
|
64
65
|
}];
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// The FeatureContext object contains information about the feature file being processed
|
|
70
|
-
function worldFactory(featureContext: FeatureContext): World {
|
|
71
|
-
const world: World = {
|
|
72
|
-
password: undefined,
|
|
73
|
-
grantedAccess: false
|
|
74
|
-
}
|
|
75
|
-
return world;
|
|
67
|
+
const world: World = {
|
|
68
|
+
password: undefined,
|
|
69
|
+
grantedAccess: false
|
|
76
70
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, worldFactory);
|
|
71
|
+
testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, world);
|
|
80
72
|
```
|
|
81
73
|
|
|
82
74
|
The test runner file defines the World object structure. This object is passed to each step and allows sharing values from one step to another.
|
|
@@ -112,7 +104,8 @@ Feature: Logging in
|
|
|
112
104
|
```
|
|
113
105
|
### `runner.ts` steps:
|
|
114
106
|
```ts
|
|
115
|
-
import {
|
|
107
|
+
import {workerData} from "worker_threads";
|
|
108
|
+
import {StepDefinition, testRunner} from "../src";
|
|
116
109
|
|
|
117
110
|
interface World {
|
|
118
111
|
password: string | undefined;
|
|
@@ -133,16 +126,11 @@ const stepDefinitions: StepDefinition<World>[] = [{
|
|
|
133
126
|
}
|
|
134
127
|
}];
|
|
135
128
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
grantedAccess: false
|
|
140
|
-
}
|
|
141
|
-
return world;
|
|
129
|
+
const world: World = {
|
|
130
|
+
password: undefined,
|
|
131
|
+
grantedAccess: false
|
|
142
132
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, worldFactory);
|
|
133
|
+
testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, world);
|
|
146
134
|
```
|
|
147
135
|
|
|
148
136
|
## Running scenario outlines
|