forcing the emulator name to be the same as the qml type it's too restrictive

Bug #1210260 reported by Leo Arias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot
Fix Released
High
Max Brustkern
autopilot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When using autopilot emulators, we have to name the emulator class the same way as the QML type it represents.
Sometimes, the application will have the same QML type used in really different ways, defining different children to them. For example, an application could have a Bar used once as a bar for the top and once as a bar for the bottom.
In this case we have to put all the methods for the top bar and for the bottom bar on the same Bar emulator.

It would be a lot better if the name of the emulator is not fixed, and we can use something else to select it. What comes to mind after talking with thomi is to select the right emulator based on the attributes it has.

Something like:

class TopBar(BaseEmulator):

    emulator_attributes = {'type': 'Bar', 'objectName': 'top'}

    def top_bar_method(self): ....

class BottomBar(BaseEmulator):

    emulator_attributes = {'type': 'Bar', 'objectName': 'bottom'}

    def bottom_bar_method(self): ....

Related branches

Leo Arias (elopio)
description: updated
Changed in autopilot:
status: New → Triaged
importance: Undecided → High
Changed in autopilot:
assignee: nobody → Max Brustkern (nuclearbob)
Changed in autopilot:
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopilot - 1.4+14.04.20140319.1-0ubuntu1

---------------
autopilot (1.4+14.04.20140319.1-0ubuntu1) trusty; urgency=low

  [ Thomi Richards ]
  * Launch upstart and click applications via upstart app launch.

  [ Max Brustkern ]
  * PEP257 docstring fixes.
  * Autopilot emulators can declare a validate_dbus_object class method
    that takes a dbus path and state as arguments. (LP:1210260) (LP:
    #1210260)
 -- Ubuntu daily release <email address hidden> Wed, 19 Mar 2014 20:13:30 +0000

Changed in autopilot (Ubuntu):
status: New → Fix Released
Changed in autopilot:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.