Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot parse given Error object #549

Closed
nbarrett opened this issue Apr 28, 2020 · 3 comments
Closed

Error: Cannot parse given Error object #549

nbarrett opened this issue Apr 28, 2020 · 3 comments
Labels
enhancement A good idea that should be implemented @serenity-js/core

Comments

@nbarrett
Copy link
Contributor

Hey @jan-molak! Having some good success migrating my 1.x project with the assistance of the excellent new handbook: Upgrading to Serenity/JS 2.0 😄

One thing that's cropped up that I think might be a bug is an exception that's thrown Error: Cannot parse given Error object at .Object.ErrorStackParser$$parse [as parse]()(node_modules/error-stack-parser/error-stack-parser.js:35) .ErrorStackParser.parse()(node_modules/@serenity-js/core/src/io/ErrorStackParser.ts:13) .ErrorRenderer.renderError()(node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/ErrorRenderer.ts:21). I've googled this and have found mention of this error in this comment but I'm not invoking new Error() anywhere in my code. One interesting thing is that the page does contain some text with "Error: " in it, but I wouldn't have expected that to trip anything up. For completeness I've enclosed the json file that got produced in that test run here (sorry if it's a bit on the long side!):

{
  "name": "process command parameters",
  "title": "process command parameters",
  "id": "walks-and-events-manager;process-command-parameters;chrome-81-0-4044-122;mac-os-x",
  "manual": false,
  "testSteps": [
    {
      "number": 1,
      "description": "nick performs ExtractTask",
      "startTime": 1588035256758,
      "children": [
        {
          "number": 2,
          "description": "nick performs Log",
          "startTime": 1588035256759,
          "children": [],
          "reportData": [],
          "screenshots": [],
          "result": "SUCCESS",
          "duration": 1
        }
      ],
      "reportData": [],
      "screenshots": [],
      "result": "SUCCESS",
      "duration": 3
    },
    {
      "number": 3,
      "description": "nick disables synchronisation with Angular",
      "startTime": 1588035256761,
      "children": [],
      "reportData": [],
      "screenshots": [
        {
          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-disables-synchronisation-with-angular-e48e83d1a6.png"
        }
      ],
      "result": "SUCCESS",
      "duration": 1
    },
    {
      "number": 4,
      "description": "nick starts on the walks and events manager\"",
      "startTime": 1588035256763,
      "children": [
        {
          "number": 5,
          "description": "nick starts with navigation to http://www.ramblers.org.uk/group-walks-and-events-manager.aspx",
          "startTime": 1588035256764,
          "children": [
            {
              "number": 6,
              "description": "nick disables synchronisation with Angular",
              "startTime": 1588035256764,
              "children": [],
              "reportData": [],
              "screenshots": [
                {
                  "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-disables-synchronisation-with-angular-e48e83d1a6.png"
                }
              ],
              "result": "SUCCESS",
              "duration": 0
            },
            {
              "number": 7,
              "description": "nick navigates to 'http://www.ramblers.org.uk/group-walks-and-events-manager.aspx'",
              "startTime": 1588035256765,
              "children": [],
              "reportData": [],
              "screenshots": [
                {
                  "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-navigates-to-httpwww.ramblers.org.ukgroup-walks-and-events-manager.aspx-28d05fc5d9.png"
                }
              ],
              "result": "SUCCESS",
              "duration": 2684
            }
          ],
          "reportData": [],
          "screenshots": [],
          "result": "SUCCESS",
          "duration": 2686
        }
      ],
      "reportData": [],
      "screenshots": [],
      "result": "SUCCESS",
      "duration": 2688
    },
    {
      "number": 8,
      "description": "nick logs into Ramblers",
      "startTime": 1588035259451,
      "children": [
        {
          "number": 9,
          "description": "nick ensures that the text of the login status does equal 'Login'",
          "startTime": 1588035259453,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-ensures-that-the-text-of-the-login-status-does-equal-login-28d05fc5d9.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 350
        },
        {
          "number": 10,
          "description": "nick performs Hide",
          "startTime": 1588035259803,
          "children": [],
          "reportData": [],
          "screenshots": [],
          "result": "SUCCESS",
          "duration": 468
        },
        {
          "number": 11,
          "description": "nick waits up to 10s until the chat window does not become visible",
          "startTime": 1588035260272,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-10s-until-the-chat-window-does-not-become-visible-a33a583738.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 6
        },
        {
          "number": 12,
          "description": "nick enters 'blah.blah@example.com' into the user name",
          "startTime": 1588035260279,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-enters-blah.blah@example.com-into-the-user-name-ba6c0b1c12.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 528
        },
        {
          "number": 13,
          "description": "nick enters 'xxxxxxxxxx' into the password",
          "startTime": 1588035260808,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-enters-xxxxxxxxxx-into-the-password-5dec8f9084.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 358
        },
        {
          "number": 14,
          "description": "nick clicks on the login button",
          "startTime": 1588035261167,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-clicks-on-the-login-button-255616328c.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 5607
        },
        {
          "number": 15,
          "description": "nick ensures that the text of the login status does equal 'Logout'",
          "startTime": 1588035266775,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-ensures-that-the-text-of-the-login-status-does-equal-logout-255616328c.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 325
        }
      ],
      "reportData": [],
      "screenshots": [],
      "result": "SUCCESS",
      "duration": 7650
    },
    {
      "number": 16,
      "description": "nick filters walks to show all",
      "startTime": 1588035267101,
      "children": [
        {
          "number": 17,
          "description": "nick ensures that the select all walks button does become present",
          "startTime": 1588035267102,
          "children": [
            {
              "number": 18,
              "description": "nick performs Hide",
              "startTime": 1588035267410,
              "children": [
                {
                  "number": 19,
                  "description": "nick executes a synchronous script with arguments: [ the chat window ]",
                  "startTime": 1588035267423,
                  "children": [],
                  "reportData": [
                    {
                      "id": "report-data-ck9j772i10012j7dyfvkyf92z",
                      "isEvidence": false,
                      "path": "",
                      "title": "Script source",
                      "contents": "arguments[0].style.visibility='hidden'"
                    }
                  ],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-executes-a-synchronous-script-with-arguments-[-the-chat-window-]-616db78da1.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 10
                }
              ],
              "reportData": [],
              "screenshots": [],
              "result": "SUCCESS",
              "duration": 24
            },
            {
              "number": 20,
              "description": "nick clicks on the items per page popup when ready",
              "startTime": 1588035267434,
              "children": [
                {
                  "number": 21,
                  "description": "nick waits for processing to complete",
                  "startTime": 1588035267434,
                  "children": [
                    {
                      "number": 22,
                      "description": "nick waits up to 1m until the progress indicator does not become visible",
                      "startTime": 1588035267435,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-progress-indicator-does-not-become-visible-616db78da1.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 307
                    },
                    {
                      "number": 23,
                      "description": "nick waits up to 1m until the loader indicator does not become visible",
                      "startTime": 1588035267743,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-loader-indicator-does-not-become-visible-616db78da1.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 300
                    }
                  ],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 609
                },
                {
                  "number": 24,
                  "description": "nick performs Hide",
                  "startTime": 1588035268044,
                  "children": [
                    {
                      "number": 25,
                      "description": "nick executes a synchronous script with arguments: [ the chat window ]",
                      "startTime": 1588035268335,
                      "children": [],
                      "reportData": [
                        {
                          "id": "report-data-ck9j77379001fj7dy8q2d5p74",
                          "isEvidence": false,
                          "path": "",
                          "title": "Script source",
                          "contents": "arguments[0].style.visibility='hidden'"
                        }
                      ],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-executes-a-synchronous-script-with-arguments-[-the-chat-window-]-616db78da1.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 6
                    }
                  ],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 298
                },
                {
                  "number": 26,
                  "description": "nick waits up to 10s until the items per page popup does become visible",
                  "startTime": 1588035268342,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-10s-until-the-items-per-page-popup-does-become-visible-616db78da1.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 303
                },
                {
                  "number": 27,
                  "description": "nick clicks on the items per page popup",
                  "startTime": 1588035268646,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-clicks-on-the-items-per-page-popup-c5375ec109.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 320
                }
              ],
              "reportData": [],
              "screenshots": [],
              "result": "SUCCESS",
              "duration": 1532
            },
            {
              "number": 28,
              "description": "nick clicks on the show all walks when ready",
              "startTime": 1588035268967,
              "children": [
                {
                  "number": 29,
                  "description": "nick waits for processing to complete",
                  "startTime": 1588035268967,
                  "children": [
                    {
                      "number": 30,
                      "description": "nick waits up to 1m until the progress indicator does not become visible",
                      "startTime": 1588035268967,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-progress-indicator-does-not-become-visible-c5375ec109.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 308
                    },
                    {
                      "number": 31,
                      "description": "nick waits up to 1m until the loader indicator does not become visible",
                      "startTime": 1588035269275,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-loader-indicator-does-not-become-visible-c5375ec109.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 302
                    }
                  ],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 611
                },
                {
                  "number": 32,
                  "description": "nick performs Hide",
                  "startTime": 1588035269578,
                  "children": [
                    {
                      "number": 33,
                      "description": "nick executes a synchronous script with arguments: [ the chat window ]",
                      "startTime": 1588035269867,
                      "children": [],
                      "reportData": [
                        {
                          "id": "report-data-ck9j774dt001yj7dy8nus34o6",
                          "isEvidence": false,
                          "path": "",
                          "title": "Script source",
                          "contents": "arguments[0].style.visibility='hidden'"
                        }
                      ],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-executes-a-synchronous-script-with-arguments-[-the-chat-window-]-c5375ec109.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 6
                    }
                  ],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 296
                },
                {
                  "number": 34,
                  "description": "nick waits up to 10s until the show all walks does become visible",
                  "startTime": 1588035269875,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-10s-until-the-show-all-walks-does-become-visible-c5375ec109.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 307
                },
                {
                  "number": 35,
                  "description": "nick clicks on the show all walks",
                  "startTime": 1588035270182,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-clicks-on-the-show-all-walks-6bfcd299ce.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 319
                }
              ],
              "reportData": [],
              "screenshots": [],
              "result": "SUCCESS",
              "duration": 1534
            },
            {
              "number": 36,
              "description": "nick waits for processing to complete",
              "startTime": 1588035270502,
              "children": [
                {
                  "number": 37,
                  "description": "nick waits up to 1m until the progress indicator does not become visible",
                  "startTime": 1588035270502,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-progress-indicator-does-not-become-visible-c98da0048d.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 2296
                },
                {
                  "number": 38,
                  "description": "nick waits up to 1m until the loader indicator does not become visible",
                  "startTime": 1588035272799,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-loader-indicator-does-not-become-visible-c98da0048d.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 316
                }
              ],
              "reportData": [],
              "screenshots": [],
              "result": "SUCCESS",
              "duration": 2615
            }
          ],
          "reportData": [],
          "screenshots": [],
          "result": "SUCCESS",
          "duration": 6015
        }
      ],
      "reportData": [],
      "screenshots": [],
      "result": "SUCCESS",
      "duration": 6016
    },
    {
      "number": 39,
      "description": "nick deletes unpublished walks ",
      "startTime": 1588035273117,
      "children": [
        {
          "number": 40,
          "description": "nick ensures that the select all walks button does become visible",
          "startTime": 1588035273118,
          "children": [
            {
              "number": 41,
              "description": "nick selects walks not published or with ids: ",
              "startTime": 1588035273413,
              "children": [
                {
                  "number": 42,
                  "description": "nick deselects all walks",
                  "startTime": 1588035273524,
                  "children": [
                    {
                      "number": 43,
                      "description": "nick clicks on the clear all walks button",
                      "startTime": 1588035273524,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-clicks-on-the-clear-all-walks-button-fea3cbcc67.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 47
                    },
                    {
                      "number": 44,
                      "description": "nick waits up to 1m until selected walk count to be 0 does equal true",
                      "startTime": 1588035273571,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-selected-walk-count-to-be-0-does-equal-true-d8d3cfde91.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 373
                    }
                  ],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 421
                },
                {
                  "number": 45,
                  "description": "nick waits for processing to complete",
                  "startTime": 1588035273945,
                  "children": [
                    {
                      "number": 46,
                      "description": "nick waits up to 1m until the progress indicator does not become visible",
                      "startTime": 1588035273945,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-progress-indicator-does-not-become-visible-6cfdbd9410.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 2020
                    },
                    {
                      "number": 47,
                      "description": "nick waits up to 1m until the loader indicator does not become visible",
                      "startTime": 1588035275967,
                      "children": [],
                      "reportData": [],
                      "screenshots": [
                        {
                          "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-the-loader-indicator-does-not-become-visible-6cfdbd9410.png"
                        }
                      ],
                      "result": "SUCCESS",
                      "duration": 316
                    }
                  ],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 2339
                }
              ],
              "reportData": [],
              "screenshots": [],
              "result": "SUCCESS",
              "duration": 2872
            },
            {
              "number": 48,
              "description": "nick performs Unpublish",
              "startTime": 1588035276285,
              "children": [
                {
                  "number": 49,
                  "description": "nick performs SaveBrowserSource",
                  "startTime": 1588035276285,
                  "children": [],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 300
                },
                {
                  "number": 50,
                  "description": "nick clicks on the unpublish selected walks button",
                  "startTime": 1588035276585,
                  "children": [],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 46
                },
                {
                  "number": 51,
                  "description": "nick accepts the alert popup",
                  "startTime": 1588035276633,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-accepts-the-alert-popup-89a4a879eb.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 3
                },
                {
                  "number": 52,
                  "description": "nick waits up to 1m until no selected walks to have status of \"Published\" does equal true",
                  "startTime": 1588035276638,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-no-selected-walks-to-have-status-of-published-does-equal-true-234821b3e0.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 420
                }
              ],
              "reportData": [],
              "screenshots": [],
              "result": "SUCCESS",
              "duration": 774
            },
            {
              "number": 53,
              "description": "nick performs Delete",
              "startTime": 1588035277060,
              "children": [
                {
                  "number": 54,
                  "description": "nick clicks on the delete selected walks button",
                  "startTime": 1588035277414,
                  "children": [],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 39
                },
                {
                  "number": 55,
                  "description": "nick waits up to 5s until the visibility of an alert does equal a Promise",
                  "startTime": 1588035277455,
                  "children": [],
                  "reportData": [],
                  "screenshots": [],
                  "result": "SUCCESS",
                  "duration": 2
                },
                {
                  "number": 56,
                  "description": "nick accepts the alert popup",
                  "startTime": 1588035277458,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-accepts-the-alert-popup-ee9603f01e.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 2
                },
                {
                  "number": 57,
                  "description": "nick waits up to 1m until error or walk listing count to be 1 does equal true",
                  "startTime": 1588035277461,
                  "children": [],
                  "reportData": [],
                  "screenshots": [
                    {
                      "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-error-or-walk-listing-count-to-be-1-does-equal-true-ee9603f01e.png"
                    }
                  ],
                  "result": "SUCCESS",
                  "duration": 375
                }
              ],
              "reportData": [],
              "screenshots": [],
              "result": "SUCCESS",
              "duration": 777
            }
          ],
          "reportData": [],
          "screenshots": [],
          "result": "SUCCESS",
          "duration": 4719
        }
      ],
      "reportData": [],
      "screenshots": [],
      "result": "SUCCESS",
      "duration": 4720
    },
    {
      "number": 58,
      "description": "nick prepares to upload file /tmp/ramblers/testfile-1588035251070.csv containing 2 walks",
      "startTime": 1588035277838,
      "children": [
        {
          "number": 59,
          "description": "nick clicks on the CSV file accordion expander",
          "startTime": 1588035277838,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-clicks-on-the-csv-file-accordion-expander-2908a0cd3f.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 330
        },
        {
          "number": 60,
          "description": "nick enters '/tmp/ramblers/testfile-1588035251070.csv' into the Choose Files button",
          "startTime": 1588035278170,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-enters-tmpramblerstestfile-1588035251070.csv-into-the-choose-files-button-c7acc1f746.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 343
        },
        {
          "number": 61,
          "description": "nick clicks on the CSV upload button",
          "startTime": 1588035278513,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-clicks-on-the-csv-upload-button-f7265b0b8e.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 5851
        },
        {
          "number": 62,
          "description": "nick waits up to 1m until error or walk listing count to be 2 does equal true",
          "startTime": 1588035284365,
          "children": [],
          "reportData": [],
          "screenshots": [
            {
              "screenshot": "photo-mac-os-x-chrome-81.0.4044.122-nick-waits-up-to-1m-until-error-or-walk-listing-count-to-be-2-does-equal-true-0ca2cc9d62.png"
            }
          ],
          "result": "SUCCESS",
          "duration": 431
        },
        {
          "number": 63,
          "description": "nick performs SaveBrowserSource",
          "startTime": 1588035284797,
          "children": [],
          "reportData": [],
          "screenshots": [],
          "result": "SUCCESS",
          "duration": 317
        },
        {
          "number": 64,
          "description": "nick reports on upload",
          "startTime": 1588035285115,
          "children": [],
          "reportData": [],
          "screenshots": [],
          "result": "ERROR",
          "duration": 47,
          "exception": {
            "errorType": "Error",
            "message": "Cannot parse given Error object",
            "stackTrace": [
              {
                "declaringClass": "",
                "methodName": "Object.ErrorStackParser$$parse [as parse]()",
                "fileName": "node_modules/error-stack-parser/error-stack-parser.js",
                "lineNumber": 35
              },
              {
                "declaringClass": "",
                "methodName": "ErrorStackParser.parse()",
                "fileName": "node_modules/@serenity-js/core/src/io/ErrorStackParser.ts",
                "lineNumber": 13
              },
              {
                "declaringClass": "",
                "methodName": "ErrorRenderer.renderError()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/ErrorRenderer.ts",
                "lineNumber": 21
              },
              {
                "declaringClass": "",
                "methodName": "ErrorRenderer.render()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/ErrorRenderer.ts",
                "lineNumber": 12
              },
              {
                "declaringClass": "",
                "methodName": "MatchesObjectsWithCommonPrototype.transformation()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/OutcomeMapper.ts",
                "lineNumber": 23
              },
              {
                "declaringClass": "",
                "methodName": "MatchesObjectsWithCommonPrototype.MatcherRule.execute()",
                "fileName": "node_modules/tiny-types/src/pattern-matching/rules/MatcherRule.ts",
                "lineNumber": 13
              },
              {
                "declaringClass": "",
                "methodName": "ObjectMatcher.PatternMatcher.else()",
                "fileName": "node_modules/tiny-types/src/pattern-matching/PatternMatcher.ts",
                "lineNumber": 17
              },
              {
                "declaringClass": "",
                "methodName": "OutcomeMapper.mapOutcome()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/OutcomeMapper.ts",
                "lineNumber": 28
              },
              {
                "declaringClass": "",
                "methodName": "SceneReport.mapOutcome()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/SceneReport.ts",
                "lineNumber": 347
              },
              {
                "declaringClass": "",
                "methodName": "undefined()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/SceneReport.ts",
                "lineNumber": 170
              },
              {
                "declaringClass": "",
                "methodName": "SceneReport.withMutated()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/SceneReport.ts",
                "lineNumber": 351
              },
              {
                "declaringClass": "",
                "methodName": "SceneReport.activityFinished()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/reports/SceneReport.ts",
                "lineNumber": 170
              },
              {
                "declaringClass": "",
                "methodName": "MatchesObjectsWithCommonPrototype.transformation()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/strategies/SingleSceneReportingStrategy.ts",
                "lineNumber": 20
              },
              {
                "declaringClass": "",
                "methodName": "MatchesObjectsWithCommonPrototype.MatcherRule.execute()",
                "fileName": "node_modules/tiny-types/src/pattern-matching/rules/MatcherRule.ts",
                "lineNumber": 13
              },
              {
                "declaringClass": "",
                "methodName": "ObjectMatcher.PatternMatcher.else()",
                "fileName": "node_modules/tiny-types/src/pattern-matching/PatternMatcher.ts",
                "lineNumber": 17
              },
              {
                "declaringClass": "",
                "methodName": "SingleSceneReportingStrategy.handle()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/strategies/SingleSceneReportingStrategy.ts",
                "lineNumber": 26
              },
              {
                "declaringClass": "",
                "methodName": "MatchesAnything.transformation()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.ts",
                "lineNumber": 43
              },
              {
                "declaringClass": "",
                "methodName": "MatchesAnything.MatcherRule.execute()",
                "fileName": "node_modules/tiny-types/src/pattern-matching/rules/MatcherRule.ts",
                "lineNumber": 13
              },
              {
                "declaringClass": "",
                "methodName": "ObjectMatcher.PatternMatcher.else()",
                "fileName": "node_modules/tiny-types/src/pattern-matching/PatternMatcher.ts",
                "lineNumber": 17
              },
              {
                "declaringClass": "",
                "methodName": "SerenityBDDReporter.notifyOf()",
                "fileName": "node_modules/@serenity-js/serenity-bdd/src/stage/crew/serenity-bdd-reporter/SerenityBDDReporter.ts",
                "lineNumber": 41
              },
              {
                "declaringClass": "",
                "methodName": "undefined()",
                "fileName": "node_modules/@serenity-js/core/src/stage/StageManager.ts",
                "lineNumber": 33
              },
              {
                "declaringClass": "",
                "methodName": "StageManager.notifyOf()",
                "fileName": "node_modules/@serenity-js/core/src/stage/StageManager.ts",
                "lineNumber": 33
              },
              {
                "declaringClass": "",
                "methodName": "Stage.announce()",
                "fileName": "node_modules/@serenity-js/core/src/stage/Stage.ts",
                "lineNumber": 124
              },
              {
                "declaringClass": "",
                "methodName": "undefined()",
                "fileName": "node_modules/@serenity-js/core/src/screenplay/activities/TrackedActivity.ts",
                "lineNumber": 38
              },
              {
                "declaringClass": "",
                "methodName": "processTicksAndRejections()",
                "fileName": "internal/process/task_queues.js",
                "lineNumber": 97
              }
            ]
          }
        }
      ],
      "reportData": [],
      "screenshots": []
    }
  ],
  "userStory": {
    "id": "walks-and-events-manager",
    "storyName": "Walks and Events Manager",
    "path": "serenity-js/features/process-command-args.ts",
    "type": "feature"
  },
  "startTime": 1588035256751,
  "tags": [
    {
      "name": "Walks and Events Manager",
      "type": "feature",
      "displayName": "Walks and Events Manager"
    },
    {
      "name": "chrome 81.0.4044.122",
      "type": "browser",
      "browserName": "chrome",
      "browserVersion": "81.0.4044.122",
      "displayName": "chrome 81.0.4044.122"
    },
    {
      "name": "Mac OS X",
      "type": "platform",
      "platformName": "Mac OS X",
      "platformVersion": "",
      "displayName": "Mac OS X"
    }
  ],
  "featureTag": {
    "name": "Walks and Events Manager",
    "type": "feature",
    "displayName": "Walks and Events Manager"
  },
  "testSource": "Jasmine",
  "context": "chrome,Mac OS X",
  "driver": "chrome"
}

@jan-molak
Copy link
Member

That's interesting, would you be able to publish a mini-project to Github that demonstrates this issue so I could try to reproduce it? Also, it might be useful to add StreamReporter to your stage crew to see if it tells us more about that error.

It seems to me that something somewhere throws a string (or some other junk), that's not a proper Error object, and when ErrorRenderer tries to parse, the parser it uses, so error-stack-parser blows up.

You could also add a console.dir(error) in ErrorRenderer.js render(error) method to quickly see what it's given.

@nbarrett
Copy link
Contributor Author

nbarrett commented May 1, 2020

Hi Again @jan-molak - I did manage to diagnose the problem and fix it as it was actually in my own code but I thought I'd give you a reproducible example anyway as I think this might still be a bug. It happens when a rejected Promise is returned by a Task. For instance have a look here.

What that looks like in the report is this:
image which is normally (well, in serenity-screenplay-java version anyway), something that happens when exceptions are thrown outside of the serenity framework lifecycle e.g. in a @Before or @After code.

But thanks for your pointers! 👍

@jan-molak
Copy link
Member

Ah right, I see, so the issue is when custom code throws stuff that's not an Error. Well, it shouldn't be doing that :-) But yeah, it might be good from dev experience perspective if Serenity/JS caught things like that. Thanks!

@jan-molak jan-molak added enhancement A good idea that should be implemented @serenity-js/core and removed awaiting feedback labels May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A good idea that should be implemented @serenity-js/core
Projects
None yet
Development

No branches or pull requests

2 participants