Example #1
0
def delete_all_webhooks():
    self = helper
    BaseTest.initEnvironment(self)
    BaseTest.login_private(self)

    # wait for home page loaded
    home_page = HomePage(self.driver)
    home_page.check_if_loaded()
    home_page.click_app("contest")

    home_page.check_app_loaded()
    home_page.click_webhooks_link()

    webhook_page = WebHookPage(self.driver)
    assert webhook_page.check_page_loaded()

    webhook_page.delete_all_webhooks()

    self.driver.quit()
Example #2
0
    def run(self):
        print self.name + "=> begin to execute run() method"

        if self.urls.empty():
            print self.name + ": the queue is empty now!"
            return

        try:
            BaseTest.initEnvironment(self)
            BaseTest.login_private(self)

            # wait for home page loaded
            home_page = HomePage(self.driver)
            home_page.check_if_loaded()
            home_page.click_app("contest")

            home_page.check_app_loaded()
            home_page.click_webhooks_link()

            webhook_page = WebHookPage(self.driver)
            webhook_page.check_page_loaded()

            while True:
                try:
                    if self.urls.empty():
                        print self.name + ": the queue is empty now!"
                        break;

                    url = self.urls.get()
                    print self.name + ": start to add url:" + url

                    webhook_page.add_webhook(url)
                    if webhook_page.verify_webhook_url(url):
                        print self.name + ": success add url: " + url
                    else:
                        print self.name + ": failed to add url: " + url + " due to verify failed."
                    # helper.save_screen_shot(self.driver, helper.get_current_time())
                except Exception, e:
                    print self.name + ": failed to add url: " + url + " due to exception: " + e.message
                    print e.message
        except Exception, e:
            print self.name + "=> run() failed due to " + e.message