Linux Desktop Testing Project: Difference between revisions

Content deleted Content added
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags
Example: code style Black
Line 40:
 
<syntaxhighlight lang="python">
#!/usr/bin/env pythonpython3
 
# The standard import stuff.
Line 48:
 
# Here we open the app.
launchapp('"gedit'")
 
# Now we find it and make sure it is open.
gedit_win = locate('"*gedit'")
gedit_win.waittillguiexist()
 
# Now we type into gedit.
text_field = gedit_win.getchild('"txt1'")
text_field.enterstring("G'Day mate!")
 
# Save a picture to prove we did it.
imagecapture('"*gedit'", '"/tmp/foo.png'")
 
# Quit gedit.
quit = gedit_win.getchild('"mnuQuit'")
quit.selectmenuitem()
 
# Close without saving.
dont_save = locate('"Question'")
dont_save.waittillguiexist()
 
button = dont_save.getchild('"btnClosewithoutSaving'")
button.click()