def test_get_performance_measures(self):
        self._insert_contacts()
        if self.testvars["performance"]["verbose"]:
            print "Number of runs: {}".format(self.RUNS)

        for i in range(self.RUNS):
            if self.testvars["performance"]["verbose"]:
                print "Run #{}\n".format(i + 1)
            contacts_app = Contacts(self.marionette)
            contacts_app.launch()
            contacts_app.wait_for_contacts(number_to_wait_for=self.contacts_num)

            # Tap on the first contact, to see its details
            contact_details = contacts_app.contact(self.contacts[0]["givenName"]).tap()
            map(
                self.helpers.store_measures,
                [
                    "list_first_contact_rendered",
                    "list_chunk_contact_rendered",
                    "list_all_contacts_rendered",
                    "details_contact_rendered",
                ],
            )

            if i + 1 < self.RUNS:
                GaiaTestCase.setUp(self)
                self._insert_contacts()
示例#2
0
    def tearDown(self):

        # close the app
        if self.app:
            self.apps.kill(self.app)

        GaiaTestCase.tearDown(self)
示例#3
0
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)

        self.test_num = ["666666666666", "555555555555"]
        self.test_contacts = [MockContact(tel={'type': 'Mobile',
                                                'value': self.test_num[i]}) for i in range(2)]

        self.test_contacts[0]["givenName"] = "LongGivennamexxxxxxxxxxx"
        self.test_contacts[1]["familyName"] = "LongFamilynamexxxxxxxxxxx"
        """
        This has to be done due to a MockContact malfunction. It does not
        update the name field to the specified values of givenName and familyName
        """

        for c in self.test_contacts:
            c["name"] = c["givenName"] + " " + c["familyName"]

        map(self.UTILS.general.insertContact, self.test_contacts)

        self.dialer.launch()
        self.dialer.callLog_clearAll()

        for contact in self.test_contacts:
            self.dialer.createMultipleCallLogEntries(contact["tel"]["value"], 2)
        self.dialer.open_call_log()
    def setUp(self):
        GaiaTestCase.setUp(self)

        # add multiple photos to storage
        self.push_resource('image_formats/01.jpg')
        self.push_resource('image_formats/02.png')
        self.push_resource('image_formats/03.gif')
示例#5
0
    def tearDown(self):

        # close the app
        if hasattr(self, 'app'):
            self.apps.kill(self.app)

        GaiaTestCase.tearDown(self)
示例#6
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.contacts   = Contacts(self)
        self.messages   = Messages(self)
        

        #
        # Prepare the contact we're going to insert.
        #
        self.contact_1 = MockContacts().Contact_longName

        #
        # Establish which phone number to use.
        #
        self.contact_1["tel"]["value"] = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.UTILS.logComment("Using target telephone number " + self.contact_1["tel"]["value"])
        
        #
        # Add this contact (quick'n'dirty method - we're just testing sms, no adding a contact).
        #
        self.data_layer.insert_contact(self.contact_1)
示例#7
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.scenario = "scenarios/urls/multiple/available/diff_day/idb"
        self.aux_files_dir = self.UTILS.general.get_config_variable("aux_files", "loop")
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        # Insert our test contacts
        number_of_contacts = 3
        contact_given = "Test"
        contact_family = map(str, range(1, number_of_contacts + 1))
        contact_name = ["{} {}".format(contact_given, contact_family[i])
                        for i in range(number_of_contacts)]
        contact_numbers = ["666666666666", "777777777777", "888888888888"]

        test_contacts = [MockContact(name=contact_name[i], givenName=contact_given,
                                     familyName=contact_family[i],
                                     tel={'type': 'Mobile', 'value': contact_numbers[i]})
                         for i in range(number_of_contacts)]
        map(self.UTILS.general.insertContact, test_contacts)

        self.loop.initial_test_checks()

        # Make sure we're not logged in FxA
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.apps.launch('Calendar')

        # Switch to top level frame before starting the test
        self.marionette.switch_to_frame()
示例#9
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.contacts   = AppContacts(self)
        self.messages   = AppMessages(self)
        
        self.marionette.set_search_timeout(50)
        self.lockscreen.unlock()

        self.data_layer.set_setting("vibration.enabled", True)
        self.data_layer.set_setting("audio.volume.notification", 0)

        #
        # Prepare the contact we're going to insert.
        #
        self.contact_1 = MockContacts().Roy

        #
        # Establish which phone number to use.
        #
        self.contact_1["tel"]["value"] = self.UTILS.get_os_variable("TEST_SMS_NUM", "Mobile number for SMS tests (test 9)")
        self.UTILS.logComment("Using target telephone number " + self.contact_1["tel"]["value"])
        
        #
        # Add this contact (quick'n'dirty method - we're just testing sms, no adding a contact).
        #
        self.data_layer.insert_contact(self.contact_1)
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.contact = MockContact()

        # launch the Phone app
        self.phone = Phone(self.marionette)
        self.phone.launch()
示例#11
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.cards_view = CardsView(self.marionette)

        # Launch the Clock app as a basic, reliable
        # app to test against in Cards View
        self.app = self.apps.launch(self._app_under_test)
示例#12
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name': 'packagedapp1',
            'url': self.marionette.absolute_url('webapps/packaged1/manifest.webapp'),
            'title': 'Packaged app1'}

        # Install app
        self.marionette.execute_script(
            'navigator.mozApps.installPackage("%s")' % self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        # Wait for the notification to disappear
        system = System(self.marionette)
        system.wait_for_system_banner_displayed()
        system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])
    def setUp(self):
        try:
            self.testvars['plivo']
        except KeyError:
            raise SkipTest('Plivo account details not present in test variables')

        GaiaTestCase.setUp(self)
示例#15
0
    def setUp(self):
        print "setUp - start"
        GaiaTestCase.setUp(self)

        print "setUp - about to lock"
        # Make sure the lock screen is up
        self.device.lock()

        # Make sure the screen brightness is full on, with auto turned off
        # Volume level adjust to 9 and turn on airplane mode
        self.data_layer.set_setting("screen.automatic-brightness", False)
        self.data_layer.set_setting("screen.brightness", 1.0)
        self.data_layer.set_setting("audio.volume.content", 9)
        self.data_layer.set_setting("airplaneMode.enabled", True)

        # Make sure USB charging is turned off
        cmd = []
        cmd.append("adb")
        cmd.append("shell")
        cmd.append("echo 0 > /sys/class/power_supply/battery/charging_enabled")
        subprocess.Popen(cmd)
        
        # Set up the ammeter
        self.ammeterFields = ('current','voltage','time')
        serialPortName = None #we want powertool to figure out the port...
        self.ammeter = MozillaAmmeter(serialPortName, False)

        # Grab a sample, and calculate the timer offset from ammeter time to wall clock time
        sample = self.ammeter.getSample(self.ammeterFields)
        sampleTimeAfterEpochOffset = time.time()
        firstSampleMsCounter = sample['time'].value
        self.sampleTimeEpochOffset = int(sampleTimeAfterEpochOffset * 1000.0) - firstSampleMsCounter;

        print "setUp - done"
示例#16
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

        self.apps.kill_all()
        time.sleep(2)

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")
示例#17
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.messages   = AppMessages(self)
        
        self.marionette.set_search_timeout(50)
        self.lockscreen.unlock()
        
        #
        # Change the settings to vibration only (backdoor method since
        # this isn't what we're testing).
        #
        self.data_layer.set_setting("vibration.enabled", True)
        self.data_layer.set_setting("audio.volume.notification", 0)
        
        #
        # Remove number and add contact.
        #
        self.telNum = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.UTILS.logComment("Sending sms to telephone number " + self.telNum)

        self.UTILS.setTimeToNow()
示例#18
0
    def setUp(self):

        GaiaTestCase.setUp(self)

        self.phone = Phone(self.marionette)
        self.phone.launch()

        current_time = repr(time.time()).replace('.', '')
        self.phone_number_1 = '555%s' % current_time[-7:]
        self.phone_number_2 = '444%s' % current_time[-7:]

        self.yesterday_date = date.fromordinal(date.today().toordinal()-1)
        self.past_date_1 = date(2014, 12, 01)
        self.past_date_2 = date(2013, 12, 01)

        self.data_layer.insert_call_entry(MockCall(phone_number=self.phone_number_1))
        self.data_layer.insert_call_entry(MockCall(phone_number=self.phone_number_2))

        self.data_layer.insert_call_entry(MockCall(phone_number=self.phone_number_1, date=self.yesterday_date))

        self.data_layer.insert_call_entry(MockCall(phone_number=self.phone_number_1, date=self.past_date_1))
        self.data_layer.insert_call_entry(MockCall(phone_number=self.phone_number_2, date=self.past_date_1))
        self.data_layer.insert_call_entry(MockCall(phone_number=self.phone_number_2, date=self.past_date_1))

        self.data_layer.insert_call_entry(MockCall(phone_number=self.phone_number_1, date=self.past_date_2))
示例#19
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.contacts   = Contacts(self)
        self.messages   = Messages(self)
        
        #
        # Prepare the contact we're going to insert.
        #
        self.contact_1 = MockContacts().Contact_1

        #
        # Set given and family name to empty string
        #
        self.contact_1["givenName"] = ""
        self.contact_1["familyName"] = ""
        self.contact_1["name"] = "" 
        self.contact_1["tel"]["value"] = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        
        #
        # Import this contact (quick'n'dirty method - we're just testing sms, no adding a contact).
        #
        self.data_layer.insert_contact(self.contact_1)
    def tearDown(self):

        # In case the assertion fails this will still kill the call
        # An open call creates problems for future tests
        self.data_layer.kill_active_call()

        GaiaTestCase.tearDown(self)
    def tearDown(self):

        # TODO flush any settings set by the FTU app

        self.data_layer.disable_wifi()

        GaiaTestCase.tearDown(self)
示例#22
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name':
            'packagedapp1',
            'url':
            self.marionette.absolute_url('webapps/packaged1/manifest.webapp'),
            'title':
            'Packaged app1'
        }

        # Install app so we can delete it
        self.marionette.execute_script(
            'navigator.mozApps.installPackage("%s")' % self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])
示例#23
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # launch the First Time User app
        self.app = self.apps.launch('FTU')

        self.wait_for_condition(lambda m: self.data_layer.is_wifi_enabled)
示例#24
0
 def setUp(self):
     #
     # Set up child objects...
     #
     GaiaTestCase.setUp(self)
     self.UTILS      = UTILS(self)
     self.Browser    = AppBrowser(self)
示例#25
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.data_layer.set_setting('devtools.qps.enabled', True)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
示例#26
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.contacts = Contacts(self)
        self.settings = Settings(self)
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.target_name = "QA"
        self.test_contacts = [MockContact() for i in range(3)]
        self.test_contacts[0]["givenName"] = self.target_name
        self.test_contacts[0]["familyName"] = "Automation"
        self.test_contacts[0]["name"] = "{} {}".format(
            self.test_contacts[0]["givenName"], self.test_contacts[0]["familyName"])
        map(self.UTILS.general.insertContact, self.test_contacts)
    
        self.contacts.launch()
        self._add_contact_as_favorite(self.test_contacts[0])

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)
    def tearDown(self):
        # remove the station from favorite list
        self.wait_for_element_displayed(*self._favorite_remove_locator)
        favorite_remove = self.marionette.find_element(*self._favorite_remove_locator)
        self.marionette.tap(favorite_remove)

        GaiaTestCase.tearDown(self)
示例#28
0
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)
        self.contacts = Contacts(self)

        self.test_contact = MockContact(tel={'type': 'Mobile', 'value': "665666666"})

        # Generate an entry in the call log
        self.dialer.launch()
        self.dialer.callLog_clearAll()
        self.dialer.createMultipleCallLogEntries(self.test_contact["tel"]["value"], 1)

        # Create contact with image
        self.UTILS.general.add_file_to_device('./tests/_resources/contact_face.jpg')
        self.dialer.callLog_createContact(self.test_contact["tel"]["value"])

        contFields = self.contacts.get_contact_fields()
        self.contacts.replace_str(contFields['givenName'], self.test_contact["givenName"])
        self.contacts.replace_str(contFields['familyName'], self.test_contact["familyName"])

        self.contacts.add_gallery_image_to_contact(0)
        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
        done_button.tap()

        time.sleep(1)
        self.apps.kill_all()
        time.sleep(2)
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        import time
        curr_time = repr(time.time()).replace('.', '')
        self.bookmark_title = 'gaia%s' % curr_time[10:]
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()

        self.views = {
            'time_views': self.marionette.find_element(*self.calendar._time_views_locator),
            'current_day': self.marionette.find_element(
                *self.calendar._current_months_day_locator),
            'month': self.marionette.find_element(
                *self.calendar._current_monthly_calendar_locator),
            'day': self.marionette.find_element(*self.calendar._day_view_locator),
            'week': self.marionette.find_element(*self.calendar._week_view_locator),
            'settings': self.marionette.find_element(*self.calendar._settings_locator),
            'advanced_settings': self.marionette.find_element(
                *self.calendar._advanced_settings_view_locator),
            'modify_event': self.marionette.find_element(*self.calendar._modify_event_view_locator),
            'event': self.marionette.find_element(*self.calendar._event_view_locator),
            'create_account': self.marionette.find_element(
                *self.calendar._create_account_view_locator),
            'modify_account': self.marionette.find_element(
                *self.calendar._modify_account_view_locator)
        }

        self.event_title = 'title'
        new_event = self.calendar.a11y_click_add_event_button()
        # create a new event
        new_event.a11y_fill_event_title(self.event_title)
        new_event.a11y_click_save_event()
        self.calendar.wait_for_events(1)
示例#31
0
 def tearDown(self):
     GaiaTestCase.tearDown(self)
     """At the end of test execution, it checks for the errors"""
     self.assertTrue(self.test_passed, msg=self.failcomment)
示例#32
0
 def tearDown(self):
     self.UTILS.reporting.reportResults()
     GaiaTestCase.tearDown(self)
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.data_layer.connect_to_cell_data()
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.data_layer.disable_wifi()
     self.data_layer.connect_to_cell_data()
     self.data_layer.connect_to_wifi()
     self.data_layer.set_setting('geolocation.enabled', 'true')
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.system = System(self.marionette)
示例#36
0
    def tearDown(self):
        if self.app_installed:
            self.delete_bookmark(self.first_app_name)

        GaiaTestCase.tearDown(self)
示例#37
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()
示例#38
0
 def setUp(self):
     GaiaTestCase.setUp(self)
示例#39
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # launch the app
        self.app = self.apps.launch('Phone')
示例#40
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.device_name = self.marionette.session_capabilities.get(
         'device', 'unknown')
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.apps.set_permission_by_url(Search.manifest_url, 'geolocation',
                                     'deny')
示例#42
0
    def tearDown(self):

        self.apps.kill_all()
        GaiaTestCase.tearDown(self)
示例#43
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.apps.set_permission('Homescreen', 'geolocation', 'deny')
     self.connect_to_network()
示例#44
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.connect_to_local_area_network()
示例#45
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # launch the FM Radio app
        self.fm_radio = FmRadio(self.marionette)
        self.fm_radio.launch()
示例#46
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.settings = Settings(self.marionette)
        self.settings.launch()
示例#47
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
示例#48
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.clock = Clock(self.marionette)
        self.clock.launch()
示例#49
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.push_resource('MUS_0001.ogg')
示例#50
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        self.contact = MockContact()
示例#51
0
 def tearDown(self):
     self.data_layer.set_int_pref('dom.requestSync.minInterval', 100)
     GaiaTestCase.tearDown(self)
示例#52
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # Turn off geolocation prompt
        self.apps.set_permission('Camera', 'geolocation', 'deny')
示例#53
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.gallery = Gallery(self)

        self.length = len(self.img_list)
示例#54
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.apps.set_permission('UI tests - Privileged App',
                              'device-storage:sdcard-read', 'prompt')
示例#55
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.apps.set_permission('Camera', 'geolocation', 'deny')
     self.device.lock()
示例#56
0
 def tearDown(self):
     self.UTILS.general.remove_files()
     self.UTILS.reporting.reportResults()
     GaiaTestCase.tearDown(self)
示例#57
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.UTILS = UTILS(self)
     self.contacts = Contacts(self)
     self.messages = Messages(self)
 def setUp(self):
     GaiaTestCase.setUp(self)
     # Set idle timeout to 1 seconds.
     self.data_layer.set_setting('screen.timeout', 1)
示例#59
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.data_layer.set_setting('search.suggestions.enabled', True)
    def tearDown(self):
        # delete any existing alarms
        self.data_layer.delete_all_alarms()

        GaiaTestCase.tearDown(self)