Automatic testing

Hello

I would like to know if you have some solutions for Automatic testing on a babylon.js project ?

Today, we have classic web sites, with unit tests and web UI test using Selenium. And all non regressions tests are automated.

I am interested to replace a part of the application using 3D, and I would like to know if you have already some alternative for automatic testing for the UI part. (I know I can keep unit tests without UI…)

Thanks for advance
Jean-Pierre

1 Like

Hey!

we are using that script for babylonjs build: Babylon.js/validation.js at master · BabylonJS/Babylon.js · GitHub

It is triggered by our CI build every time someone push a PR

1 Like

Et bonjour,

Thanks you for your answer. The work your did on this project is really amazing !!! Bravo !!!
If I understood well the script, the heart of the validation is screen capture comparison ?

Do you have an idea to simulate :

  • Camera move
  • Click on clickable objects

Regards,
Jean-Pierre

Hi @sybaris,

Regarding unit tests you can write them using NullEngine from babylonjs using any unit test framework you like.
Same goes with auto tests.

2 Likes

We have method to simulate pointers : https://playground.babylonjs.com/#1GLEJK#5

We actually use this pg during our validations.

2 Likes

Hi everybody,

Thanks for your answer, and also thanks for you responsiveness. All your answers are very interesting.
I kept them in mind, and as soon as I will start my test Framework, I will try to integrate them…

Regards,
Jean-Pierre

Hi everyone,

Sorry to revive this topic but I was looking at an aswer about automatic testing with BABYLON JS on the forum and the link given by @Deltakosh 3 years ago is now dead.

Is there any other place where i can now find your script ?

Thanks in advance,

Boris

@RaananW revamped it all and he ll be the best to let us know of the new greatness

We are now using jest (and jest-screenshot combined with puppeteer) in order to run tests both locally and on our CI.

It is all documented here - Start Contributing to Babylon.js | Babylon.js Documentation (babylonjs.com) and here - Start Contributing to Babylon.js | Babylon.js Documentation

My question was the same as the one posted by @sybaris. Basically, i’m looking for a tool or a script to help me with non regression tests in my babylon projects. I’m not able today to contribute to babylonJS.

But maybe these are the same tools.

The answer from Deltakosh provided you with the way we are testing the framework. This has changed, and I have pointed you to the way we test the framework now :slight_smile:

The babylon sourcecode is all out in the open. You can see exactly how we run tests and how they are integrated in our CI. The npm scripts can provide you with the jet commands required to get started.

It is not a trivial task, so it is not simple to explain, especially not in a forum post. I already gave you the abstract answer - jest, puppeteer and jest-screenshot for validation tests. The sourcecode is in our repository. There are two projects in tools you might find interesting, tests and testTools.

Having said that, I guess on our end we could provide a project that will run tests for you, based on that code. I am not sure how trivial this task is, but I will be happy to look into that in the future. You can create an issue on github, I will assign it to me.

1 Like

Ok, that’s done… Thanks very much…

for reference Realise a project to show Automatic testing in BabylonJS · Issue #12772 · BabylonJS/Babylon.js · GitHub