artes 1.1.24 → 1.1.25

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.
Files changed (2) hide show
  1. package/README.md +65 -82
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -175,86 +175,6 @@ Feature: Searching on Google 🔍
175
175
 
176
176
  ---
177
177
 
178
- ## 🌍 Environment Variables Configuration
179
-
180
- Artes now supports environment-specific configurations through environment variables. This feature allows you to manage different settings for development, staging, and production environments.
181
-
182
- ### Setting Up Environment Variables
183
-
184
- 1. **Configure Environment in artes.config.js:**
185
-
186
- ```javascript
187
- module.exports = {
188
- baseURL: {
189
- dev: "https://dev.dlp.az",
190
- pre: "https://pre.dlp.az",
191
- prod: "https://api.dlp.az",
192
- },
193
- env: "dev", // Specify which environment to use
194
- // ... other configurations
195
- };
196
- ```
197
-
198
- **Alternative single URL configuration:**
199
-
200
- ```javascript
201
- module.exports = {
202
- baseURL: "https://api.example.com", // Direct string URL
203
- env: "dev",
204
- // ... other configurations
205
- };
206
- ```
207
-
208
- 2. **Create Environment Variable Files:**
209
- Create JSON files under `src/tests/environment-variables/` folder with names matching your environment:
210
-
211
- **dev.json:**
212
-
213
- ```json
214
- {
215
- "api_key": "dev-api-key-12345",
216
- "auth_token": "dev-auth-token",
217
- "database_url": "dev-db.example.com",
218
- "timeout": 5000,
219
- "headers": {
220
- "Authorization": "Bearer dev-token",
221
- "Content-Type": "application/json"
222
- }
223
- }
224
- ```
225
-
226
- **pre.json:**
227
-
228
- ```json
229
- {
230
- "api_key": "pre-api-key-67890",
231
- "auth_token": "pre-auth-token",
232
- "database_url": "pre-db.example.com",
233
- "timeout": 3000,
234
- "headers": {
235
- "Authorization": "Bearer pre-token",
236
- "Content-Type": "application/json"
237
- }
238
- }
239
- ```
240
-
241
- ### How It Works
242
-
243
- 1. **Environment Detection:** When Artes runs, it reads the `env` value from `artes.config.js`
244
- 2. **Base URL Resolution:** If `baseURL` is an object, it uses the environment key to find the corresponding URL. If `baseURL` is a string, it uses it directly
245
- 3. **Variable Loading:** Artes looks for a JSON file matching the environment name in `src/tests/environment-variables/`
246
- 4. **Runtime Access:** All variables from the environment file become available during test execution
247
-
248
- ### Important Notes
249
-
250
- - ⚠️ **Base URLs must be defined in `artes.config.js`** - they cannot be set in the environment variable JSON files
251
- - 📁 Environment variable files should be placed in `src/tests/environment-variables/`
252
- - 🏷️ File names must exactly match the environment name (e.g., `dev.json` for `env: "dev"`)
253
- - 🔄 Variables are loaded into variable storage and can be accessed during test runs
254
- - 🌐 Use environment variables for headers, API keys, timeouts, and other environment-specific configurations
255
-
256
- ---
257
-
258
178
  ## 🛠️ Customization
259
179
 
260
180
  ## ✍️ Writing Custom Step Definitions
@@ -400,13 +320,76 @@ You can configure Artes by editing the `artes.config.js` file. Below are the def
400
320
  | `publish` | `false` | Publish to cucumber.io. |
401
321
  | `worldParameters` | `{}` | Custom world parameters. |
402
322
 
403
- ### Environment Configuration
323
+ ---
324
+
325
+ ## 🌍 Environment Configuration
404
326
 
405
327
  | **Option** | **Default Value** | **Description** |
406
328
  | ---------- | ----------------- | ------------------------------------------------------------------------------------------------------------ |
407
329
  | `env` | `""` | Environment configuration. Should match the name with the baseURL object, like "dev" |
408
330
  | `baseURL` | `""` | Base URL for API requests. Can be object {"dev":"dev-api.com", "pre":"pre-api.com"}, or string "dev-api.com" |
409
331
 
332
+
333
+ ### Environment Variables Configuration
334
+
335
+ Artes now supports environment-specific configurations through environment variables. This feature allows you to manage different settings for development, staging, and production environments.
336
+
337
+ ### Setting Up Environment Variables
338
+
339
+ 1. **Configure Environment in artes.config.js:**
340
+ ```javascript
341
+ module.exports = {
342
+ baseURL: {
343
+ dev: "https://dev.dlp.az",
344
+ pre: "https://pre.dlp.az",
345
+ prod: "https://api.dlp.az"
346
+ },
347
+ env: "dev", // Specify which environment to use
348
+ // ... other configurations
349
+ };
350
+ ```
351
+
352
+ **Alternative single URL configuration:**
353
+ ```javascript
354
+ module.exports = {
355
+ baseURL: "https://api.example.com", // Direct string URL
356
+ env: "dev",
357
+ // ... other configurations
358
+ };
359
+ ```
360
+
361
+ 2. **Create Environment Variable Files:**
362
+ Create JSON files under `src/tests/environment-variables/` folder with names matching your environment:
363
+
364
+ **dev.json:**
365
+ ```json
366
+ {
367
+ "api_key": "dev-api-key-12345",
368
+ "auth_token": "dev-auth-token",
369
+ "database_url": "dev-db.example.com",
370
+ "timeout": 5000,
371
+ "headers": {
372
+ "Authorization": "Bearer dev-token",
373
+ "Content-Type": "application/json"
374
+ }
375
+ }
376
+ ```
377
+
378
+ ### How It Works
379
+
380
+ 1. **Environment Detection:** When Artes runs, it reads the `env` value from `artes.config.js`
381
+ 2. **Base URL Resolution:** If `baseURL` is an object, it uses the environment key to find the corresponding URL. If `baseURL` is a string, it uses it directly
382
+ 3. **Variable Loading:** Artes looks for a JSON file matching the environment name in `src/tests/environment-variables/`
383
+ 4. **Runtime Access:** All variables from the environment file become available during test execution
384
+
385
+ ### Important Notes
386
+
387
+ - ⚠️ **Base URLs must be defined in `artes.config.js`** - they cannot be set in the environment variable JSON files
388
+ - 📁 Environment variable files should be placed in `src/tests/environment-variables/`
389
+ - 🏷️ File names must follow the format `{env}.env.json` (e.g., `dev.env.json` for `env: "dev"`)
390
+ - 🔄 Variables are loaded into variable storage and can be accessed during test runs
391
+ - 🌐 Use environment variables for headers, API keys, timeouts, and other environment-specific configurations
392
+
410
393
  ---
411
394
 
412
395
  ### Browser Configuration
@@ -476,4 +459,4 @@ If you don't use the -c or --create option that the package offers, save the fil
476
459
 
477
460
  ---
478
461
 
479
- ## 🧑‍💻 Have a Good Testing
462
+ ## 🧑‍💻 Have a Good Testing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {