I
I
InBackSound2019-06-25 13:15:35
Automation
InBackSound, 2019-06-25 13:15:35

How to test dynamic 3D objects [Three.js] on the site?

There is a dynamic 3D model (the site has a rotating room with dynamic display of walls), written using the tree js library.
Examples of figures: https://threejsfundamentals.org/threejs/lessons/ru...
The html code (F12-Elements) cannot be reached, the code does not see the figure. Please advise how you can test the presence of this figure, changing textures, etc. with autotests. Before that, I studied Selenium, but everything came down to Console commands in the browser, i.e. I could "probe" everything through the html code of the page.
If the shapes can be tested using Selenium + Python, I will be glad, because I know them a little

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeniy _, 2019-06-25
@GeneD88

I have never worked with webgl, but the solution that came to mind is to parse threejs-primitives.js (The figures and their sizes are indicated there) - it is loaded with the page, then collect all the elements (tagName they will have the corresponding figures from js) and their values ​​for ".pair .shape". Create a dictionary for each. Compare sizes. I think if there are zeros, then the figure "did not draw".
Here with the state (gradient, etc.), while I find it difficult to come up with something;)

N
Nikolai Chuprik, 2019-10-27
@choupa

All primitives and their properties in the form of a tree of objects live in JS. Accordingly, find in the code what the global object THREE.Scene is called (Most likely it is called scene :), as in all manuals). And watch all the objects nested in the scene through the Console or through Watch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question