MATLAB App Testing - Confirmation dialog boxes

11 visualizaciones (últimos 30 días)
Michaela Konstantinou
Michaela Konstantinou el 9 de Sept. de 2021
Comentada: Michaela Konstantinou el 15 de Sept. de 2021
How can I handle confirmation dialog boxes when testing an app with gestures?
Ideally, I would like to choose 'OK' or 'Cancel' based on some variables' values.
I know there is not a straight-forward way to do it but is there any option so that they get disabled or something??
  2 comentarios
Thomas Fournier
Thomas Fournier el 10 de Sept. de 2021
you can create them, and chosse if they are visible or not, editable or note.
app.Button1.Visible='off'
app.Button2.Editable='off'
Michaela Konstantinou
Michaela Konstantinou el 10 de Sept. de 2021
Editada: Michaela Konstantinou el 10 de Sept. de 2021
but I dont have buttons and the confirmation boxes are not properties of the app. They are created with uiconfirm in a another component's callback function.

Iniciar sesión para comentar.

Respuesta aceptada

Andy Campbell
Andy Campbell el 13 de Sept. de 2021
Until this functionality is included in the App Testing Framework, if you can adjust the architecture of the source code you can leverage a similar strategy as that outlined here and use a mock for the confirmation dialog.
Does that help you get going?
Thanks,
Andy
  2 comentarios
Michaela Konstantinou
Michaela Konstantinou el 14 de Sept. de 2021
The app I need to test is a large project with (too) many components and even more confirmation boxes. I have not fully understood how mock works but I think that cannot be applied to this case. Adjustments to the app's source code are surely impossible to happen.
Do you have any suggestions on how to understand mocks ? Just to make sure that they really can't help me.
Thank you very much,
Michaela
Michaela Konstantinou
Michaela Konstantinou el 15 de Sept. de 2021
I would like to ask if it is possible to close manualy these dialog boxes during testing with matlab.uitest.unlock. Where in the source code or the testing code should I add this feature? could you please help?

Iniciar sesión para comentar.

Más respuestas (2)

Sean de Wolski
Sean de Wolski el 10 de Sept. de 2021
You can dismiss and alert but not a confirmation dialog yet. Capability for alerts added in 21a.
https://www.mathworks.com/help/releases/R2021a/matlab/ref/matlab.uitest.testcase.dismissalertdialog.html
  3 comentarios
Sean de Wolski
Sean de Wolski el 13 de Sept. de 2021
I don't know of any hacky way. I added your vote to the enhancement request for this.
Michaela Konstantinou
Michaela Konstantinou el 15 de Sept. de 2021
Thank you

Iniciar sesión para comentar.


Cris LaPierre
Cris LaPierre el 10 de Sept. de 2021
It sounds like you want to programmatically close a confirmation diaglog box. If so, see this answer.

Categorías

Más información sobre Testing Frameworks en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by