Wait for ng serve to compile then run UAT tests

During the Travis build process, I need to be able to trigger ng serve, wait for its completion/compiling so that I can then run UAT tests from Cucumber JS.

Can anyone assist me on how to do so, with my current .yml below, dev server is started with ng serve but I can’t get Travis to progress to the final, script step.

language: node_js
node_js:
  - lts/*
install:
  - npm install
before_script:
  - ng serve
script:
  - npx cucumber-js src/uat-tests

When reporting problems, please consider including:

  1. What you are trying to achieve
  2. What you have tried (probably a link to the configuration)
  3. What happened instead (often, pointing to a build log URL, in the form of https://travis-ci.com/OWNER/REPO/build/NNNNNNN would be helpful).
  1. I have stated what I am trying to achieve already:

be able to trigger ng serve , wait for its completion/compiling so that I can then run UAT tests from Cucumber JS

  1. What I have tried
language: node_js
node_js:
  - lts/*
install:
  - npm install
before_script:
  - ng serve
script:
  - npx cucumber-js src/uat-tests
  1. What happened:

dev server is started with ng serve but I can’t get Travis to progress to the final, script step

The test suite fires but all tests fail as Travis does not wait for ng serve & first to compile and therefore cannot access the dev server at http://localhost:4200/ as it has not compiled at that time

Build log URL, please.

No, as it is a private repository.

Then please send email to support. Thanks.