2022-01-25 14:05:59 +00:00
Feature : The winGUI API client
Scenario : Testing the clip_read and clip_write methods
Given a w i n G U I c l i e n t
When t h e c l i p _ w r i t e m e t h o d i s c a l l e d t o s t o r e t h e t e x t " T h e r e i s a l i g h t t h a t n e v e r g o e s o u t "
Then w h e n t h e c l i p _ r e a d m e t h o d i s c a l l e d , i t m u s t r e t u r n t h e s a m e t e x t
Scenario : Testing the screen_scale and screen_size methods
Given a w i n G U I c l i e n t
When t h e s c r e e n _ s c a l e m e t h o d i s c a l l e d
And t h e s c r e e n _ s i z e m e t h o d i s a l s o c a l l e d
Then t h e r e t u r n s o f b o t h m u s t b e e q u a l
# Please note that most of the other screen methods use image recognition and, because of that, it is not possible to test them on every computer, since there is no way to know wich images are being displayed on the screen.
2022-01-26 18:42:27 +00:00
# Also, the other methods wich do not use image recognition are simply too difficult to test.
Scenario : Testing proc_exec and proc_all methods
Given a w i n G U I c l i e n t
When t h e p r o c _ e x e c m e t h o d i s c a l l e d w i t h " m s p a i n t "
And t h e p r o c _ a l l m e t h o d i s c a l l e d
Then t h e r e m u s t b e a p r o c e s s w i t h t h e n a m e " m s p a i n t . e x e " i n s i d e t h e l i s t
Scenario : Testing proc_name method
Given a w i n G U I c l i e n t
And t h e i n i t i a l i z a t i o n o f M i c r o s o f t P a i n t
And t h e " N a m e " a n d " P i d " i n f o s a b o u t t h i s p r o c e s s
When t h e p r o c _ n a m e m e t h o d i s c a l l e d w i t h t h e " P i d " c o l l e c t e d
Then t h e r e t u r n m u s t b e t e s a m e a s t h e " N a m e " c o l l e c t e d
Scenario : Testing proc_pids method
Given a w i n G U I c l i e n t
And t h e i n i t i a l i z a t i o n o f M i c r o s o f t P a i n t
And t h e " N a m e " a n d " P i d " i n f o s a b o u t t h i s p r o c e s s
When t h e p r o c _ p i d s i s c a l l e d
2022-01-26 20:14:31 +00:00
Then t h e " P i d " i n f o c o l l e c t e d m u s t b e i n s i d e t h e a r r a y r e t u r n e d
Scenario : Testing the window_list and window_hwnd methods
Given a w i n G U I c l i e n t
And t h e i n i t i a l i z a t i o n o f M i c r o s o f t P a i n t
And t h e " N a m e " a n d " P i d " i n f o s a b o u t t h i s p r o c e s s
When t h e w i n d o w _ h w n d m e t h o d i s c a l l e d w i t h t h e p a r a m e t e r " m s p a i n t . e x e "
And t h e w i n d o w _ l i s t m e t h o d i s c a l l e d
Then t h e r e t u r n o f w i n d o w _ h w n d m u s t b e t h e v a l u e o f o n e o f t h e " H w n d " k e y s r e t u r n e d i n w i n d o w _ l i s t
# Scenario: Testing window_activate, window_activetitle and window_activehwnd
# Given a winGUI client
# And the initialization of Microsoft Paint
# And the "Name" and "Pid" infos about this process
# And the window hwnd obtained from the "Name" info
# When the window_activate method is called with the Paint Hwnd obtained
# And the methods window_activetitle and window_activehwnd are called
# Then the returned value from window_activetitle must contain the substring "Paint"
2022-01-26 20:51:16 +00:00
# And the returned value from window_activehwnd must be equal to the hwnd previously obtained
Scenario : Testing the display methods
Given a w i n G U I c l i e n t
And t h e c u r r e n t r e s o l u t i o n o f t h e d i s p l a y
When t h e d i s p l a y _ s e t r e s m e t h o d i s c a l l e d t o s e t t h e d i s p l a y r e s o l u t i o n i n 800 x 600
Then t h e n e w d i s p l a y r e s o l u t i o n m u s t b e 800 x 600
And t h e m e t h o d s m u s t b e a b l e t o s e t y o u r r e s o l u t i o n t o t h e p r e v i o u s o n e