~ci-train-bot/ubuntu-ui-toolkit/ubuntu-ui-toolkit-ubuntu-yakkety-2069

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_popups.py

  • Committer: Bileto Bot
  • Date: 2016-08-14 09:06:34 UTC
  • mfrom: (1000.985.35 OTA13-2016-06-29)
  • Revision ID: ci-train-bot@canonical.com-20160814090634-uoxtg7ektrlidwh6
* Fix OptionSelectorTestCase tests.
* Fix more OptionSelector autopilot tests
* Disable documentation building for GLES builds. Fixes LP: #1606222.
* Replace abs with qFabs due to GCC6 breakage. Fixes LP: #1610943.
* Limit s390x dependencies more due to upstart/s390x problems and removed
  packages in archives. Fixes LP: #1610951
* ListItemLayout doc: add elide mode change example and add section about
  labels default properties values. Fixes LP: #1603450.
* ListItemLayout doc: add explicit note about the need to bind ListItem's
  height to layout's height.
* More Scrollbar optimizations: 20% faster creation time. Fixes LP: #1606451
* Scrollbar: fix wrong thumb color on tap/mouse release and increase coverage
  of hover states unit tests. Fixes LP: #1608897
* Fix null pointer property initializer used with 1.3 PageWrapper. 
  Fixes LP: #1604780.
* Fix BottomEdge content URL preloading. Fixes LP: #1604509.
* UCUnits::resolveResource: Prefer image path if it exists. This saves
  searching the disk for @gu images, which is a big speedup. According to
  callgrind loading 100 images from a folder that contains 380 images goes
  from around 3 million instructions per UCUnits::resolveResource call down
  to around 10 thousand. This optimization is ok since it is not correct to
  ship both image.png and image@20.png. You either have to ship gu-enabled
  files or not, but mixing them is not allowed. Searched for cases in which
  that may be happening in my phone and found none. Fixes LP: #1604029.
* Configure colors of the buttons in the ActionBar and PageHeader through
  their Styles. Fixes LP: #1597774.
* Fix assigning of constant values to a grouped property in StyleHints.
  Fixes LP: #1602836.
* Fix list view keyboard navigation for RightToLeft and BottomToTop 
  directions. Fixes LP: #1605634
* Use external QML files instead of embedded QML strings for autopilot tests.
  Fixes LP: #1578319
* Fix failing autopilot header tests.
* Fix ActionSelectionPopover Autopilot CPO tests.
* Include indexes in "offline" docs and filter out link errors.
  Fixes LP: #1603937.
* Increase focus ring thickness from 1dp to 2dp. Fixes LP: #1602690.
* Add a snippet about tests to the toplevel README
* Enter/Return to trigger, Space to expand ComboButton. Fixes LP: #1523817.
* Initialize engine variable before using it in the _engine case.
* Use Qt.rgba instead of #0000 checking ListItem default color. 
  Fixes LP: #1560004
* Don't use a different .desktop file in the gallery tests.
  Fixes LP: #1578319
* Update scaling docs, set QT_SCALE_FACTOR and unset GRID_UNIT_PX.
  Fixes LP: #1610208
* Sections: load Icons asynchronously.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
class ActionSelectionPopoverTestCase(tests.QMLFileAppTestCase):
25
25
 
 
26
    # FIXME: Currently we are only testing UITK 1.0 Popups,
 
27
    #   we need to test 1.3 as well. See bug 1612582.
26
28
    path = os.path.abspath(__file__)
27
29
    dir_path = os.path.dirname(path)
28
30
    test_qml_file_path = os.path.join(
60
62
            popover.click_action_button, 'actionTwo')
61
63
        self.assertEqual(
62
64
            str(error),
63
 
            'Action with objectName "actionTwo" not found.')
 
65
            'Button for action with objectName "actionTwo" not found.')
64
66
 
65
67
    def test_click_disabled_button_by_object_name(self):
66
68
        self._open_popover()
72
74
            popover.click_action_button, 'actionDisabled')
73
75
        self.assertEqual(
74
76
            str(error),
75
 
            'Action with objectName "actionDisabled" not found.')
 
77
            'Button for action with objectName "actionDisabled" not visible.')
76
78
 
77
79
    def test_click_hidden_button_by_object_name(self):
78
80
        self._open_popover()
83
85
            popover.click_action_button, 'actionHidden')
84
86
        self.assertEqual(
85
87
            str(error),
86
 
            'Action with objectName "actionHidden" not found.')
 
88
            'Button for action with objectName "actionHidden" not visible.')
87
89
 
88
90
    def _open_popover(self):
89
91
        open_button = self.main_view.select_single(
110
112
            str(error), 'The popover is not open.')
111
113
 
112
114
 
113
 
class ComposerSheetTestCase(tests.QMLStringAppTestCase):
114
 
 
115
 
    test_qml = ("""
116
 
import QtQuick 2.0
117
 
import Ubuntu.Components 1.0
118
 
import Ubuntu.Components.Popups 1.0
119
 
 
120
 
MainView {
121
 
    width: units.gu(48)
122
 
    height: units.gu(60)
123
 
    objectName: "mainView"
124
 
 
125
 
    Button {
126
 
        objectName: "openComposerSheetButton"
127
 
        text: "Open Composer Sheet"
128
 
        onClicked: PopupUtils.open(testComposerSheet);
129
 
    }
130
 
 
131
 
    Label {
132
 
        id: "label"
133
 
        objectName: "actionLabel"
134
 
        anchors.centerIn: parent
135
 
        text: "No action taken."
136
 
    }
137
 
 
138
 
    Component {
139
 
        id: testComposerSheet
140
 
        ComposerSheet {
141
 
            id: sheet
142
 
            objectName: "testComposerSheet"
143
 
            onCancelClicked: {
144
 
                label.text = "Cancel selected."
145
 
            }
146
 
            onConfirmClicked: {
147
 
                label.text = "Confirm selected."
148
 
            }
149
 
        }
150
 
    }
151
 
}
152
 
""")
 
115
class ComposerSheetTestCase(tests.QMLFileAppTestCase):
 
116
 
 
117
    path = os.path.abspath(__file__)
 
118
    dir_path = os.path.dirname(path)
 
119
    test_qml_file_path = os.path.join(
 
120
        dir_path, 'test_popups.ComposerSheetTestCase.qml')
153
121
 
154
122
    def setUp(self):
155
123
        super().setUp()