Пример #1
0
    def save(self, expect_modif=True):
        """
        Press the Save button and click on Yes in the Confimation dialog.

        If expect_modif is True, this method will click on Yes when
        the confimation dialog appears. Otherwise, it will raise an
        exception if the confimation dialog is present (since the project
        is not supposed to be modified) or return if not present.

        Use as::
            yield dialog.save()
        """

        save_button = get_widget_by_name("project properties edit source")
        save_button.clicked()
        yield timeout(300)

        confirmation_dialog = get_window_by_title("Confirmation")
        yes_button = get_button_from_label("Yes", confirmation_dialog)

        if expect_modif:
            yes_button.clicked()
            yield timeout(300)
        elif yes_button:
            gps_assert(yes_button is None, True,
                       "The project has been marked as " +
                       "modified but it was not expected")
            no_button = get_button_from_label("No", confirmation_dialog)
            no_button.clicked()
Пример #2
0
 def open_and_yield(self, file):
     yield self._open_and_yield("edit file properties")
     self.dialog = get_window_by_title("Properties for %s" % file)
Пример #3
0
 def open_and_yield(self):
     yield self._open_and_yield("/File/Close")
     yield wait_idle()
     self.dialog = get_window_by_title("Confirmation")
Пример #4
0
 def open_and_yield(self):
     yield self._open_and_yield("/Build/Run/Custom...")
     self.dialog = get_window_by_title("Custom...")
Пример #5
0
 def open_and_yield(self):
     yield self._open_and_yield("/Build/Project/Custom Build...")
     self.dialog = get_window_by_title("Custom Build...")
Пример #6
0
 def open_and_yield(self, file):
     yield self._open_and_yield("edit file properties")
     self.dialog = get_window_by_title("Properties for %s" % file)
Пример #7
0
 def open_and_yield(self):
     yield self._open_and_yield("/Build/Project/Custom Build...")
     self.dialog = get_window_by_title("Custom Build...")