Example #1
0
 def count_search_resutls(self):
     box = TextBox(self._browser, self._config.get_locator('result_lbl'))
     if (box.get_text().find('not found') != -1):
         return 0
     return 1
     
     
Example #2
0
 def search_news_articles(self, search_query):
     '''
     Search news articles according to given text
     
     :Args:
         search_query - text to find.
         
     :Usage:
         page.search_news_articles('weather')
     '''
     box = TextBox(self._browser, self._config.get_locator('search_text'))
     box.set_text(search_query)
     elem = Element(self._browser, self._config.get_locator('search_btn'))
     elem.click()
     
     return self
Example #3
0
    def search_news_articles(self, search_query):
        '''
        Search news articles according to given text
        
        :Args:
            search_query - text to find.
            
        :Usage:
            page.search_news_articles('weather')
        '''
        box = TextBox(self._browser, self._config.get_locator('search_text'))
        box.set_text(search_query)
        elem = Element(self._browser, self._config.get_locator('search_btn'))
        elem.click()

        return self
Example #4
0
    def search_transaction(self, after_date, before_date):
        '''
        Start searching transactions 
        in the range from [before_date] to the [after_date]
        
        :Args:
            before_date - String, before date [format: mm/dd/yyyy]
            after_date - String, after date [format: mm/dd/yyyy]
        
        :Usage:
            page.search_transaction('01/04/1920','04/04/2011')
        '''
        box = TextBox(self._browser, self._config.get_locator('after_date'))
        box.set_text(after_date)
        box.set_locator('before_date')
        box.set_text(before_date)
        elem = Element(self._browser, self._config.get_locator('submit_btn'))
        elem.click()

        return self
Example #5
0
 def search_transaction(self, after_date, before_date):
     '''
     Start searching transactions 
     in the range from [before_date] to the [after_date]
     
     :Args:
         before_date - String, before date [format: mm/dd/yyyy]
         after_date - String, after date [format: mm/dd/yyyy]
     
     :Usage:
         page.search_transaction('01/04/1920','04/04/2011')
     '''
     box = TextBox(self._browser, self._config.get_locator('after_date'))
     box.set_text(after_date)
     box.set_locator('before_date')
     box.set_text(before_date)
     elem = Element(self._browser, self._config.get_locator('submit_btn'))
     elem.click()
     
     return self
Example #6
0
    def login(self, user, password):
        from mainpage import MainPage
        from homepage import HomePage

        box = TextBox(self._browser, self._config.get_locator('username'))
        box.set_text(user)
        box.set_locator(self._config.get_locator('password'))
        box.set_text(password)
        elem = Element(self._browser, self._config.get_locator('submit'))
        elem.click()

        page = HomePage(self._browser, False)
        if not page.is_logged_in():
            msg = "Login failed"
            box.set_locator(self._config.get_locator('err_msg'))
            if (box.exists()):
                msg = box.get_text()
            assert msg == ''
        return MainPage(self._browser, False)
Example #7
0
    def login(self, user, password):
        from mainpage import MainPage
        from homepage import HomePage

        box = TextBox(self._browser, self._config.get_locator("username"))
        box.set_text(user)
        box.set_locator(self._config.get_locator("password"))
        box.set_text(password)
        elem = Element(self._browser, self._config.get_locator("submit"))
        elem.click()

        page = HomePage(self._browser, False)
        if not page.is_logged_in():
            msg = "Login failed"
            box.set_locator(self._config.get_locator("err_msg"))
            if box.exists():
                msg = box.get_text()
            assert msg == ""
        return MainPage(self._browser, False)
Example #8
0
 def count_search_resutls(self):
     box = TextBox(self._browser, self._config.get_locator('result_lbl'))
     if (box.get_text().find('not found') != -1):
         return 0
     return 1