Skip to content

Commit 3bb61f0

Browse files
committed
update docs
1 parent 733e1f2 commit 3bb61f0

3 files changed

Lines changed: 57 additions & 63 deletions

File tree

docs/helpers/ApiDataFactory.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ This behavior can be configured with following options:
135135
* `create`: override create options. Expected format: `{ method: uri }`. Example: `{ "post": "/users/create" }`
136136
* `delete`: override delete options. Expected format: `{ method: uri }`. Example: `{ "post": "/users/delete/{id}" }`
137137

138-
Requests can also be overridden with a function which returns [axois request config][4].
138+
Requests can also be overridden with a function which returns request config.
139139

140140
```js
141141
create: (data) => ({ method: 'post', url: '/posts', data }),
@@ -232,7 +232,7 @@ I.have('user', { }, { age: 33, height: 55 })
232232
* `params` **any?** predefined parameters
233233
* `options` **any?** options for programmatically generate the attributes
234234

235-
Returns **[Promise][5]<any>**&#x20;
235+
Returns **[Promise][4]<any>**&#x20;
236236

237237
### haveMultiple
238238

@@ -262,6 +262,4 @@ I.haveMultiple('post', 3, { author: 'davert' }, { publish_date: '01.01.1997' });
262262

263263
[3]: http://codecept.io/helpers/REST/
264264

265-
[4]: https://github.com/axios/axios#request-config
266-
267-
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
265+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise

docs/helpers/GraphQL.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,22 @@ this.helpers['GraphQL']._executeQuery({
5151

5252
### _executeQuery
5353

54-
Executes query via fetch call
54+
Executes query
5555

5656
#### Parameters
5757

58-
* `request` **[object][2]**&#x20;
58+
* `request` **[object][1]**&#x20;
5959

6060
### _prepareGraphQLRequest
6161

6262
Prepares request for fetch call
6363

6464
#### Parameters
6565

66-
* `operation` **[object][2]**&#x20;
67-
* `headers` **[object][2]**&#x20;
66+
* `operation` **[object][1]**&#x20;
67+
* `headers` **[object][1]**&#x20;
6868

69-
Returns **[object][2]** graphQLRequest
69+
Returns **[object][1]** graphQLRequest
7070

7171
### amBearerAuthenticated
7272

@@ -79,15 +79,15 @@ I.amBearerAuthenticated(secret('heregoestoken'))
7979

8080
#### Parameters
8181

82-
* `accessToken` **([string][3] | CodeceptJS.Secret)** Bearer access token
82+
* `accessToken` **([string][2] | CodeceptJS.Secret)** Bearer access token
8383

8484
### haveRequestHeaders
8585

8686
Sets request headers for all requests of this test
8787

8888
#### Parameters
8989

90-
* `headers` **[object][2]** headers list
90+
* `headers` **[object][1]** headers list
9191

9292
### sendMutation
9393

@@ -113,10 +113,10 @@ I.sendMutation(`
113113

114114
#### Parameters
115115

116-
* `mutation` **[String][3]**&#x20;
117-
* `variables` **[object][2]?** that may go along with the mutation
118-
* `options` **[object][2]?** are additional query options
119-
* `headers` **[object][2]?**
116+
* `mutation` **[String][2]**&#x20;
117+
* `variables` **[object][1]?** that may go along with the mutation
118+
* `options` **[object][1]?** are additional query options
119+
* `headers` **[object][1]?**
120120

121121
Returns **any** Promise<any>
122122

@@ -138,15 +138,13 @@ const user = response.data.data;
138138

139139
#### Parameters
140140

141-
* `query` **[String][3]**&#x20;
142-
* `variables` **[object][2]?** that may go along with the query
143-
* `options` **[object][2]?** are additional query options
144-
* `headers` **[object][2]?**
141+
* `query` **[String][2]**&#x20;
142+
* `variables` **[object][1]?** that may go along with the query
143+
* `options` **[object][1]?** are additional query options
144+
* `headers` **[object][1]?**
145145

146146
Returns **any** Promise<any>
147147

148+
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
148149

149-
150-
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
151-
152-
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
150+
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

docs/helpers/REST.md

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ native fetch API is used to perform requests.
1818

1919
## Configuration
2020

21-
Type: [object][4]
21+
Type: [object][3]
2222

2323
### Properties
2424

25-
* `endpoint` **[string][3]?** API base URL
26-
* `prettyPrintJson` **[boolean][6]?** pretty print json for response/request on console logs.
27-
* `printCurl` **[boolean][6]?** print cURL request on console logs. False by default.
28-
* `timeout` **[number][5]?** timeout for requests in milliseconds. 10000ms by default.
29-
* `defaultHeaders` **[object][4]?** a list of default headers.
30-
* `httpAgent` **[object][4]?** create an agent with SSL certificate
31-
* `onRequest` **[function][7]?** an async function which can update request object.
32-
* `onResponse` **[function][7]?** an async function which can update response object.
33-
* `maxUploadFileSize` **[number][5]?** set the max content file size in MB when performing api calls.
25+
* `endpoint` **[string][2]?** API base URL
26+
* `prettyPrintJson` **[boolean][5]?** pretty print json for response/request on console logs.
27+
* `printCurl` **[boolean][5]?** print cURL request on console logs. False by default.
28+
* `timeout` **[number][4]?** timeout for requests in milliseconds. 10000ms by default.
29+
* `defaultHeaders` **[object][3]?** a list of default headers.
30+
* `httpAgent` **[object][3]?** create an agent with SSL certificate
31+
* `onRequest` **[function][6]?** an async function which can update request object.
32+
* `onResponse` **[function][6]?** an async function which can update response object.
33+
* `maxUploadFileSize` **[number][4]?** set the max content file size in MB when performing api calls.
3434

3535

3636

@@ -104,13 +104,13 @@ this.helpers['REST']._executeRequest({
104104

105105
### _executeRequest
106106

107-
Executes fetch request
107+
Executes request
108108

109109
#### Parameters
110110

111111
* `request` **any**&#x20;
112112

113-
Returns **[Promise][2]<any>** response
113+
Returns **[Promise][1]<any>** response
114114

115115
### _url
116116

@@ -131,15 +131,15 @@ I.amBearerAuthenticated(secret('heregoestoken'))
131131

132132
#### Parameters
133133

134-
* `accessToken` **([string][3] | CodeceptJS.Secret)** Bearer access token
134+
* `accessToken` **([string][2] | CodeceptJS.Secret)** Bearer access token
135135

136136
### haveRequestHeaders
137137

138138
Sets request headers for all requests of this test
139139

140140
#### Parameters
141141

142-
* `headers` **[object][4]** headers list
142+
* `headers` **[object][3]** headers list
143143

144144
### sendDeleteRequest
145145

@@ -152,9 +152,9 @@ I.sendDeleteRequest('/api/users/1');
152152
#### Parameters
153153

154154
* `url` **any**&#x20;
155-
* `headers` **[object][4]** the headers object to be sent. By default, it is sent as an empty object
155+
* `headers` **[object][3]** the headers object to be sent. By default, it is sent as an empty object
156156

157-
Returns **[Promise][2]<any>** response
157+
Returns **[Promise][1]<any>** response
158158

159159
### sendDeleteRequestWithPayload
160160

@@ -168,9 +168,9 @@ I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });
168168

169169
* `url` **any**&#x20;
170170
* `payload` **any** the payload to be sent. By default it is sent as an empty object
171-
* `headers` **[object][4]** the headers object to be sent. By default, it is sent as an empty object
171+
* `headers` **[object][3]** the headers object to be sent. By default, it is sent as an empty object
172172

173-
Returns **[Promise][2]<any>** response
173+
Returns **[Promise][1]<any>** response
174174

175175
### sendGetRequest
176176

@@ -183,9 +183,9 @@ I.sendGetRequest('/api/users.json');
183183
#### Parameters
184184

185185
* `url` **any**&#x20;
186-
* `headers` **[object][4]** the headers object to be sent. By default, it is sent as an empty object
186+
* `headers` **[object][3]** the headers object to be sent. By default, it is sent as an empty object
187187

188-
Returns **[Promise][2]<any>** response
188+
Returns **[Promise][1]<any>** response
189189

190190
### sendHeadRequest
191191

@@ -198,9 +198,9 @@ I.sendHeadRequest('/api/users.json');
198198
#### Parameters
199199

200200
* `url` **any**&#x20;
201-
* `headers` **[object][4]** the headers object to be sent. By default, it is sent as an empty object
201+
* `headers` **[object][3]** the headers object to be sent. By default, it is sent as an empty object
202202

203-
Returns **[Promise][2]<any>** response
203+
Returns **[Promise][1]<any>** response
204204

205205
### sendPatchRequest
206206

@@ -216,11 +216,11 @@ I.sendPatchRequest('/api/users.json', secret({ "email": "user@user.com" }));
216216

217217
#### Parameters
218218

219-
* `url` **[string][3]**&#x20;
219+
* `url` **[string][2]**&#x20;
220220
* `payload` **any** the payload to be sent. By default it is sent as an empty object
221-
* `headers` **[object][4]** the headers object to be sent. By default it is sent as an empty object
221+
* `headers` **[object][3]** the headers object to be sent. By default it is sent as an empty object
222222

223-
Returns **[Promise][2]<any>** response
223+
Returns **[Promise][1]<any>** response
224224

225225
### sendPostRequest
226226

@@ -238,9 +238,9 @@ I.sendPostRequest('/api/users.json', secret({ "email": "user@user.com" }));
238238

239239
* `url` **any**&#x20;
240240
* `payload` **any** the payload to be sent. By default, it is sent as an empty object
241-
* `headers` **[object][4]** the headers object to be sent. By default, it is sent as an empty object
241+
* `headers` **[object][3]** the headers object to be sent. By default, it is sent as an empty object
242242

243-
Returns **[Promise][2]<any>** response
243+
Returns **[Promise][1]<any>** response
244244

245245
### sendPutRequest
246246

@@ -256,11 +256,11 @@ I.sendPutRequest('/api/users.json', secret({ "email": "user@user.com" }));
256256

257257
#### Parameters
258258

259-
* `url` **[string][3]**&#x20;
259+
* `url` **[string][2]**&#x20;
260260
* `payload` **any** the payload to be sent. By default it is sent as an empty object
261-
* `headers` **[object][4]** the headers object to be sent. By default it is sent as an empty object
261+
* `headers` **[object][3]** the headers object to be sent. By default it is sent as an empty object
262262

263-
Returns **[Promise][2]<any>** response
263+
Returns **[Promise][1]<any>** response
264264

265265
### setRequestTimeout
266266

@@ -272,18 +272,16 @@ I.setRequestTimeout(10000); // In milliseconds
272272

273273
#### Parameters
274274

275-
* `newTimeout` **[number][5]** timeout in milliseconds
275+
* `newTimeout` **[number][4]** timeout in milliseconds
276276

277+
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
277278

279+
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
278280

279-
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
281+
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
280282

281-
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
283+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
282284

283-
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
285+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
284286

285-
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
286-
287-
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
288-
289-
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
287+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function

0 commit comments

Comments
 (0)