Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
15.34k stars 1.87k forks source link

Testing API for Taipy GUI #1716

Open ShootingStarD opened 2 months ago

ShootingStarD commented 2 months ago

Description

Taipy is a very nice GUI lib to make dashboard. One way to make it even more useful in a real production environment would be to build a testing API similar to the one of streamlit.

One application would be that in my project, I change a function that is both used for page 1 and page 2, the change is successful for page_2 but not page_1 (and I don't really want to make manually tests each time my app grows)

Solution Proposed

I do not really know how it could be implemented but basically having some function to simulate the app and the action possible to make in the app

Impact of Solution

No response

Additional Context

No response

Acceptance Criteria

No response

Code of Conduct

FlorianJacta commented 2 months ago

This seems interesting; thank you for the issue!

FabienLelaquais commented 2 months ago

Hi @ShootingStarD. And thank you for your input.

Your question is really relevant. However, I'm not sure how to address that: we have tons of automated tests in the library itself, involving pure backend testing, or tests on rendering, checks on communications (like was a callback invoked should some user event happen?), styling... and so on. All those tests are based on public packages such as pytest or playwright.

The one thing I can think of is creating a Testing section in the User documentation to explain how to perform a given test, with what tools. In your opinion, would that suffice?

Thanks again

ShootingStarD commented 2 months ago

I

Hi @ShootingStarD. And thank you for your input.

Your question is really relevant. However, I'm not sure how to address that: we have tons of automated tests in the library itself, involving pure backend testing, or tests on rendering, checks on communications (like was a callback invoked should some user event happen?), styling... and so on. All those tests are based on public packages such as pytest or playwright.

The one thing I can think of is creating a Testing section in the User documentation to explain how to perform a given test, with what tools. In your opinion, would that suffice?

Thanks again

I suppose a Testing section in the User Doc for the GUI manual would already be very nice. My first idea was to for example, be able to have a function that takes a Gui instance as input and be able to apply action such as clicking on button with id=x and be able to assert the state of a variable, check that an element is visible or not anymore etc

But once again, a testing section would be good enough!

gShahr commented 1 month ago

I am interested in contributing. Could you assign me this task?

FlorianJacta commented 1 month ago

Sure, here you go @gShahr ! You can ask us any questions here

FlorianJacta commented 1 month ago

FYI, this was asked by a client.

gShahr commented 1 month ago

I have created a draft pull request with my current progress.

Questions About Documentation and Examples