Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the GuiTestAssistant and ModalDialogTester #933

Merged
merged 5 commits into from
Apr 29, 2021
Merged

Conversation

aaronayres35
Copy link
Contributor

@aaronayres35 aaronayres35 commented Apr 22, 2021

closes #904

This PR adds a "GUI Testing" section to the documentation describing the GuiTestAssistant and ModalDialogTester.

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM. @corranwebster @mdickinson do you have any feedback?

docs/source/testing.rst Outdated Show resolved Hide resolved
docs/source/testing.rst Outdated Show resolved Hide resolved
docs/source/testing.rst Outdated Show resolved Hide resolved
docs/source/testing.rst Outdated Show resolved Hide resolved
Comment on lines +159 to +160
When testing modal dialog related code the main recommendation for doing so is
try to avoid it. If you can, try testing the dialog in a non-modal fashion. Or,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's kinda blunt :D

docs/source/testing.rst Outdated Show resolved Hide resolved
Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good! A couple of comments. The main comment is that we need to be very clear that some of the GuiTestAssistant methods are designed to be used as context managers, and using them without a with statement may have surprising effects.

docs/source/testing.rst Outdated Show resolved Hide resolved
docs/source/testing.rst Outdated Show resolved Hide resolved

- :meth:`event_loop_until_condition`

Runs the real Qt event loop until the provided condition evaluates to True.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One current usage difficulty with GuiTestAssistant is figuring out which methods are context managers: some of the methods are designed to be used a context managers, and if used without a with statement do nothing instead. (We've had more than one bug in real code as a result of this.)

It would be worth clearly noting for each method whether its return value is intended to be used as a context manager or not.

@aaronayres35 aaronayres35 changed the title [WIP] Document the GuiTestAssistant and ModalDialogTester Document the GuiTestAssistant and ModalDialogTester Apr 28, 2021
Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor change suggestion

docs/source/testing.rst Outdated Show resolved Hide resolved
Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document the GuiTestAssistant and ModalDialogTester
3 participants