def setUp(self): """ @summary: set up @return: None """ super(TestContacts, self).setUp() cfg_file = os.path.join(os.environ.get('TEST_REPO_ROOT', ''), 'tests.tablet.google_fast.contacts.conf') self.contacts = ContactsImpl(self.config.read(cfg_file, 'contacts'))
def setUp(self): cfg_file = 'tests.tablet.google_fast.conf' super(SeachTest, self).setUp() self._test_name = __name__ self.search = SearchImpl(\ self.config.read(cfg_file, 'google_search')) self.browser = BrowserImpl(self.config.read(cfg_file, 'browser')) self.contacts = ContactsImpl(self.config.read(cfg_file, 'wifisetting')) print "[Setup]: %s" % self._test_name self.__search_setup()
def setUp(self): """ @summary: set up @return: None """ super(TestContacts, self).setUp() self.cfg_file = 'tests.tablet.google_fast.conf' self.contacts = ContactsImpl( self.config.read(self.cfg_file, 'wifisetting')) self.account = self.config.read(self.cfg_file, 'gmail_mail').get("sender_account")
class CheckContactsAfterGOTA(UIATestBase): def setUp(self): super(CheckContactsAfterGOTA, self).setUp() self._test_name = __name__ self.gota= gotaImpl(self) self.contacts=ContactsImpl() print "[Setup]: %s" % self._test_name def tearDown(self): print "[Teardown]: %s" % self._test_name super(CheckContactsAfterGOTA, self).tearDown() self.cfg = None def testCheckContactsAfterGOTA(self): print "[RunTest]: %s" % self.__str__() self.gota.unlock_screen_gota() self.contacts.launch_by_am() self.contacts.add_a_new_contact("newcontact", account=None)
class TestContacts(UIATestBase): """ @summary: Test Contact functionalities """ def setUp(self): """ @summary: set up @return: None """ super(TestContacts, self).setUp() self.cfg_file = 'tests.tablet.google_fast.conf' self.contacts = ContactsImpl( self.config.read(self.cfg_file, 'wifisetting')) self.account = self.config.read(self.cfg_file, 'gmail_mail').get("sender_account") def tearDown(self): """ @summary: tear tearDown @return: None """ super(TestContacts, self).tearDown() self.contacts = None def testImportFromVcFile(self): """ This test used to test contacts app The test case spec is following: 1. launch contact app 2. import a contact list from a cvf file. """ self.contacts.launch_by_am() self.contacts.jump_add_account_screen() self.contacts.add_a_new_contact("AAAA", self.account) self.contacts.export_contact_list() self.contacts.delete_all_contacts() self.contacts.import_contact_list(self.contacts.vcf_file_name, self.account) self.contacts.import_contact_list_successfully("AAAA") self.contacts.delete_a_contact("AAAA") self.contacts.delete_the_exported_vcf_file(self.contacts.vcf_file_name)
class SeachTest(UIATestBase): """ @summary: Test google search application """ def setUp(self): cfg_file = 'tests.tablet.google_fast.conf' super(SeachTest, self).setUp() self._test_name = __name__ self.search = SearchImpl(\ self.config.read(cfg_file, 'google_search')) self.browser = BrowserImpl(self.config.read(cfg_file, 'browser')) self.contacts = ContactsImpl(self.config.read(cfg_file, 'wifisetting')) print "[Setup]: %s" % self._test_name self.__search_setup() def tearDown(self): print "[Teardown]: %s" % self._test_name self.__search_teardown() super(SeachTest, self).tearDown() def testSearchSuggestion(self): """ This test case is to test search app Test Case Step: 1.Enter search text, verify suggestions displayed and after search results are displayed 2.Click the suggestions link to launch application Expect Result: 1.Verify that users can access to Search, 2.Verify that the searched result with keyword can be shown. """ print "[RunTest]: %s" % self.__str__() app_key = self.search.cfg.get("app_key") check_app = self.search.cfg.get("check_app") web_key = self.search.cfg.get("web_key") check_web = self.search.cfg.get("check_web") contact_key = self.search.cfg.get("contact_key") check_contact = self.search.cfg.get("check_contact") self.search.search(app_key) time.sleep(5) self.search.check_search(check_app) self.search.search(web_key) time.sleep(5) self.search.check_search(check_web) self.search.search(contact_key) time.sleep(5) self.search.check_search(check_contact) def __search_setup(self): """ @summary: setup search function """ website = self.search.cfg.get("check_web") webcheck = self.search.cfg.get("check_webcheck") contact = self.search.cfg.get("check_contact") if website != "" and webcheck != "": self.browser.browser_setup() self.browser.open_website(website) self.browser.web_check(webcheck) if contact != "": self.contacts.contact_add(contact) g_common_obj.back_home() def __search_teardown(self): """ @summary: clear data """ self.search.stop_from_am() self.browser.clear_data()
class SeachLowBatteryTest(UIATestBase): """ @summary: Test google play application """ def setUp(self): cfg_file = 'tests.tablet.google_fast.conf' super(SeachLowBatteryTest, self).setUp() self._test_name = __name__ self.search = SearchImpl(\ self.config.read(cfg_file, 'google_search')) self.browser = BrowserImpl(self.config.read(cfg_file, 'browser')) self.contacts = ContactsImpl(self.config.read(cfg_file, 'contacts')) print "[Setup]: %s" % self._test_name self.__search_setup() def tearDown(self): print "[Teardown]: %s" % self._test_name self.__search_teardown() super(SeachLowBatteryTest, self).tearDown() def testSearchLowBattery(self): """ This test case is to test search while battery low status Test Case Precondition: 1. DUT at battery low status Test Case Step: 1.Launch Search.Verify that users can access to Search, 2.Input some search keyword to search.Verify that the searched result with keyword can be show Expect Result: 1.Verify that users can access to Search, 2.Verify that the searched result with keyword can be shown. """ print "[RunTest]: %s" % self.__str__() search_key = self.search.cfg.get("search_key") check_app = self.search.cfg.get("check_app") check_web = self.search.cfg.get("check_web") check_contact = self.search.cfg.get("check_contact") self.search.search(search_key) self.search.check_search(check_app, check_web, check_contact) def __search_setup(self): """ @summary: setup search function """ website = self.search.cfg.get("check_web") webcheck = self.search.cfg.get("check_webcheck") contact = self.search.cfg.get("check_contact") #check battery low_battery_level = self.search.cfg.get("low_battery_level") self.search.check_low_battery(low_battery_level) if website != "" and webcheck != "": self.browser.browser_setup() self.browser.open_website(website) self.browser.web_check(webcheck) if contact != "": self.contacts.contact_add(contact) g_common_obj.back_home() def __search_teardown(self): """ @summary: clear data """ self.search.stop_from_am() self.browser.clear_data()
class SeachTest(UIATestBase): """ @summary: Test google search application """ def setUp(self): cfg_file = 'tests.tablet.google_fast.conf' super(SeachTest, self).setUp() self._test_name = __name__ self.search = SearchImpl(\ self.config.read(cfg_file, 'google_search')) self.browser = BrowserImpl(self.config.read(cfg_file, 'browser')) self.contacts = ContactsImpl(self.config.read(cfg_file, 'wifisetting')) print "[Setup]: %s" % self._test_name self.__search_setup() def tearDown(self): print "[Teardown]: %s" % self._test_name self.__search_teardown() super(SeachTest, self).tearDown() def testSearchOption(self): """ This test case is to test search app Test Case Step: 1.Google Now: Verify user can opt in in Google Now and Cards are displayed Expect Result: 1.Verify that users can access to Search, 2.Verify that the searched result with keyword can be shown. 3.The search result can link to application """ print "[RunTest]: %s" % self.__str__() app_key = self.search.cfg.get("app_key") check_app = self.search.cfg.get("check_app") web_key = self.search.cfg.get("web_key") check_web = self.search.cfg.get("check_web") contact_key = self.search.cfg.get("contact_key") check_contact = self.search.cfg.get("check_contact") app_package = self.search.cfg.get("app_package") web_package = self.search.cfg.get("web_package") contact_package = self.search.cfg.get("contact_package") self.search.search(app_key) self.search.check_search(check_app) self.search.launch_app_from_search(check_app, app_package) self.search.search(web_key) self.search.check_search(check_web) self.search.launch_app_from_search(check_web, web_package) self.search.search(contact_key) self.search.check_search(check_contact) self.search.launch_app_from_search(check_contact, contact_package) def __search_setup(self): """ @summary: setup search function """ website = self.search.cfg.get("check_web") webcheck = self.search.cfg.get("check_webcheck") contact = self.search.cfg.get("check_contact") if website != "" and webcheck != "": self.browser.browser_setup() self.browser.open_website(website) self.browser.web_check(webcheck) if contact != "": self.contacts.contact_add(contact) #self.wifi.launch_from_am() #self.wifi.turn_off_wifi() g_common_obj.back_home() def __search_teardown(self): """ @summary: clear data """ self.search.stop_from_am() self.browser.clear_data()
class SeachLowMemoryTest(UIATestBase): """ @summary: Test google play application """ def setUp(self): cfg_file = 'tests.tablet.google_fast.conf' super(SeachLowMemoryTest, self).setUp() self._test_name = __name__ self.search = SearchImpl(\ self.config.read(cfg_file, 'google_search')) self.browser = BrowserImpl(self.config.read(cfg_file, 'browser')) self.contacts = ContactsImpl(\ self.config.read(cfg_file, 'contacts')) print "[Setup]: %s" % self._test_name self.__search_setup() def tearDown(self): print "[Teardown]: %s" % self._test_name self.__search_teardown() super(SeachLowMemoryTest, self).tearDown() def testSearchLowMemorry(self): """ This test case is to test search works well when memory is full Test Case Precondition: 1.Full memory card 2.Many contact records exist in DUT memory. 3.Many APK (Contains installed) exist in DUT memory Test Case Step: 1.Launch Search.Verify that users can access to Search and DUT works well when full memory card 2.Input some search keyword to search.Verify that contacts, applications and web items containing the\ keyword would be shown in search result if exist Expect Result: 1.Verify that users can access to Search and DUT works well when full memory card 2.Verify that contacts, applications and web items containing the keyword would be shown in search result if exist """ print "[RunTest]: %s" % self.__str__() search_key = self.search.cfg.get("search_key") check_app = self.search.cfg.get("check_app") check_web = self.search.cfg.get("check_web") check_contact = self.search.cfg.get("check_contact") self.search.search(search_key) self.search.check_search(check_app, check_web, check_contact) def __search_setup(self): """ @summary: setup search function """ website = self.search.cfg.get("check_web") webcheck = self.search.cfg.get("check_webcheck") contact = self.search.cfg.get("check_contact") #fill memory if website != "" and webcheck != "": self.browser.browser_setup() self.browser.open_website(website) self.browser.web_check(webcheck) if contact != "": self.contacts.contact_add(contact) g_common_obj.back_home() def __search_teardown(self): """ @summary: clear data """ #delete fill data self.search.stop_from_am() self.contacts.clear_contact() self.browser.clear_browser()
class TestContacts(UIATestBase): """ @summary: Test Contact functionalities """ def setUp(self): """ @summary: set up @return: None """ super(TestContacts, self).setUp() cfg_file = os.path.join(os.environ.get('TEST_REPO_ROOT', ''), 'tests.tablet.google_fast.contacts.conf') self.contacts = ContactsImpl(self.config.read(cfg_file, 'contacts')) def tearDown(self): """ @summary: tear tearDown @return: None """ super(TestContacts, self).tearDown() self.contacts = None def testContacts(self): """ This test used to test contacts app The test case spec is following: 1. launch contact app 2. import a contact list from a cvf file. """ self.contacts.launch_by_am() self.contacts.jump_add_account_screen() self.contacts.add_a_new_contact("AAAA") self.contacts.export_contact_list() self.contacts.delete_all_contacts() self.contacts.import_contact_list(self.contacts.vcf_file_name) self.contacts.import_contact_list_successfully("AAAA") self.contacts.delete_a_contact("AAAA") self.contacts.delete_the_exproted_vcf_file(self.contacts.vcf_file_name)
def setUp(self): super(CheckContactsAfterGOTA, self).setUp() self._test_name = __name__ self.gota= gotaImpl(self) self.contacts=ContactsImpl() print "[Setup]: %s" % self._test_name