@aj-shadow/actorjs-documentation-text 0.0.0-aj-beta.221
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/.gitattributes +26 -0
- package/Documentation/Document-global-Be-100-more-efficient.txt +31 -0
- package/Documentation/Document-global-actorjs-trigger-mock-and-intercept-anything.txt +21 -0
- package/Documentation/Document-global-advanced-visualization.txt +28 -0
- package/Documentation/Document-global-debugging.txt +4 -0
- package/Documentation/Document-global-divide-and-reuse.txt +37 -0
- package/Documentation/Document-global-general-separation.txt +2 -0
- package/Documentation/Document-global-markup-anchor.txt +6 -0
- package/Documentation/Document-global-markup-api-status.txt +39 -0
- package/Documentation/Document-global-markup-chart-line.txt +18 -0
- package/Documentation/Document-global-markup-documentation-status.txt +39 -0
- package/Documentation/Document-global-markup-documentation.txt +72 -0
- package/Documentation/Document-global-markup-embed.txt +6 -0
- package/Documentation/Document-global-markup-flowchart.txt +88 -0
- package/Documentation/Document-global-markup-html.txt +122 -0
- package/Documentation/Document-global-markup-ie.txt +18 -0
- package/Documentation/Document-global-markup-image.txt +55 -0
- package/Documentation/Document-global-markup-lab.txt +63 -0
- package/Documentation/Document-global-markup-markup.txt +21 -0
- package/Documentation/Document-global-markup-navigation.txt +25 -0
- package/Documentation/Document-global-markup-node-diagram.txt +163 -0
- package/Documentation/Document-global-markup-note.txt +6 -0
- package/Documentation/Document-global-markup-ref.txt +6 -0
- package/Documentation/Document-global-markup-sequence-diagram.txt +215 -0
- package/Documentation/Document-global-markup-state-machine.txt +121 -0
- package/Documentation/Document-global-markup-table.txt +34 -0
- package/Documentation/Document-global-navigation-pane.txt +3 -0
- package/Documentation/Document-global-navigation.txt +2 -0
- package/Documentation/Document-global-specialized-javascript-editors.txt +2 -0
- package/Documentation/Document-global-stacks-connection.txt +2 -0
- package/Documentation/Document-global-stacks-server.txt +2 -0
- package/Documentation/Document-global-test-environment-overview.txt +15 -0
- package/Documentation/Document-global-the-architecture.txt +51 -0
- package/Documentation/Document-global-the-development-environment.txt +5 -0
- package/Documentation/Document-global-the-test-environment.txt +15 -0
- package/Documentation/Document-global-think-ahead.txt +35 -0
- package/Documentation/Document-global-thinking-in-actors-unlimited.txt +1 -0
- package/Documentation/Document-global-what-is-a-stack.txt +2 -0
- package/Documentation/Document-global-why-actorjs.txt +52 -0
- package/Documentation/Document-global-why-actors-unlimited.txt +182 -0
- package/Documentation/Document-global-x-test-case-tool.txt +2 -0
- package/Documentation/Navigation-Documentation-actorjs-global.txt +372 -0
- package/Documentation/Navigation-Documentation-actorsite-global.txt +363 -0
- package/Documentation/abstractions/Document-global-addressing.txt +81 -0
- package/Documentation/abstractions/Document-global-configuration-floor.txt +2 -0
- package/Documentation/abstractions/Document-global-content.txt +3 -0
- package/Documentation/abstractions/Document-global-functions-test.txt +4 -0
- package/Documentation/abstractions/Document-global-functions-unde-test.txt +2 -0
- package/Documentation/abstractions/Document-global-load-test.txt +3 -0
- package/Documentation/abstractions/Document-global-repo.txt +79 -0
- package/Documentation/abstractions/Document-global-shared-data.txt +5 -0
- package/Documentation/abstractions/Document-global-system-to-test.txt +2 -0
- package/Documentation/abstractions/Document-global-system-under-test.txt +3 -0
- package/Documentation/abstractions/Document-global-test-data.txt +251 -0
- package/Documentation/abstractions/Document-global-test-suite.txt +37 -0
- package/Documentation/abstractions/Document-global-verification-data.txt +103 -0
- package/Documentation/abstractions/actor/Document-global-actor-condition.txt +74 -0
- package/Documentation/abstractions/actor/Document-global-actor-local.txt +44 -0
- package/Documentation/abstractions/actor/Document-global-actor-originating.txt +100 -0
- package/Documentation/abstractions/actor/Document-global-actor-proxy.txt +119 -0
- package/Documentation/abstractions/actor/Document-global-actor-terminating.txt +101 -0
- package/Documentation/abstractions/actor/Document-global-actor.txt +90 -0
- package/Documentation/abstractions/actor/Document-global-execution-states.txt +21 -0
- package/Documentation/abstractions/actorpart/Document-global-actorpart.txt +2 -0
- package/Documentation/abstractions/stack/Document-global-client-connection.txt +3 -0
- package/Documentation/abstractions/stack/Document-global-connection.txt +3 -0
- package/Documentation/abstractions/stack/Document-global-decoder.txt +3 -0
- package/Documentation/abstractions/stack/Document-global-encoder.txt +3 -0
- package/Documentation/abstractions/stack/Document-global-message.txt +4 -0
- package/Documentation/abstractions/stack/Document-global-server-connection.txt +3 -0
- package/Documentation/abstractions/stack/Document-global-stack.txt +12 -0
- package/Documentation/abstractions/stack/Document-global-worker.txt +3 -0
- package/Documentation/abstractions/test-case/Document-global-phases.txt +30 -0
- package/Documentation/abstractions/test-case/Document-global-test-case-result.txt +23 -0
- package/Documentation/abstractions/test-case/Document-global-test-case.txt +199 -0
- package/Documentation/actor-api/Document-global-actor-part.txt +7 -0
- package/Documentation/actor-api/Document-global-actor.txt +375 -0
- package/Documentation/actor-api/Document-global-async.txt +176 -0
- package/Documentation/actor-api/Document-global-client-stack.txt +215 -0
- package/Documentation/actor-api/Document-global-content.txt +106 -0
- package/Documentation/actor-api/Document-global-logger.txt +426 -0
- package/Documentation/actor-api/Document-global-process.txt +7 -0
- package/Documentation/actor-api/Document-global-server-stack.txt +213 -0
- package/Documentation/actor-api/Document-global-shared-data.txt +259 -0
- package/Documentation/actor-api/Document-global-test-data.txt +816 -0
- package/Documentation/actor-api/Document-global-timer.txt +70 -0
- package/Documentation/actor-api/Document-global-verification-data.txt +624 -0
- package/Documentation/connection-worker-api/Document-global-logger.txt +3 -0
- package/Documentation/documentation-references.json +199 -0
- package/Documentation/embedded/Document-global-test-case-result.txt +10 -0
- package/Documentation/howto/Document-global-create-actor.txt +1 -0
- package/Documentation/howto/Document-global-create-stack.txt +1 -0
- package/Documentation/howto/Document-global-create-test-case.txt +1 -0
- package/Documentation/howto/Document-global-create-test-suite.txt +1 -0
- package/Documentation/howto/Document-global-define-addresses.txt +1 -0
- package/Documentation/howto/Document-global-define-fut.txt +1 -0
- package/Documentation/howto/Document-global-define-sut.txt +16 -0
- package/Documentation/howto/Document-global-full-workflow.txt +143 -0
- package/Documentation/howto/Document-global-normal-workflow.txt +58 -0
- package/Documentation/howto/Document-global-prerequisites.txt +8 -0
- package/Documentation/howto/prerequisites/Document-global-install-actorjs.txt +64 -0
- package/Documentation/howto/prerequisites/Document-global-install-git.txt +26 -0
- package/Documentation/howto/prerequisites/Document-global-install-nodejs.txt +19 -0
- package/Documentation/markup/Document-global-markup-test-case.txt +6 -0
- package/Documentation/markup/Document-global-markup-test-suite.txt +13 -0
- package/Documentation/markup/embed/Document-global-inner_markup_tc.txt +164 -0
- package/Documentation/nodejs-api/Document-global-fs.txt +7 -0
- package/Documentation/stack-api/Document-global-ascii-dictionary.txt +108 -0
- package/Documentation/stack-api/Document-global-binary-log.txt +91 -0
- package/Documentation/stack-api/Document-global-bit-byte.txt +80 -0
- package/Documentation/stack-api/Document-global-content-base.txt +169 -0
- package/Documentation/stack-api/Document-global-ip-log.txt +101 -0
- package/Documentation/stack-api/Document-global-log-inner.txt +152 -0
- package/Documentation/stack-api/Document-global-log-part-error.txt +12 -0
- package/Documentation/stack-api/Document-global-log-part-ref.txt +80 -0
- package/Documentation/stack-api/Document-global-log-part-text.txt +81 -0
- package/Documentation/tools/Document-global-actors.txt +196 -0
- package/Documentation/tools/Document-global-addressing.txt +38 -0
- package/Documentation/tools/Document-global-content.txt +1 -0
- package/Documentation/tools/Document-global-global-test-data.txt +197 -0
- package/Documentation/tools/Document-global-stacks.txt +1 -0
- package/Documentation/tools/Document-global-test-case-analyze.txt +3 -0
- package/Documentation/tools/Document-global-test-case-debug.txt +16 -0
- package/Documentation/tools/Document-global-test-case-definition.txt +37 -0
- package/Documentation/tools/Document-global-test-case-execution.txt +28 -0
- package/Documentation/tools/Document-global-test-case-log.txt +95 -0
- package/Documentation/tools/Document-global-test-case-sequence-diagram.txt +17 -0
- package/Documentation/tools/Document-global-test-case-specification.txt +3 -0
- package/Documentation/tools/Document-global-test-cases.txt +11 -0
- package/Documentation/tools/Document-global-tool-test-suite.txt +202 -0
- package/Education/Document-global-add-your-first-addresses.txt +75 -0
- package/Education/Document-global-define-your-first-sut.txt +18 -0
- package/Education/Document-global-make-your-first-actors.txt +35 -0
- package/Education/Document-global-make-your-first-test-case.txt +43 -0
- package/Education/Document-global-make-your-first-test-suite.txt +29 -0
- package/Education/Document-global-share-your-work.txt +35 -0
- package/Education/Navigation-Education-actorjs-global.txt +31 -0
- package/LICENSE.txt +96 -0
- package/README.md +5 -0
- package/Workshop/Document-global-actordemo-image-ai.txt +5 -0
- package/Workshop/Document-global-actordemo-login.txt +10 -0
- package/Workshop/Document-global-actordemo-site.txt +3 -0
- package/Workshop/Document-global-actordemo-start.txt +5 -0
- package/Workshop/Document-global-actordemo-the-architecture.txt +27 -0
- package/Workshop/Document-global-introduction-actor.txt +84 -0
- package/Workshop/Document-global-introduction-actorjs.txt +42 -0
- package/Workshop/Document-global-introduction-stack.txt +25 -0
- package/Workshop/Document-global-introduction-system-under-test.txt +102 -0
- package/Workshop/Document-global-introduction-test-case.txt +50 -0
- package/Workshop/Document-global-introduction-test-suite.txt +31 -0
- package/Workshop/Document-global-login-with-puppeter.txt +45 -0
- package/Workshop/Document-global-mock-with-http.txt +83 -0
- package/Workshop/Document-global-mock-with-icap.txt +94 -0
- package/Workshop/Document-global-prerequisites-actorJs.txt +18 -0
- package/Workshop/Document-global-prerequisites-actordemo.txt +15 -0
- package/Workshop/Document-global-trigger-with-http.txt +93 -0
- package/Workshop/Document-global-trigger-with-puppeter.txt +49 -0
- package/Workshop/Navigation-Workshop-actorjs-global.txt +86 -0
- package/npm-shrinkwrap.json +13 -0
- package/package.json +10 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# **Actor API**
|
|
2
|
+
[[API-STATUS=STABLE, ]]
|
|
3
|
+
[[DOC-STATUS=MOSTLY, ]]
|
|
4
|
+
|
|
5
|
+
[[NOTE={"guid":"e137cd45-0b0d-41aa-a561-3471a239a262"}]]
|
|
6
|
+
[[ANCHOR={"id":"89dcb254-e370-46e5-b952-9ee185c1db1d","visible":true}]]
|
|
7
|
+
## **Description**
|
|
8
|
+
|
|
9
|
+
The core of the Actor API is the [[REF=, ABS_Actor]]s. When an [[REF=Actor, ABS_Actor]] is implemented, it is always inherited from one of five [[REF=Actor, ABS_Actor]] base classes. Each [[REF=Actor, ABS_Actor]] base class has its own purpose and properties.
|
|
10
|
+
|
|
11
|
+
[[NOTE={"guid":"7b68d3c9-457c-458c-9d93-84922ebb4901"}]]
|
|
12
|
+
[[ANCHOR={"id":"api-interfaces","visible":true}]]
|
|
13
|
+
## **API Base Classes**
|
|
14
|
+
* **[ActorOriginating](#ActorOriginating)**
|
|
15
|
+
* **[ActorTerminating](#ActorTerminating)**
|
|
16
|
+
* **[ActorProxy](#ActorProxy)**
|
|
17
|
+
* **[ActorLocal](#ActorLocal)**
|
|
18
|
+
* **[ActorCondition](#ActorCondition)**
|
|
19
|
+
|
|
20
|
+
***
|
|
21
|
+
|
|
22
|
+
[[NOTE={"guid":"ce8d06ea-6382-4c86-9dfe-05afe1934c3b"}]]
|
|
23
|
+
[[ANCHOR={"id":"589b76ef-42b8-42c2-abad-b59ce818d238","visible":true}]]
|
|
24
|
+
## **Implement the Execution States**
|
|
25
|
+
When implementing an an [[REF=, ABS_Actor]], you will implement the [[REF=, ABS_Actor_State_Execution]] of the inherited [[REF=, ABS_Actor]]. You choose the [[REF=, ABS_Actor_State_Execution]] that you will implement. Non-implemented [[REF=, ABS_Actor_State_Execution]] can be removed from the code of the [[REF=, ABS_Actor]].
|
|
26
|
+
|
|
27
|
+
The [[REF=, ABS_Actor_State_Execution]] are generator member functions. In most cases, you don't need to add the **yield** or **yield***. They will be automatically generated or identified by a naming convention. Read more in the APIs.
|
|
28
|
+
|
|
29
|
+
[[NOTE={"guid":"9239f464-5d77-42cd-9b54-288df33c0a6e"}]]
|
|
30
|
+
[[ANCHOR={"id":"ActorOriginating","visible":true}]]
|
|
31
|
+
## **ActorOriginating**
|
|
32
|
+
An [[REF=, ABS_Actor_Originating]] is created by inheritance from **ActorApi.ActorOriginating**. See the [[REF=, CODE_Actor_Orig]] implementation.
|
|
33
|
+
|
|
34
|
+
Can be executed in all [[REF=, ABS_Test_Case_Phases]].
|
|
35
|
+
|
|
36
|
+
### **constructor**
|
|
37
|
+
The constructor has one optional argument.
|
|
38
|
+
```javascript
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class MyActorOrig extends ActorApi.ActorOriginating {
|
|
42
|
+
constructor(actorParts) {
|
|
43
|
+
super(actorParts);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### **Method Description**
|
|
50
|
+
```table
|
|
51
|
+
Config(classHeading: )
|
|
52
|
+
|
|
53
|
+
|Parameters |
|
|
54
|
+
|Name |Type |Default |Description |
|
|
55
|
+
|actorParts|[[REF=,MDN_string]] | [[REF=,MDN_strings]]|undefined|[[REF=,ABS_ActorPart]]s to be used by the [[REF=,ABS_Actor]].|
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### **Execution States**
|
|
59
|
+
The [[REF=, ABS_Actor_Originating]] has the following [[REF=, ABS_Actor_State_Execution]]:
|
|
60
|
+
* ***data**
|
|
61
|
+
* ***initClient**
|
|
62
|
+
* ***run**
|
|
63
|
+
* ***exit**
|
|
64
|
+
|
|
65
|
+
[[NOTE={"guid":"b853898f-6faf-42c2-908d-22c440e6e33b"}]]
|
|
66
|
+
[[ANCHOR={"id":"0bba2f5d-0e9c-438b-856f-7a6a1724fd09","visible":true}]]
|
|
67
|
+
### **Example - NotImplementedOrig**
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
const ActorApi = require('actor-api');
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class NotImplementedOrig extends ActorApi.ActorOriginating {
|
|
77
|
+
*data() {
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
*initClient() {
|
|
81
|
+
this.connection = this.createConnection('[stack]');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
*run() {
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
*exit() {
|
|
88
|
+
this.closeConnection(this.connection);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
module.exports = NotImplementedOrig;
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
***
|
|
97
|
+
|
|
98
|
+
[[NOTE={"guid":"0d98801f-b628-40fc-94cc-829319cba18c"}]]
|
|
99
|
+
[[ANCHOR={"id":"ActorTerminating","visible":true}]]
|
|
100
|
+
## **ActorTerminating**
|
|
101
|
+
An [[REF=, ABS_Actor_Terminating]] is created by inheritance from **ActorApi.ActorTerminating**. See the [[REF=, CODE_Actor_Term]] implementation.
|
|
102
|
+
|
|
103
|
+
Can be executed in all [[REF=, ABS_Test_Case_Phases]].
|
|
104
|
+
|
|
105
|
+
### **constructor**
|
|
106
|
+
The constructor has two optional arguments.
|
|
107
|
+
```javascript
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class MyActorTerm extends ActorApi.ActorTerminating {
|
|
111
|
+
constructor(actorParts, expectInterrupt) {
|
|
112
|
+
super(actorParts, expectInterrupt);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
#### **Method Description**
|
|
119
|
+
```table
|
|
120
|
+
Config(classHeading: )
|
|
121
|
+
|
|
122
|
+
|Parameters |
|
|
123
|
+
|Name |Type |Default |Description |
|
|
124
|
+
|actorParts |[[REF=,MDN_string]] | [[REF=,MDN_strings]]|undefined|[[REF=,ABS_ActorPart]]s to be used by the [[REF=,ABS_Actor]]. |
|
|
125
|
+
|expectInterrupt|[[REF=,MDN_boolean]] |false |The [[REF=,ABS_Actor]] expects to hang in the run method. This is to be able to verify that there is no message sent to it.|
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
[[NOTE={"guid":"a6f680b5-7ec7-4db5-b6f7-5c3416e5fe46"}]]
|
|
129
|
+
[[ANCHOR={"id":"02c27c80-1d41-4ae3-baf3-e9b760c38677","visible":true}]]
|
|
130
|
+
### **Execution States**
|
|
131
|
+
The [[REF=, ABS_Actor_Terminating]] has the following [[REF=, ABS_Actor_State_Execution]]:
|
|
132
|
+
* ***data**
|
|
133
|
+
* ***initServer**
|
|
134
|
+
* ***run**
|
|
135
|
+
* ***exit**
|
|
136
|
+
|
|
137
|
+
[[NOTE={"guid":"b64865cd-e799-4a3f-ad9a-d49e164c1b15"}]]
|
|
138
|
+
[[ANCHOR={"id":"ac4e0ccf-5719-4c30-8994-c9a58e77edfd","visible":true}]]
|
|
139
|
+
### **Example - NotImplementedTerm**
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
const ActorApi = require('actor-api');
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class NotImplementedTerm extends ActorApi.ActorTerminating {
|
|
149
|
+
*data() {
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
*initServer() {
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
*run() {
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
*exit() {
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
module.exports = NotImplementedTerm;
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
***
|
|
167
|
+
|
|
168
|
+
[[NOTE={"guid":"330214a3-1267-42ea-af7b-8fb4fe852354"}]]
|
|
169
|
+
[[ANCHOR={"id":"ActorProxy","visible":true}]]
|
|
170
|
+
## **ActorProxy**
|
|
171
|
+
An [[REF=, ABS_Actor_Proxy]] is created by inheritance from **ActorApi.ActorProxy**. See the [[REF=, CODE_Actor_Proxy]] implementation.
|
|
172
|
+
|
|
173
|
+
Can be executed in all [[REF=, ABS_Test_Case_Phases]].
|
|
174
|
+
|
|
175
|
+
### **constructor**
|
|
176
|
+
The constructor has one optional argument.
|
|
177
|
+
```javascript
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class MyActorProxy extends ActorApi.ActorProxy {
|
|
181
|
+
constructor(actorParts) {
|
|
182
|
+
super(actorParts);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### **Method Description**
|
|
189
|
+
```table
|
|
190
|
+
Config(classHeading: )
|
|
191
|
+
|
|
192
|
+
|Parameters |
|
|
193
|
+
|Name |Type |Default |Description |
|
|
194
|
+
|actorParts|[[REF=,MDN_string]] | [[REF=,MDN_strings]]|undefined|[[REF=,ABS_ActorPart]]s to be used by the [[REF=,ABS_Actor]].|
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### **Execution States**
|
|
198
|
+
The [[REF=, ABS_Actor_Proxy]] has the following [[REF=, ABS_Actor_State_Execution]]:
|
|
199
|
+
* ***data**
|
|
200
|
+
* ***initServer**
|
|
201
|
+
* ***initClient**
|
|
202
|
+
* ***run**
|
|
203
|
+
* ***exit**
|
|
204
|
+
|
|
205
|
+
[[NOTE={"guid":"90ae2d2b-f6eb-42ab-bc68-59bb5c6d0622"}]]
|
|
206
|
+
[[ANCHOR={"id":"e3de9117-8e53-42b9-a7b0-8aab2125c509","visible":true}]]
|
|
207
|
+
### **Example - NotImplementedProxy**
|
|
208
|
+
|
|
209
|
+
```javascript
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
const ActorApi = require('actor-api');
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
class NotImplementedProxy extends ActorApi.ActorProxy {
|
|
217
|
+
*data() {
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
*initServer() {
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
*initClient() {
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
*run() {
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
*exit() {
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
module.exports = NotImplementedProxy ;
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
***
|
|
238
|
+
|
|
239
|
+
[[NOTE={"guid":"023b0b43-727f-4404-9841-8563a39587a9"}]]
|
|
240
|
+
[[ANCHOR={"id":"ActorLocal","visible":true}]]
|
|
241
|
+
## **ActorLocal**
|
|
242
|
+
An [[REF=, ABS_Actor_Local]] is created by inheritance from **ActorApi.ActorLocal**. See the [[REF=, CODE_Actor_Local]] implementation.
|
|
243
|
+
|
|
244
|
+
Can be executed in all [[REF=, ABS_Test_Case_Phases]].
|
|
245
|
+
|
|
246
|
+
### **constructor**
|
|
247
|
+
The constructor has one optional argument.
|
|
248
|
+
```javascript
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
class MyActorLocal extends ActorApi.ActorLocal {
|
|
252
|
+
constructor(actorParts) {
|
|
253
|
+
super(actorParts);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### **Method Description**
|
|
260
|
+
```table
|
|
261
|
+
Config(classHeading: )
|
|
262
|
+
|
|
263
|
+
|Parameters |
|
|
264
|
+
|Name |Type |Default |Description |
|
|
265
|
+
|actorParts|[[REF=,MDN_string]] | [[REF=,MDN_strings]]|undefined|[[REF=,ABS_ActorPart]]s to be used by the [[REF=,ABS_Actor]].|
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### **Execution States**
|
|
269
|
+
The [[REF=, ABS_Actor_Local]] has the following [[REF=, ABS_Actor_State_Execution]]:
|
|
270
|
+
* ***data**
|
|
271
|
+
* ***run**
|
|
272
|
+
|
|
273
|
+
[[NOTE={"guid":"feb17c66-a96a-419e-be17-2a972c567efb"}]]
|
|
274
|
+
[[ANCHOR={"id":"5ee55912-29ee-4fcd-a862-4e8149654fad","visible":true}]]
|
|
275
|
+
### **Example - NotImplementedLocal**
|
|
276
|
+
|
|
277
|
+
```javascript
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
const ActorApi = require('actor-api');
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
class NotImplementedLocal extends ActorApi.ActorLocal {
|
|
285
|
+
data() {
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
*run() {
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
module.exports = NotImplementedLocal;
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
***
|
|
297
|
+
|
|
298
|
+
[[NOTE={"guid":"eb1afc63-34ce-4ff9-8752-5f55269aff14"}]]
|
|
299
|
+
[[ANCHOR={"id":"ActorCondition ","visible":true}]]
|
|
300
|
+
## **ActorCondition**
|
|
301
|
+
An [[REF=, ABS_Actor_Condition]] is created by inheritance from **ActorApi.ActorCondition**. See the [[REF=, CODE_Actor_Condition]] implementation.
|
|
302
|
+
|
|
303
|
+
Can be executed only in [[REF=, ABS_Test_Case_Phase_Precondition]] and [[REF=, ABS_Test_Case_Phase_Postcondition]]. The [[REF=, ABS_Actor_State_Execution]] starting with ***pre*** will be executed in the [[REF=, ABS_Test_Case_Phase_Precondition]] and the [[REF=, ABS_Actor_State_Execution]] starting with ***post*** will be executed in the [[REF=, ABS_Test_Case_Phase_Postcondition]].
|
|
304
|
+
|
|
305
|
+
### **constructor**
|
|
306
|
+
The constructor has one optional argument.
|
|
307
|
+
```javascript
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class MyActorCond extends ActorApi.ActorCondition {
|
|
311
|
+
constructor(actorParts) {
|
|
312
|
+
super(actorParts);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
#### **Method Description**
|
|
319
|
+
```table
|
|
320
|
+
Config(classHeading: )
|
|
321
|
+
|
|
322
|
+
|Parameters |
|
|
323
|
+
|Name |Type |Default |Description |
|
|
324
|
+
|actorParts|[[REF=,MDN_string]] | [[REF=,MDN_strings]]|undefined|[[REF=,ABS_ActorPart]]s to be used by the [[REF=,ABS_Actor]].|
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### **Execution States**
|
|
328
|
+
The [[REF=, ABS_Actor_Proxy]] has the following [[REF=, ABS_Actor_State_Execution]]:
|
|
329
|
+
* ***data**
|
|
330
|
+
* ***initClientPre**
|
|
331
|
+
* ***runPre**
|
|
332
|
+
* ***exitPre**
|
|
333
|
+
* ***initClientPost**
|
|
334
|
+
* ***runPost**
|
|
335
|
+
* ***exitPost**
|
|
336
|
+
|
|
337
|
+
[[NOTE={"guid":"952884d4-6f80-4dc2-ba9a-98bc3f993a99"}]]
|
|
338
|
+
[[ANCHOR={"id":"f291f23a-65f6-497b-8be2-e74c65ecc52a","visible":true}]]
|
|
339
|
+
### **Example - NotImplementedCond**
|
|
340
|
+
|
|
341
|
+
```javascript
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
const ActorApi = require('actor-api');
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
class NotImplementedCond extends ActorApi.ActorCondition {
|
|
349
|
+
*data() {
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
*initClientPre() {
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
*runPre() {
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
*exitPre() {
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
*initClientPost() {
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
*runPost() {
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
*exitPost() {
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
module.exports = NotImplementedCond;
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
***
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# **Async API**
|
|
2
|
+
[[API-STATUS=STABLE, ]]
|
|
3
|
+
[[DOC-STATUS=PARTLY, ]]
|
|
4
|
+
|
|
5
|
+
[[NOTE={"guid":"a88191fa-0769-48d2-bc42-48a43258800f"}]]
|
|
6
|
+
[[ANCHOR={"id":"6bc88358-9634-4857-bcf7-9e94a2c2da6b","visible":true}]]
|
|
7
|
+
## **Description**
|
|
8
|
+
|
|
9
|
+
Enables the use of the keyword ***async*** in [[REF=, ABS_Actor]]s. The [[REF=, ABS_Actor_State_Execution]] are implemented as a generator members function, allowing the API methods to be asynchronous.
|
|
10
|
+
|
|
11
|
+
Async API implementation starts in [[REF=, CODE_Async]].
|
|
12
|
+
|
|
13
|
+
[[NOTE={"guid":"96173c22-0562-4df7-b1af-9f2a92d926ac"}]]
|
|
14
|
+
[[ANCHOR={"id":"2aa29941-066d-4bc9-a2c0-ea72d73432a7","visible":true}]]
|
|
15
|
+
## **API Methods**
|
|
16
|
+
* **[*async](#async-api-async)**
|
|
17
|
+
* **[*callback](#async-api-callback)**
|
|
18
|
+
* **[require](#async-api-require)**
|
|
19
|
+
|
|
20
|
+
***
|
|
21
|
+
[[NOTE={"guid":"8f875ebd-f6af-484b-b6dd-6254dc5a4bdb"}]]
|
|
22
|
+
[[ANCHOR={"id":"async-api-async","visible":true}]]
|
|
23
|
+
### ***async**
|
|
24
|
+
```
|
|
25
|
+
this.async(asyncFunction)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
[[NOTE={"guid":"eb902bfa-18b4-48d6-a1b6-ff5075a3c027"}]]
|
|
29
|
+
[[ANCHOR={"id":"81adbcc3-ab24-4e97-b343-16a61a3358e8","visible":true}]]
|
|
30
|
+
#### **Method Description**
|
|
31
|
+
|
|
32
|
+
Calls an async function and waits for it to end.
|
|
33
|
+
```table
|
|
34
|
+
Config(classHeading: )
|
|
35
|
+
|
|
36
|
+
|Parameters |
|
|
37
|
+
|Name |Type |Description |
|
|
38
|
+
|asyncFunction|***async*** [[REF=,MDN_Function]]|Async function that can use the keyword await.|
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```table
|
|
42
|
+
Config(classHeading: )
|
|
43
|
+
|
|
44
|
+
|Returns |
|
|
45
|
+
|Type |Description |
|
|
46
|
+
|<**any**>|The resulting ***value***.|
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```table
|
|
50
|
+
Config(classHeading: )
|
|
51
|
+
|
|
52
|
+
|Async |
|
|
53
|
+
|type |Description |
|
|
54
|
+
|**yield***|auto generated|
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
[[NOTE={"guid":"a3725118-cd79-4688-9cf4-bb9c9bca492a"}]]
|
|
58
|
+
[[ANCHOR={"id":"b33e7c3e-0069-4bfd-b1b2-b524e9628d82","visible":true}]]
|
|
59
|
+
#### **Example using async**
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
|
|
63
|
+
*run() {
|
|
64
|
+
this.async(async () => {
|
|
65
|
+
const page = await this.getPage();
|
|
66
|
+
await page.click('OK');
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
[[NOTE={"guid":"3af15f8a-65a7-4d0e-b323-7a83d5553214"}]]
|
|
73
|
+
[[ANCHOR={"id":"6ef00d6a-5935-44c1-a3c1-ae8c4fb57e72","visible":true}]]
|
|
74
|
+
```javascript
|
|
75
|
+
|
|
76
|
+
*run() {
|
|
77
|
+
this.async(this._run.bind(this));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async _run() {
|
|
81
|
+
const page = await this.getPage();
|
|
82
|
+
await page.click('OK');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
[[NOTE={"guid":"b8d73287-f036-43f7-bb13-d31593d470b0"}]]
|
|
88
|
+
[[ANCHOR={"id":"348bbb55-c10c-4259-b964-87e83f775d1f","visible":true}]]
|
|
89
|
+
#### **Test Cases using async**
|
|
90
|
+
+ [DocActorApiAsyncArrowFunction](/../test-cases/Actor/Doc/DocActorApiAsyncArrowFunction)
|
|
91
|
+
+ [DocActorApiAsyncMemberFunction](/../test-cases/Actor/Doc/DocActorApiAsyncMemberFunction)
|
|
92
|
+
|
|
93
|
+
***
|
|
94
|
+
|
|
95
|
+
[[NOTE={"guid":"d38a1cfd-056f-4395-89a6-f2be8faf1149"}]]
|
|
96
|
+
[[ANCHOR={"id":"async-api-callback","visible":true}]]
|
|
97
|
+
### ***callback**
|
|
98
|
+
```
|
|
99
|
+
this.callback(callbackFunction)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
[[NOTE={"guid":"fee028cd-bc08-4f87-81ec-aa08f0617e27"}]]
|
|
103
|
+
[[ANCHOR={"id":"bbf94812-00b9-408b-8520-af3f0e040fa1","visible":true}]]
|
|
104
|
+
#### **Method Description**
|
|
105
|
+
|
|
106
|
+
Calls a function and waits for it to make a callback.
|
|
107
|
+
```table
|
|
108
|
+
Config(classHeading: )
|
|
109
|
+
|
|
110
|
+
|Parameters |
|
|
111
|
+
|Name |Type |Description |
|
|
112
|
+
|callbackFunction(cb)|[[REF=,MDN_Function]]|Function that makes a callback when it is ready. cb is a [[REF=,MDN_Function]](err, value).|
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```table
|
|
116
|
+
Config(classHeading: )
|
|
117
|
+
|
|
118
|
+
|Returns |
|
|
119
|
+
|Type |Description |
|
|
120
|
+
|<**any**>|The resulting ***value***.|
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```table
|
|
124
|
+
Config(classHeading: )
|
|
125
|
+
|
|
126
|
+
|Async |
|
|
127
|
+
|type |Description |
|
|
128
|
+
|**yield***|auto generated|
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
[[NOTE={"guid":"c1809ea4-c6fa-4e98-b522-493a9b8cf212"}]]
|
|
132
|
+
[[ANCHOR={"id":"6778ac13-2022-4efc-afa5-4a15eb336f4d","visible":true}]]
|
|
133
|
+
#### **Example using async**
|
|
134
|
+
|
|
135
|
+
```javascript
|
|
136
|
+
|
|
137
|
+
*run() {
|
|
138
|
+
const data = this.callback((cb) => {
|
|
139
|
+
cb(undefined, 'Callback arrow return value.');
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
[[NOTE={"guid":"99bc0470-1add-4a92-97ff-c2aa0be13a75"}]]
|
|
146
|
+
[[ANCHOR={"id":"c85e00d2-1c85-406a-b58a-47ca3b5f2937","visible":true}]]
|
|
147
|
+
```javascript
|
|
148
|
+
|
|
149
|
+
*run() {
|
|
150
|
+
const data = this.callback(this.callbackFunc.bind(this));
|
|
151
|
+
VERIFY_VALUE('Callback member return value.', data);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
callbackFunc(cb) {
|
|
155
|
+
cb(undefined, 'Callback member return value.');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
[[NOTE={"guid":"5c33e230-55f7-4416-a871-acf34774881d"}]]
|
|
161
|
+
[[ANCHOR={"id":"9762a9ce-ea7a-4b43-aa70-8b0015a8c04d","visible":true}]]
|
|
162
|
+
#### **Test Cases using async**
|
|
163
|
+
+ [DocActorApiCallbackArrowFunction](/../test-cases/Actor/Doc/DocActorApiCallbackArrowFunction)
|
|
164
|
+
+ [DocActorApiCallbackMemberFunction](/../test-cases/Actor/Doc/DocActorApiCallbackMemberFunction)
|
|
165
|
+
|
|
166
|
+
***
|
|
167
|
+
|
|
168
|
+
[[NOTE={"guid":"fedaa280-55f6-41a2-a5e4-ab3df0dc41d6"}]]
|
|
169
|
+
[[ANCHOR={"id":"async-api-require","visible":true}]]
|
|
170
|
+
### **require**
|
|
171
|
+
```
|
|
172
|
+
this.require(nodejsApi)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### **Method Description**
|
|
176
|
+
Creates a object from the NodejsApi. The NodejsApi wraps nodejs Api:s and "***yieldifies***" them.
|