示例#1
0
    def test_dontConfirmRemoveRule(self):
        print('=== Don\'t confirm remove rule test ===')

        # Wait startup notifications are closed
        self.assertTrue(
            tools.waitUntil(lambda: notification.noNotification(self.browser)))

        print('  Open rules dashboard')
        dashboard.open(self.browser)
        dashboard.openAutomation(self.browser)
        ruleNumber = 0

        print('  Get rule table')
        rulesTable = dashboard.automation.waitRulesTableHasNRules(
            self.browser, 1)
        removeButton = dashboard.automation.getRuleRemoveButton(
            rulesTable, ruleNumber)

        self.assertEqual(
            dashboard.automation.getRuleState(rulesTable, ruleNumber),
            dashboard.automation.RuleState.Stopped)

        print('  Remove rule')
        removeButton.click()
        confirmationModal = modals.waitOkCancelModal(self.browser)
        print('  Cancel')
        confirmationModal.cancel()

        print('  Expect no notification')
        self.assertTrue(notification.noNotification(self.browser))
        print('  Expect no change in rule table')
        self.assertEqual(
            dashboard.automation.getRuleNumberInTable(self.browser,
                                                      rulesTable), 1)
示例#2
0
   def test_dontConfirmRemoveRule(self):
      print '=== Don\'t confirm remove rule test ==='

      # Wait startup notifications are closed
      self.assertTrue(tools.waitUntil(lambda: notification.noNotification(self.browser)))

      print '  Open rules dashboard'
      dashboard.open(self.browser)
      dashboard.openAutomation(self.browser)
      ruleNumber = 0

      print '  Get rule table'
      rulesTable = dashboard.automation.waitRulesTableHasNRules(self.browser, 1)
      removeButton = dashboard.automation.getRuleRemoveButton(rulesTable, ruleNumber)
      
      self.assertEqual(dashboard.automation.getRuleState(rulesTable, ruleNumber), dashboard.automation.RuleState.Stopped)
      
      print '  Remove rule'
      removeButton.click()
      confirmationModal = dashboard.automation.waitRemoveRuleConfirmationModal(self.browser)
      print '  Cancel'
      confirmationModal.cancel()
      
      print '  Expect no notification'
      self.assertTrue(notification.noNotification(self.browser))
      print '  Expect no change in rule table'
      self.assertEqual(dashboard.automation.getRuleNumberInTable(self.browser, rulesTable), 1)
示例#3
0
 def checkCreateWidget(self, widgetType, widgetTitle,
                       widgetExpectedPosition, widgetExpectedSize):
     print '  Check no notification occurs'
     self.assertTrue(notification.noNotification(self.browser))
     print '  Check widget present on main page'
     widget = mainPage.findWidgetOnCurrentPage(self.browser, widgetType,
                                               widgetTitle)
     self.assertIsNotNone(widget)
示例#4
0
 def checkCreateWidget(self, widgetType, widgetTitle,
                       widgetExpectedPosition, widgetExpectedSize):
     print('  Check no notification occurs')
     self.assertTrue(notification.noNotification(self.browser))
     print('  Check widget present on main page')
     self.assertTrue(
         tools.waitUntil(lambda: mainPage.findWidgetOnCurrentPage(
             self.browser, widgetType, widgetTitle) is not None))
示例#5
0
 def checkCreateWidget(self, widgetType, widgetTitle, widgetExpectedPosition, widgetExpectedSize):
    print '  Check no notification occurs'
    self.assertTrue(notification.noNotification(self.browser))
    print '  Check widget present on main page'
    widget = mainPage.widgets.findWidgetOnCurrentPage(self.browser, widgetType, widgetTitle)
    self.assertIsNotNone(widget)