~carla-sella/music-app/show_albums_sheet

« back to all changes in this revision

Viewing changes to tests/autopilot/music_app/emulators/main_window.py

  • Committer: Carla Sella
  • Date: 2013-09-14 15:02:05 UTC
  • mto: This revision was merged to the branch mainline in revision 103.
  • Revision ID: carla.sella@gmail.com-20130914150205-wx4m3eq7hdldlni0
Migrated to emulator.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
 
# Copyright 2013 Canonical
3
 
#
4
 
# This program is free software: you can redistribute it and/or modify it
5
 
# under the terms of the GNU General Public License version 3, as published
6
 
# by the Free Software Foundation.
7
 
 
8
 
"""Music app autopilot emulators."""
9
 
 
10
 
 
11
 
class MainWindow(object):
12
 
    """An emulator class that makes it easy to interact with the
13
 
    music-app.
14
 
 
15
 
    """
16
 
    def __init__(self, app):
17
 
        self.app = app
18
 
 
19
 
    def get_qml_view(self):
20
 
        """Get the main QML view"""
21
 
        return self.app.select_single("QQuickView")
22
 
 
23
 
    def get_object(self, typeName, name):
24
 
        """Get a specific object"""
25
 
        return self.app.select_single(typeName, objectName=name)
26
 
 
27
 
    def get_objects(self, typeName, name):
28
 
        """Get more than one object"""
29
 
        return self.app.select_many(typeName, objectName=name)
30