mcdcorp / opentest

Open source test automation tool for web applications, mobile apps and APIs
https://getopentest.org
MIT License
446 stars 107 forks source link

The Open Test server crashes when trying to edit a template with test tags #640

Closed Keonik1 closed 5 months ago

Keonik1 commented 5 months ago

Hello, @adrianth , can u help me fix this?

Software version: OpenTest server 1.3.8, commit 50659ecda06a8b79a41f24c1fdff05187324402b

Description: I have a test template that should include tests with the tag "diagnostics". When I try to edit my template via the web, the server crashes. Moreover, if the tests are set manually, through the tests section, then everything works fine.

myTemplate.yaml:

description: Template for running tests from the Diagnostics section
sessionLabel: Diagnostics section
actorTags: []
environment: null
maxIterations: 1
includeTestsWithTags: [diagnostics]
includeTestsFromTemplates: null
# tests:
#   - name: TEST-SW.WEB-0001_my_Test
#     path: web/Diagnostics

Server logs:

OpenTest server 1.3.8, commit 50659ecda06a8b79a41f24c1fdff05187324402b

Running in working directory "/opt/opentest/server"
Using test repo directory "/opt/opentest/tests"
Server PID: 1
The OpenTest server is listening on port 3001
Open a browser and navigate to http://localhost:3001

Established WebSocket connection for session xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Established WebSocket connection for session xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ERROR: We detected an unhandled promise rejection. The server will be terminated. The error was:  {} 

Steps to reproduce:

  1. Open WEB UI
  2. Click Session
  3. Click Create Session From Template
  4. Select template
  5. Click "Edit Template"
  6. The server is dead

Others:

Keonik1 commented 5 months ago

OK, it was my mistake. I made the template file incorrectly

Here is the correct file:

description: Template for running tests from the Diagnostics section
sessionLabel: Diagnostics section
actorTags: []
environment: null
maxIterations: 1
includeTestsWithTags: diagnostics
includeTestsFromTemplates: null
# tests:
#   - name: TEST-SW.WEB-0001_my_Test
#     path: web/Diagnostics

But it would be nice to add processing of incorrect syntax and so that the server does not crash....