コード例 #1
0
 def test_common_get_city(self):
     """
     查看当前城市是否为:南京
     :return:
     """
     rlpage = RentListPage(self.driver)
     name = rlpage.get_city_name().text
     if (name == u'南京'):
         print ('Test Pass.')
     else:
         print ('Test Fail.')
コード例 #2
0
    def test_common_show_all_city(self):
        """
        查看全部城市
        :return:
        """
        rlpage = RentListPage(self.driver)
        ele = rlpage.get_city_name()
        rlpage.move_to_element(ele)
        rlpage.sleep(2)

        hot_name = rlpage.get_all_city()
        try:
            assert u"热门城市" in hot_name.text
            print ('Test Pass.')
        except Exception as e:
            print ("Test Fail.", format(e))
            raise e