Search code examples
javaelectronspectron

How to get spectron tests results and pass them to outer test(for example, Ucumber-Junit test)


I have an app, that consists of two parts 1. Backend, Java Spring Boot app 2. Electron/Angular front-end I wanna test backend and frontend together. It would be great to start JUnit cucumber test, call the spectron test from one of cucumber cases, and get result of spectron testing back to cucumber. Is it real to get some tests results from spectron "outside"?


Solution

  • I think you can do this like this :

    Create BE and FE test projects in the same project,

    Create one object that stores your responses datas from both BE and FE:

    While tests are running, initialize this object and feed it with your results.

    How to feed this object:

    • For BE, if it is an API store responses as a JSON.
    • For FE, collect datas from elements and store them as String or Json again.

    Then assert every actions for BE and FE on the corresponding steps and validate them with comparing this JSON or String datas.