SlideShare a Scribd company logo
1 of 8
Download to read offline
Unity, testing with Autopilot

Quality is the Word!




Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com
Unity, testing with Autopilot

Setting up your system

           # Download del codice sorgente di unity
           $ bzr branch lp:unity

           # Installazione pacchetti necessari
           $ sudo apt-get install python-autopilot

           # Testare codice on-the-edge
           $ sudo add-apt-repository 
                  ppa:unity-team/staging


Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com
Unity, testing with Autopilot

Running the tests
    # Entrare nella directory di unity
    $ cd ~/my-source-code/unity

    # Esportare la variabile PYTHONPATH
    $ export PYTHONPATH=$PWD/tests/autopilot

    # Avviare i test
    $ autopilot run unity

    # Avviare un test specifico
    $ autopilot run 
    unity.tests.test_panel.PanelIndicatorEntry*

Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com
Unity, testing with Autopilot

Inspecting Unity
  $ autopilot vis




Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com
Unity, testing with Autopilot

Test Example
           // Inherit from unity::debug::Introspectable

           void PanelIndicatorEntryView::AddProperties(GVariantBuilder* builder)
           {
             variant::BuilderWrapper(builder)
             .add(GetAbsoluteGeometry())
             .add("entry_id", GetEntryID())
             .add("name_hint", entry_->name_hint())
             .add("type", entry_->type_name())
             .add("priority", entry_->priority())
             .add("label", GetLabel())
             .add("label_sensitive", IsLabelSensitive())
             .add("label_visible", IsLabelVisible())
             .add("icon_sensitive", IsIconSensitive())
             .add("active", proxy_->active())
             .add("menu_x", proxy_->geometry().x)
             .add("menu_y", proxy_->geometry().y));
             // ecc...
           }


Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com
Unity, testing with Autopilot

Test Example
    def test_menu_opens_on_click(self):
        """Tests that clicking on a menu entry, opens a menu."""
        self.open_new_application_window("Calculator")
        refresh_fn = lambda: len(self.panel.menus.get_entries())
        self.assertThat(refresh_fn, Eventually(GreaterThan(0)))
        menu_entry = self.panel.menus.get_entries()[0]

           self.mouse_open_indicator(menu_entry)

           self.assertThat(menu_entry.active, Eventually(Equals(True)))
           self.assertThat(menu_entry.menu_x, Eventually(Equals(menu_entry.x)))
           self.assertThat(menu_entry.menu_y, Eventually(Equals(self.panel.height)))

    def mouse_open_indicator(self, indicator):
        """This is an utility function that safely opens an indicator."""
        if not isinstance(indicator, IndicatorEntry):
            raise TypeError("Window must be a IndicatorEntry")

           indicator.mouse_click()
           self.addCleanup(self.panel.move_mouse_below_the_panel)
           self.addCleanup(self.keyboard.press_and_release, "Escape")
           self.assertThat(indicator.active, Eventually(Equals(True)))

Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com
Unity, testing with Autopilot

RTFM!



      Documentazione e tutorial:
       ●
           http://unity.ubuntu.com/autopilot/
       ●
           https://wiki.ubuntu.com/Unity/QA/Autopilot




Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com
Unity, testing with Autopilot

Question time




                                     GRAZIE!
                                       Ping me: Trevinho @ Freenode




Ubuntu-it meeting 2012
 Marco Trevisan (Treviño) – marco@ubuntu.com

More Related Content

Similar to Introduzione ad Autopilot

engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptsharanyak0721
 
Unit Testing Using N Unit
Unit Testing Using N UnitUnit Testing Using N Unit
Unit Testing Using N UnitGaurav Arora
 
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insEclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insTonny Madsen
 
Security Testing
Security TestingSecurity Testing
Security TestingKiran Kumar
 
Automated ui testing
Automated ui testingAutomated ui testing
Automated ui testingDavidReidy
 
Alexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extraAlexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extrarit2010
 
J unit presentation
J unit presentationJ unit presentation
J unit presentationPriya Sharma
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Cogapp
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasyAnkit Goel
 
Alexandre Iline Rit 2010 Java Fxui
Alexandre Iline Rit 2010 Java FxuiAlexandre Iline Rit 2010 Java Fxui
Alexandre Iline Rit 2010 Java Fxuirit2010
 
Testing Options in Java
Testing Options in JavaTesting Options in Java
Testing Options in JavaMichael Fons
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Javasuraj pandey
 

Similar to Introduzione ad Autopilot (20)

Gui
GuiGui
Gui
 
Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
 
engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.ppt
 
Unit Testing Using N Unit
Unit Testing Using N UnitUnit Testing Using N Unit
Unit Testing Using N Unit
 
SWTBot Tutorial
SWTBot TutorialSWTBot Tutorial
SWTBot Tutorial
 
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-insEclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
 
Security Testing
Security TestingSecurity Testing
Security Testing
 
Automated ui testing
Automated ui testingAutomated ui testing
Automated ui testing
 
Alexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extraAlexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extra
 
J unit presentation
J unit presentationJ unit presentation
J unit presentation
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
Day 5
Day 5Day 5
Day 5
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
 
SwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made EasySwtBot: Unit Testing Made Easy
SwtBot: Unit Testing Made Easy
 
Alexandre Iline Rit 2010 Java Fxui
Alexandre Iline Rit 2010 Java FxuiAlexandre Iline Rit 2010 Java Fxui
Alexandre Iline Rit 2010 Java Fxui
 
JsUnit
JsUnitJsUnit
JsUnit
 
Testing Options in Java
Testing Options in JavaTesting Options in Java
Testing Options in Java
 
Jsunit
JsunitJsunit
Jsunit
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Java
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 

More from Marco Trevisan

State of the GNOME - 2022 - Ubuntu Summit
State of the GNOME - 2022 - Ubuntu SummitState of the GNOME - 2022 - Ubuntu Summit
State of the GNOME - 2022 - Ubuntu SummitMarco Trevisan
 
Ubucon 19 - The making of ubuntu desktop for 20.04
Ubucon 19 - The making of ubuntu desktop for 20.04Ubucon 19 - The making of ubuntu desktop for 20.04
Ubucon 19 - The making of ubuntu desktop for 20.04Marco Trevisan
 
Introduzione ad ubuntu core - Qt day 2017
Introduzione ad ubuntu core  - Qt day 2017Introduzione ad ubuntu core  - Qt day 2017
Introduzione ad ubuntu core - Qt day 2017Marco Trevisan
 
Workshop: snap from zero to hero
Workshop: snap from zero to heroWorkshop: snap from zero to hero
Workshop: snap from zero to heroMarco Trevisan
 
Introduzione ad ubuntu core
Introduzione ad ubuntu coreIntroduzione ad ubuntu core
Introduzione ad ubuntu coreMarco Trevisan
 
Alla scoperta di Ubuntu Phone, lo smartphone Open Source
Alla scoperta di Ubuntu Phone, lo smartphone Open SourceAlla scoperta di Ubuntu Phone, lo smartphone Open Source
Alla scoperta di Ubuntu Phone, lo smartphone Open SourceMarco Trevisan
 
Unity: la shell di Ubuntu Phone
Unity: la shell di Ubuntu PhoneUnity: la shell di Ubuntu Phone
Unity: la shell di Ubuntu PhoneMarco Trevisan
 
Openmoko - La costruzione di un “Telefoninux”
Openmoko - La costruzione di un “Telefoninux”Openmoko - La costruzione di un “Telefoninux”
Openmoko - La costruzione di un “Telefoninux”Marco Trevisan
 

More from Marco Trevisan (8)

State of the GNOME - 2022 - Ubuntu Summit
State of the GNOME - 2022 - Ubuntu SummitState of the GNOME - 2022 - Ubuntu Summit
State of the GNOME - 2022 - Ubuntu Summit
 
Ubucon 19 - The making of ubuntu desktop for 20.04
Ubucon 19 - The making of ubuntu desktop for 20.04Ubucon 19 - The making of ubuntu desktop for 20.04
Ubucon 19 - The making of ubuntu desktop for 20.04
 
Introduzione ad ubuntu core - Qt day 2017
Introduzione ad ubuntu core  - Qt day 2017Introduzione ad ubuntu core  - Qt day 2017
Introduzione ad ubuntu core - Qt day 2017
 
Workshop: snap from zero to hero
Workshop: snap from zero to heroWorkshop: snap from zero to hero
Workshop: snap from zero to hero
 
Introduzione ad ubuntu core
Introduzione ad ubuntu coreIntroduzione ad ubuntu core
Introduzione ad ubuntu core
 
Alla scoperta di Ubuntu Phone, lo smartphone Open Source
Alla scoperta di Ubuntu Phone, lo smartphone Open SourceAlla scoperta di Ubuntu Phone, lo smartphone Open Source
Alla scoperta di Ubuntu Phone, lo smartphone Open Source
 
Unity: la shell di Ubuntu Phone
Unity: la shell di Ubuntu PhoneUnity: la shell di Ubuntu Phone
Unity: la shell di Ubuntu Phone
 
Openmoko - La costruzione di un “Telefoninux”
Openmoko - La costruzione di un “Telefoninux”Openmoko - La costruzione di un “Telefoninux”
Openmoko - La costruzione di un “Telefoninux”
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Introduzione ad Autopilot

  • 1. Unity, testing with Autopilot Quality is the Word! Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com
  • 2. Unity, testing with Autopilot Setting up your system # Download del codice sorgente di unity $ bzr branch lp:unity # Installazione pacchetti necessari $ sudo apt-get install python-autopilot # Testare codice on-the-edge $ sudo add-apt-repository ppa:unity-team/staging Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com
  • 3. Unity, testing with Autopilot Running the tests # Entrare nella directory di unity $ cd ~/my-source-code/unity # Esportare la variabile PYTHONPATH $ export PYTHONPATH=$PWD/tests/autopilot # Avviare i test $ autopilot run unity # Avviare un test specifico $ autopilot run unity.tests.test_panel.PanelIndicatorEntry* Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com
  • 4. Unity, testing with Autopilot Inspecting Unity $ autopilot vis Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com
  • 5. Unity, testing with Autopilot Test Example // Inherit from unity::debug::Introspectable void PanelIndicatorEntryView::AddProperties(GVariantBuilder* builder) { variant::BuilderWrapper(builder) .add(GetAbsoluteGeometry()) .add("entry_id", GetEntryID()) .add("name_hint", entry_->name_hint()) .add("type", entry_->type_name()) .add("priority", entry_->priority()) .add("label", GetLabel()) .add("label_sensitive", IsLabelSensitive()) .add("label_visible", IsLabelVisible()) .add("icon_sensitive", IsIconSensitive()) .add("active", proxy_->active()) .add("menu_x", proxy_->geometry().x) .add("menu_y", proxy_->geometry().y)); // ecc... } Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com
  • 6. Unity, testing with Autopilot Test Example def test_menu_opens_on_click(self): """Tests that clicking on a menu entry, opens a menu.""" self.open_new_application_window("Calculator") refresh_fn = lambda: len(self.panel.menus.get_entries()) self.assertThat(refresh_fn, Eventually(GreaterThan(0))) menu_entry = self.panel.menus.get_entries()[0] self.mouse_open_indicator(menu_entry) self.assertThat(menu_entry.active, Eventually(Equals(True))) self.assertThat(menu_entry.menu_x, Eventually(Equals(menu_entry.x))) self.assertThat(menu_entry.menu_y, Eventually(Equals(self.panel.height))) def mouse_open_indicator(self, indicator): """This is an utility function that safely opens an indicator.""" if not isinstance(indicator, IndicatorEntry): raise TypeError("Window must be a IndicatorEntry") indicator.mouse_click() self.addCleanup(self.panel.move_mouse_below_the_panel) self.addCleanup(self.keyboard.press_and_release, "Escape") self.assertThat(indicator.active, Eventually(Equals(True))) Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com
  • 7. Unity, testing with Autopilot RTFM! Documentazione e tutorial: ● http://unity.ubuntu.com/autopilot/ ● https://wiki.ubuntu.com/Unity/QA/Autopilot Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com
  • 8. Unity, testing with Autopilot Question time GRAZIE! Ping me: Trevinho @ Freenode Ubuntu-it meeting 2012 Marco Trevisan (Treviño) – marco@ubuntu.com