Squish test for clicking exit/minimize/maximize button for QT application

StackOverflow https://stackoverflow.com/questions/20412985

  •  29-08-2022
  •  | 
  •  

سؤال

I have an application that is suppose to run in full screen and not allow the user to minimize or exit with the use of the minimize and exit buttons that usually appear on the corner of the window. Essentially the title bar or whatever it is called is not visible.

I'm trying to make a test where squish checks whether the exit/minimize buttons can be pressed or is visible. Is there a way to do this?

When I try to use Spy or record function all I get is the window commands for minimize/exit a window but no clickbutton or a way to verify the visibility of the buttons.

Thanks!

هل كانت مفيدة؟

المحلول

I asked squish tech support and they recommended using the qt window flags such as:

def logWindowFlags(flags):
  test.log("Qt::WindowMinimizeButtonHint = %s" % flags.testFlag(Qt.WindowMinimizeButtonHint))
  test.log("Qt::WindowMaximizeButtonHint = %s" % flags.testFlag(Qt.WindowMaximizeButtonHint))
  test.log("Qt::WindowCloseButtonHint = %s" % flags.testFlag(Qt.WindowCloseButtonHint))
  test.log("Qt::WindowOkButtonHint = %s" % flags.testFlag(Qt.WindowOkButtonHint))
def main:
  logWindowFlags(widgetObject.windowFlags())
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top