Bootstrap FreeKB - ELK (Elastic Search, Logstash, Kibana) - Test Journeys using NodeJS
ELK (Elastic Search, Logstash, Kibana) - Test Journeys using NodeJS


This assumes you have already

Let's say you have created a project named my-project. In your project directory there should be a directory named journeys.

]$ ls -l my-project/
drwxrwsr-x.   2 john.doe john.doe  4096 Jul  3 23:20 journeys
drwxrwsr-x.   2 john.doe john.doe  4096 Jul  3 23:20 lightweight
drwxrwsr-x. 130 john.doe john.doe 12288 Jul  3 23:20 node_modules
-rw-rw-r--.   1 john.doe john.doe   333 Jul  3 23:20 package.json
-rw-rw-r--.   1 john.doe john.doe 66656 Jul  3 23:20 package-lock.json
-rw-rw-r--.   1 john.doe john.doe  1323 Jul  3 23:20 README.md
-rw-rw-r--.   1 john.doe john.doe   813 Jul  3 23:20 synthetics.config.ts

 

Let's move into the directory that contains your synthetics.config.ts (my-project in this example).

cd my-project

 

And in the journeys directory there should be a few example files.

~]$ ls -l journeys/
-rw-rw-r--. 1 john.doe john.doe 1845 Jul  3 23:20 advanced-example-helpers.ts
-rw-rw-r--. 1 john.doe john.doe 1239 Jul  3 23:20 advanced-example.journey.ts
-rw-rw-r--. 1 john.doe john.doe  495 Jul  3 23:20 example.journey.ts

 

The npx @elastic/synthetics journeys command can be used to test your journeys.

~]$ npx @elastic/synthetics journeys

Journey: My Example Journey
   ✓  Step: 'launch application' succeeded (401 ms)
   ✓  Step: 'assert title' succeeded (83 ms)

Journey: addition and completion of single task
   ✓  Step: 'launch app' succeeded (254 ms)
   ✓  Step: 'add task Don't put salt in your eyes' succeeded (177 ms)
   ✓  Step: 'check that task list has exactly 1 elements' succeeded (57 ms)
   ✓  Step: 'check for task 'Don't put salt in your eyes' in list' succeeded (66 ms)
   ✓  Step: 'destroy task 'Don't put salt in your eyes'' succeeded (181 ms)
   ✓  Step: 'check that task list has exactly 0 elements' succeeded (64 ms)

Journey: adding and removing multiple tasks
   ✓  Step: 'launch app' succeeded (246 ms)
   ✓  Step: 'add task Task 1' succeeded (126 ms)
   ✓  Step: 'add task Task 2' succeeded (80 ms)
   ✓  Step: 'add task Task 3' succeeded (87 ms)
   ✓  Step: 'check that task list has exactly 3 elements' succeeded (69 ms)
   ✓  Step: 'destroy task 'Task 2'' succeeded (116 ms)
   ✓  Step: 'check that task list has exactly 2 elements' succeeded (69 ms)
   ✓  Step: 'add task Task 4' succeeded (95 ms)
   ✓  Step: 'check that task list has exactly 3 elements' succeeded (96 ms)

 17 passed (5220 ms)

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 061481 in the box below so that we can be sure you are a human.