Exemple #1
0
    def openBrowser(self, wifi):
        u.openWifi(d, wifi)
        
        #Launch browser and check if launch sucessful
        d.start_activity(component='com.android.browser/.BrowserActivity')
        assert d(className='android.widget.ImageButton', index=3).wait.exists(timeout=5000), 'Launch browser failed in 5s'

        #Open a new page
        #and go to www.qq.com
        d(className='android.widget.ImageButton', index=3).click.wait()
        assert d(text="Bookmarks").wait.exists(timeout=3000), 'Open new page failed in 3s'
        d(className='android.widget.EditText').set_text('wap.qq.com')
        d.press('enter')

        #Sleep 15s to wait loading web page
        u.sleep(15)
        flag = True
        i = 0
        while(flag and i < 9):
            i = i + 1
            d.swipe(400, 1000, 400, 500, steps=6)
            u.sleep(5)
            if not d.find('browser_blank.png'):
                flag = False
        if flag:
            assert False, 'Open the web page failed in 60s.'
        else:
            assert True
    def testAddingPlaceEventToGroup(self):
        self._checkResource()
        self._launchGallery()
        d.swipe(360, 780, 361, 781) #Long click the album
        assert d(text = '1 selected').wait.exists(timeout = 2000) #Check whether the album has been highlighted
        #Edit place for album
        d(description = 'More options').click.wait()
        assert d(text = 'Edit Place').wait.exists(timeout = 2000)
        d(text = 'Edit Place').click.wait()
        d(text = 'Enter new venue').set_text('RNB01') #Input place info
        self._clickDoneButton()

        d.swipe(360, 780, 361, 781) #Long click the album

        #Edit event for album
        d(description = 'More options').click.wait()
        assert d(text = 'Edit Event').wait.exists(timeout = 2000)
        d(text = 'Edit Event').click.wait()
        d(text = 'Enter new event').set_text('Sprint Review') #Input event info
        self._clickDoneButton()
        #Check place and event
        self._enterSingleView()
        self._showPopupCard()
        d.click(350,1100) #Tap on pop up card bar to invoke it
        assert d(text = 'RNB01').wait.exists(timeout = 2000)
        assert d(text = 'Sprint Review').wait.exists(timeout = 2000)
 def testCreateAnimateGIF(self):
     self._checkResource()
     self._launchGallery()
     self._enterGridView()
     d.swipe(390, 280, 391, 281) #Long click the first picture on second row
     #This will run 3 circles, means select the second, the third and the fouth pic on second row
     for y in range(530, 1100, 250): #530 = 280 + 250, that means the second pic on second row
         d.click(390, y)
     d(description = 'More options').click.wait() #Tap on the extra menu
     assert d(text = 'Animate').wait.exists(timeout = 2000)
     d(text = 'Animate').click.wait() #Try to convert the selected pictures to an animate
     assert d(text = 'Animated GIF').wait.exists(timeout = 3000), 'Animate does not pop up in 3s'
     d(text = 'Animated GIF').click.wait() #Select Video to convert
     assert d(text = 'Speed').wait.exists(timeout = 2000)
     #Count has been changed, so get count before converting here
     before = commands.getoutput(GET_CONVERT_COUNT) #Count before creating animate
     d(text = 'Create').click.wait() #Tap on create button
     time.sleep(5) #This action may take a few seconds, but faster than video
     assert d(text = 'Save').wait.exists(timeout = 2000), 'Converting does not complete in 7s'
     #Save and check
     d(text = 'Save').click.wait() #Save the animate
     time.sleep(5) #Saving action    
     after = commands.getoutput(GET_CONVERT_COUNT) #Count after creating animate
     if string.atoi(before) == string.atoi(after) - 1 or string.atoi(before) == string.atoi(after) - 2:
         pass
     else:
         self.fail('Converting picture failed.')
 def testSearchByKeyword(self):
     self._checkResource()
     self._launchGallery()
     self._enterSingleView()
     self._showPopupCard()
     d.click(350,1100) #Tap on pop up card bar to invoke it
     assert d(text = 'Facebook').wait.exists(timeout = 2000), 'Details has not pop up'
     d.swipe(350,1100,350,350) #Pull up pop up card to show more details
     assert d(resourceId = 'com.intel.android.gallery3d:id/addKeywordButton').wait.exists(timeout = 2000), 'Keywords has not shown in details'
     d(resourceId = 'com.intel.android.gallery3d:id/addKeywordButton').click.wait() #Tap on add keywords
     d(text = 'Enter new keyword').set_text('NewKeyword') #Input keywords content
     self._clickDoneButton()
     assert d(text = 'NewKeyword').wait.exists(timeout = 2000), 'Add keywords failed'
     #Search by keyword
     d.press('back') #Back to the grid view
     time.sleep(2)
     d.press('back') #Back to the album view
     assert d(description = 'Search').wait.exists(timeout = 2000), 'It has not back to the album view'
     d(description = 'Search').click.wait()
     assert d(resourceId = 'com.intel.android.gallery3d:id/search_src_text').wait.exists(timeout = 2000)
     d(resourceId = 'com.intel.android.gallery3d:id/search_src_text').set_text('NewKeyword')
     d.expect('Search_Result_Item.png')
     #Check the search result
     d(resourceId = 'com.intel.android.gallery3d:id/searchedText').click.wait()
     assert d(text = 'NewKeyword').wait.exists(timeout = 2000)
 def testRotatePictures(self):
     self._checkResource()
     self._launchGallery()
     self._enterSingleView()
     self._showPopupCard()
     d.press('menu')
     d(text = 'Rotate left').click.wait() #Rotate to left
     time.sleep(2)
     d.press('menu')
     d(text = 'Rotate right').click.wait()
     time.sleep(2)
     d.press('back')
     assert d(description = 'Search').wait.exists(timeout = 2000), 'It does not back to the grid view' #Back to the grid view
     d.swipe(370, 590, 371, 591) #Long click the picture in the center
     time.sleep(2)
     #Prepare to rotate to left
     assert d(text = '1 selected').wait.exists(timeout = 2000), 'It does not in select view'
     d(text = '1 selected').click.wait()
     assert d(text = 'Select all').wait.exists(timeout = 2000)
     d(text = 'Select all').click.wait()
     d(description = 'More options').click.wait() #Press menu key
     d(text = 'Rotate left').click.wait() #Rotate to left
     time.sleep(2)
     #Prepare to rotate to right
     d.swipe(370, 590, 371, 591) #Long click the picture in the center
     time.sleep(2)
     assert d(text = '1 selected').wait.exists(timeout = 2000), 'It does not in select view'
     d(text = '1 selected').click.wait()
     assert d(text = 'Select all').wait.exists(timeout = 2000)
     d(text = 'Select all').click.wait()
     d(description = 'More options').click.wait() #Press menu key
     d(text = 'Rotate right').click.wait() #Rotate to right
     time.sleep(2)
     assert d(resourceId = 'com.intel.android.gallery3d:id/action_camera').wait.exists(timeout = 5000)
Exemple #6
0
    def setCameraSetting(self,mode,sub_mode,option):
        '''
        This method is used to set camera to one mode, sub-mode, and do any operate of this sub-mode.
        7 = Max element count in screen.
        2 = Length of settings - Max screen count


        Please input index number as sub_mode, input index number of options as option
        Such as:
        setCameraSetting('single',3,2)
        'single' means mode
        3 means the index number of Location in sub_mode list
        2 means the index number of Location off option in options list
        '''
    
        settings = MODE[mode]
        if sub_mode== 'flash':
            self._setFlashMode(option)
        elif sub_mode == 'fdfr':
            self._setFDFRMode(option)
        else:
            d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
            if sub_mode <= 7:
                d(resourceId = HORI_LIST_BUTTON)[sub_mode-1].click.wait()
                if len(settings) >= 7:
                    d(resourceId = HORI_LIST_BUTTON)[option+7-1].click.wait()
                else:
                    d(resourceId = HORI_LIST_BUTTON)[option+len(settings)-1].click.wait()
            else:
                d.swipe(680,180,100,180)
                d(resourceId = HORI_LIST_BUTTON)[sub_mode-2-1].click.wait()
                d(resourceId = HORI_LIST_BUTTON)[option+7-1].click.wait()
Exemple #7
0
    def testBaidumaps(self):
        #Check and set wifi
        u.openWifi(d, True)

        #Launch Baidu map app
        d.start_activity(component='com.baidu.BaiduMap/com.baidu.baidumaps.WelcomeScreen')

        if d(text='不要福利').wait.exists(timeout=5000):
            d(text='不要福利').click.wait()
        if d(text='以后再说').wait.exists(timeout=5000):
            d(text='以后再说').click.wait()
        if d(text='以后再说').wait.exists(timeout=2000):
            d(text='以后再说').click.wait()

        #Check if baidu map can be launched successfully
        assert d(text='附近').wait.exists(timeout=10000), 'No enter main map activity'
        assert d(text='路线').wait.exists(timeout=2000), 'No enter main map activity'

        #Swipe on the map
        d.swipe(340, 340, 340, 900, steps=5)

        #Locate to current location
        d.expect('location.png')
        d.click('location.png')

        #Located successful
        assert d(text='我的位置').wait.exists(timeout=3000), 'can not locate'
Exemple #8
0
 def shareItem(self, shareto=None):
     '''
         The function simulate user sharing items in gallery.
         Usage:
             If you want to share item with Facebook(this item at the bottom of the share list as default)
             
             -> shareItem('Facebook')
             
             *Do not write press menu/share icon step(s) before using
     '''
     d(description='Share').click.wait(
     )  #Its description is 'Share' in each view
     if shareto != None:
         try:
             assert d(text=shareto).wait.exists(timeout=2000)
         except:
             d(text='See all').click.wait()  #Display all share path
         finally:
             try:
                 assert d(text=shareto).wait.exists(timeout=2000)
             except:
                 d.swipe(500, 1050, 500, 200)  #Slide share list up
             finally:
                 d(text=shareto).click.wait(
                 )  #Tap on the path you want to share to
Exemple #9
0
    def setCameraSetting(self, mode, sub_mode, option):
        '''
        This method is used to set camera to one mode, sub-mode, and do any operate of this sub-mode.
        7 = Max element count in screen.
        2 = Length of settings - Max screen count


        Please input index number as sub_mode, input index number of options as option
        Such as:
        setCameraSetting('single',3,2)
        'single' means mode
        3 means the index number of Location in sub_mode list
        2 means the index number of Location off option in options list
        '''

        settings = MODE[mode]
        if sub_mode > 8:
            return False
        if sub_mode == 'flash':
            _setFlashMode(option)
        else:
            d(resourceId='com.intel.camera22:id/left_menus_camera_setting'
              ).click.wait(timeout=2000)
            if sub_mode <= 7:
                d(resourceId=HORI_LIST_BUTTON)[sub_mode - 1].click.wait()
                if len(settings) >= 7:
                    d(resourceId=HORI_LIST_BUTTON)[option + 7 - 1].click.wait()
                else:
                    d(resourceId=HORI_LIST_BUTTON)[option + len(settings) -
                                                   1].click.wait()
            else:
                d.swipe(680, 180, 100, 180)
                d(resourceId=HORI_LIST_BUTTON)[sub_mode - 2 - 1].click.wait()
                d(resourceId=HORI_LIST_BUTTON)[option + 7 - 1].click.wait()
            return True
    def _editImage(self,bottombutton,suboption,cropscale=None):
        '''
            You need just know the NO. of the wanted option, e.g.:
                you want to set an image as 'Hue' in 'Colors',

                -> _editImage('colors',9)

                *Hue is NO.9 in the option list
                *An exception, if you set something in geometry(3rd button on the bottom), you may use func like:

                -> _editImage('geometry','crop')

                *You could just use the string shows on screen

            Comparison Table:

                NO.| bottombutton | suboption            | cropscale
            -------+--------------+----------------------+---------------------
                1. | fx           | int 1 ~ 10           |
                2. | border       | int 1 ~ 7            |
                3. | geometry     | str straighten       |
                   |              |     crop             | str 1:1
                   |              |                      |     4:3
                   |              |                      |     3:4
                   |              |                      |     5:7
                   |              |                      |     7:5
                   |              |                      |     None
                   |              |                      |     Original
                   |              |     rotate           |
                   |              |     flip (*'Mirror') |
                4. | colors       | int 1 ~ 11           |
            -------+--------------+----------------------+---------------------

        '''
        u.setMenuOptions('Edit')
        #Click bottom button
        d(resourceId = 'com.intel.android.gallery3d:id/%sButton'%bottombutton).click.wait()
        if bottombutton == 'geometry':
            d(resourceId = 'com.intel.android.gallery3d:id/%sButton'%suboption).click.wait()
        else:
            if suboption < 6:
                d(index = suboption-1,focusable = 'false',clickable = 'true').click.wait()
                #d.click(XITEM + XUNIT * (suboption - 1), YSUB)
            elif suboption == 11:
                d.swipe(XMAX-1, YSUB, 0, YSUB, 5) #Swipe to the end
                #d.click(XITEM + XUNIT * 4, YSUB)
                d(index = suboption-1,focusable = 'false',clickable = 'true').click.wait()
            else:
                d.swipe(XMAX-1, YSUB, 0, YSUB, 60) #Swipe the 5th item to the 0 position(out of screen)
                #d.click(XITEM + XUNIT * (suboption - ITEMCOUNT - 1), YSUB)
                d(index = suboption-1,focusable = 'false',clickable = 'true').click.wait()
        #When croping image, there are some expend options
        if cropscale != None:
            d(resourceId = 'com.intel.android.gallery3d:id/aspect').click.wait()
            d(text = cropscale).click.wait()
        #Some effect may need user's applying
        if d(text = 'Apply').wait.exists(timeout = 2000):
            d(text = 'Apply').click.wait()
        #Save the changed image
        d(text = 'SAVE').click.wait()
 def testSharePerfectShotUsingGmail(self):
     self._deleteAllPictures()
     self._takePicUnderPerfectMode()
     self._launchGallery()
     self._enterSingleView()
     self._showPopupCard()
     #Tap on share icon
     d(description = 'Share').click.wait()
     assert d(text = 'See all').wait.exists(timeout = 2000), 'Share options does not pop up in 2s'
     d(text = 'See all').click.wait() #List all share options
     #When share picture via Gmail, it may locate at the end of the option list
     try:
         assert d(text = 'Gmail').wait.exists(timeout = 2000)
     except:
         d.swipe(600, 800, 600, 300)
     finally:
         d(text = 'Gmail').click.wait()
     #Check if composing  interface display
     assert d(description = 'Send').wait.exists(timeout = 5000), 'Share picture to Gmail failed'
     #Discard the sharing item
     d.press('menu')
     assert d(text = 'Discard').wait.exists(timeout = 2000) #Check if menu list pop up
     d(text = 'Discard').click.wait() #Click discard in menu list
     assert d(text = 'Discard this message?').wait.exists(timeout = 2000)
     d(text = 'Discard').click.wait() #Click discard when confirm
 def testTagOnePicture(self):
     u.setMenuOptions('Details')
     for i in range(100):
         d.swipe(500,1050,500,200) #Swipe detail list up
         d(resourceId = 'com.intel.android.gallery3d:id/addKeywordButton').click.wait()
         d(text = 'Enter new keyword').click.wait() #Make sure keyboard has been invoked
         d(text = 'Enter new keyword').set_text('NewKeyword')
         self._tapOnDoneButton()
         assert d(text = 'NewKeyword',className = 'android.widget.TextView').wait.exists(timeout = 2000)
 def testCardpopDetails(self):
     self._checkResource()
     self._launchGallery()
     self._enterSingleView()
     self._showPopupCard()
     d.swipe(350,1100,350,350) #Pull pop up card up
     assert d(text = 'Facebook').wait.exists(timeout = 2000), 'Pop up card has not been pulled up'
     d.swipe(350,1100,350,350) #Pull up second time to show details
     assert d(text = 'Advanced photo details').wait.exists(timeout = 2000), 'Details in pop up card does not shown'
Exemple #14
0
 def _DtakePicture(self):
     self._ClearData()
     d.swipe(363, 1145, 359, 1045, steps=600)
     time.sleep(2)
     after = commands.getoutput('adb shell ls /sdcard/DCIM/100ANDRO/* | grep jpg | wc -l')
     time.sleep(3)
     if string.atoi(after) > 10:
         print('take picture success!')
     else:
         self.fail('take picture fail!')
Exemple #15
0
 def selectPictueWhenEditBurst(self, imagesSelect):
     #Could display 5 pictures on selection bar at most, when the count of image selected bigger than 5, need swipe
     x = 70  #The abscissa of the first picture
     while imagesSelect > 0:
         d.click(x, 250)
         time.sleep(1)  #Sometimes case failed if tap action is too fast
         x = x + 150  #The gap between two pictures are 150 pix
         if x > 700:  #The left boundry of the fifth image, so if abscissa over than 600, need swipe
             d.swipe(650, 250, 1, 250, steps=5)
             time.sleep(1)
             x = 70  #Reset the first abscissa
         imagesSelect = imagesSelect - 1
 def selectPictueWhenEditBurst(self, imagesSelect):
     # Could display 5 pictures on selection bar at most, when the count of image selected bigger than 5, need swipe
     x = 70  # The abscissa of the first picture
     while imagesSelect > 0:
         d.click(x, 250)
         time.sleep(1)  # Sometimes case failed if tap action is too fast
         x = x + 150  # The gap between two pictures are 150 pix
         if x > 700:  # The left boundry of the fifth image, so if abscissa over than 600, need swipe
             d.swipe(650, 250, 1, 250, steps=5)
             time.sleep(1)
             x = 70  # Reset the first abscissa
         imagesSelect = imagesSelect - 1
Exemple #17
0
 def _setSingleCameraSetting(self,setting,option):
     if setting == 'flash':
         d(resourceId = 'com.intel.camera22:id/left_menus_flash_setting').click.wait()
         d(resourceId = 'com.intel.camera22:id/hori_list_button')[FLASH_SETTING.index(option)].click.wait()
     else:
         d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
         if SINGLE_SETTING.index(setting)<=6:        # 6 is the max index element in the screen
             d(resourceId = 'com.intel.camera22:id/hori_list_button')[SINGLE_SETTING.index(setting)].click.wait()
             d(resourceId = 'com.intel.camera22:id/hori_list_button')[OPTION[setting].index(option)+7].click.wait()
         else:
             d.swipe(680,180,100,180)
             d(resourceId = 'com.intel.camera22:id/hori_list_button')[SINGLE_SETTING.index(setting)-2].click.wait()
             d(resourceId = 'com.intel.camera22:id/hori_list_button')[OPTION[setting].index(option)+7].click.wait()                
 def testCopyingImagesFromExternalSource(self):
     self._checkResource()
     self._launchGallery()
     self._enterGridView()
     d.swipe(390, 280, 391, 281) #Long click the first picture on second row
     #Check if select one pic is success
     assert d(text = '1 selected').wait.exists(timeout = 2000)
     #Select all pic and get the count
     d(text = '1 selected').click.wait()
     assert d(text = 'Select all').wait.exists(timeout = 2000)
     d(text = 'Select all').click.wait()
     #Check count for all selected items on UI
     assert d(text = '20 selected').wait.exists(timeout = 2000)
Exemple #19
0
 def _setPictureSizeStatus(self,status):
     #commands.getoutput('adb shell input swipe 530 6 523 22')
     d.swipe(530,6,523,22)
     d(description = 'Camera settings').click.wait()
     #.d()
     if status == 'WideScreen':
         d.click(60,292)
     elif status == 'StandardScreen':
         d.click(180,292)
     state = commands.getoutput()
     statevalue = state.find(status)
     if statevalue == -1:
         self.fail('set camera picture size to' + status +'fail!')
Exemple #20
0
 def _setPictureSizeStatus(self, status):
     #commands.getoutput('adb shell input swipe 530 6 523 22')
     d.swipe(530, 6, 523, 22)
     d(description='Camera settings').click.wait()
     #.d()
     if status == 'WideScreen':
         d.click(60, 292)
     elif status == 'StandardScreen':
         d.click(180, 292)
     state = commands.getoutput()
     statevalue = state.find(status)
     if statevalue == -1:
         self.fail('set camera picture size to' + status + 'fail!')
Exemple #21
0
def setCameraSetting(mode,setting,option):
    settings = MODE[mode][0]
    options = MODE[mode][1]
    if setting == 'flash':
        _setFlashMode(option)
    else:
        d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
        if SINGLE_SETTING.index(setting)<=len(settings):        # 6 is the max index element in the screen
            d(resourceId = HORI_LIST_BUTTON)[settings.index(setting)].click.wait()
            d(resourceId = HORI_LIST_BUTTON)[options[setting].index(option)+len(settings)].click.wait()
        else:
            d.swipe(680,180,100,180)
            d(resourceId = HORI_LIST_BUTTON)[settings.index(setting)-2].click.wait()
            d(resourceId = HORI_LIST_BUTTON)[options[setting].index(option)+len(settings)].click.wait()


# def setSmileCameraSetting(setting,option):
#     if setting == 'flash':
#         _setFlashMode(option)
#     else:
#         d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
#         d(resourceId = HORI_LIST_BUTTON)[SMILE_SETTING.index(setting)].click.wait()
#         d(resourceId = HORI_LIST_BUTTON)[SMILE_OPTION[setting].index(option)+len(SMILE_SETTING)].click.wait()

# def setHDRCameraSetting(setting,option):
#     d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
#     d(resourceId = HORI_LIST_BUTTON)[HDR_SETTING.index(setting)].click.wait()
#     d(resourceId = HORI_LIST_BUTTON)[HDR_OPTION[setting].index(option)+len(HDR_SETTING)].click.wait()

# def setVideoCameraSetting(setting,option):
#     if setting == 'flash':
#         _setFlashMode(option)
#     else:
#         d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
#         d(resourceId = HORI_LIST_BUTTON)[SMILE_SETTING.index(setting)].click.wait()
#         d(resourceId = HORI_LIST_BUTTON)[SMILE_OPTION[setting].index(option)+len(SMILE_SETTING)].click.wait()

# def setBurstCameraSetting(setting,option):
#     d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
#     d(resourceId = HORI_LIST_BUTTON)[BURST_SETTING.index(setting)].click.wait()
#     d(resourceId = HORI_LIST_BUTTON)[BURST_OPTION[setting].index(option)+len(BURST_SETTING)].click.wait()

# def setPerfectshotCameraSetting(setting,option):
#     d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
#     d(resourceId = HORI_LIST_BUTTON)[PERFECTSHOT_SETTING.index(setting)].click.wait()
#     d(resourceId = HORI_LIST_BUTTON)[PERFECTSHOT_OPTION[setting].index(option)+len(PERFECTSHOT_SETTING)].click.wait()

# def setBurstCameraSetting(setting,option):
#     d(resourceId = 'com.intel.camera22:id/left_menus_camera_setting').click.wait(timeout=2000)
#     d(resourceId = HORI_LIST_BUTTON)[PANORAMA_SETTING.index(setting)].click.wait()
#     d(resourceId = HORI_LIST_BUTTON)[PANORAMA_OPTION[setting].index(option)+len(PANORAMA_SETTING)].click.wait()
Exemple #22
0
 def _CtakeVideo(self):
     result = commands.getoutput('adb shell ls '+DCIM_PATH)
     if result.find(CAMERA_FOLDER) == -1:
         self.logger.info("no 100ANDRO folder.")
         self.beforeNO = '0'
     else:
         self.beforeNO = commands.getoutput('adb shell '+ VIDEO_NUMBERS)
     
     #Record video(30 seconds)
     d.swipe(363, 1145, 359, 1045, steps=100)
     #Identify add video successfully
     addVideo = commands.getoutput('adb shell '+ VIDEO_NUMBERS)
     if string.atoi(addVideo) != string.atoi(self.beforeNO)+1:
         self.fail('take video fail!')
 def testAddKeyWords(self):
     '''
         Summary: Add keywords by setting meny 
         Steps:   1.Enter full view
                  2.Add keywords in settings bar
                  3.Click “+” to add new keywords to this photo
     '''
     u.setMenuOptions('Details')
     d.swipe(500,1050,500,200) #Swipe detail list up
     d(resourceId = 'com.intel.android.gallery3d:id/addKeywordButton').click.wait()
     d(text = 'Enter new keyword').click.wait() #Make sure keyboard has been invoked
     d(text = 'Enter new keyword').set_text('NewKeyword')
     self._tapOnDoneButton()
     assert d(text = 'NewKeyword',className = 'android.widget.TextView').wait.exists(timeout = 2000)
Exemple #24
0
 def _setFlashStatus(self, status):
     #commands.getoutput('adb shell input swipe 530 6 523 22')
     # Touch flash setting
     d.swipe(530, 6, 523, 22)
     d(description='Camera settings').click.wait()
     if status == 'on':
         d.click(176, 176)
     elif status == 'off':
         d.click(59, 178)
     else:
         self.touch((296, 176))
     state = commands.getoutput(PictureSize_STATE)
     statevalue = state.find(status)
     if statevalue == -1:
         self.fail('set camera flash status to' + status + 'fail!')
Exemple #25
0
 def _setFlashStatus(self,status):
     #commands.getoutput('adb shell input swipe 530 6 523 22')
     # Touch flash setting
     d.swipe(530,6,523,22)
     d(description = 'Camera settings').click.wait()
     if status == 'on':
         d.click(176,176)
     elif status == 'off':
         d.click(59,178)
     else:
         self.touch((296,176))
     state = commands.getoutput(PictureSize_STATE)
     statevalue = state.find(status)
     if statevalue == -1:
         self.fail('set camera flash status to' + status + 'fail!') 
 def testCheckAlbumDetail(self):
     """
     Summary: Check details
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album thumbnail to select it
     3. Tap Extra menu Icon
     4. Tap Details option
     5. Exit SocialGallery app
     """
     # Step 2 
     d.swipe(355,575,356,576)
     # Step 3 + Step 4
     u.setMenuOptions('Details')
     # confirm pop up details dialog
     assert d(text = '1 of 2 items:').wait.exists
 def testDeleteMediaItems(self):
     self._checkResource()
     self._launchGallery()
     self._enterGridView()
     d.swipe(370, 590, 371, 591) #Long click the picture in the center
     time.sleep(2)
     assert d(text = '1 selected').wait.exists(timeout = 2000), 'The picture in the center has not been selected'
     d(text = '1 selected').click.wait()
     assert d(text = 'Select all').wait.exists(timeout = 2000), 'Selection extra menu does not pop up'
     d(text = 'Select all').click.wait()
     d(description = 'Delete').click.wait() #Try to delete the all pictures in the album
     assert d(text = 'Delete').wait.exists(timeout = 2000) #Here shall pop up an extra menu
     d(text = 'Delete').click.wait() #Confirm and delete the all pic
     #After deleting all pictures, it shall back to the album view due to there is no any picture in the album
     time.sleep(5)
     assert d(text = 'Albums').wait.exists(timeout = 3000), 'All pictures have not been deleted in 8s'
 def testSharePictureInGridViewWithYouTube(self):
     """
     1.Launch gallery activity 
     2.Enter Grid view
     3.Long touch a pic or a video to select
     4.Tap share icon
     5.Tap YouTube option
     """
     u._prepareVideo()
     time.sleep(2)
     # Step 3
     d.swipe(355,575,356,576)
     # Step 4 + Step 5
     u.shareItem('YouTube')
     # confirm enter YouTube
     assert d(text = 'Choose an account').wait.exists(timeout = 2000)
Exemple #29
0
 def testAddKeyWords(self):
     '''
         Summary: Add keywords by setting meny 
         Steps:   1.Enter full view
                  2.Add keywords in settings bar
                  3.Click “+” to add new keywords to this photo
     '''
     u.setMenuOptions('Details')
     d.swipe(500, 1050, 500, 200)  #Swipe detail list up
     d(resourceId='com.intel.android.gallery3d:id/addKeywordButton'
       ).click.wait()
     d(text='Enter new keyword').click.wait(
     )  #Make sure keyboard has been invoked
     d(text='Enter new keyword').set_text('NewKeyword')
     self._tapOnDoneButton()
     assert d(text='NewKeyword',
              className='android.widget.TextView').wait.exists(timeout=2000)
Exemple #30
0
 def _setPictureSizeStatus(self,status):
     #commands.getoutput('adb shell input swipe 530 6 523 22')
     d.swipe(530,6,523,22)
     time.sleep(1)
     d.click(65,85)
     time.sleep(1)
     d.click(412,185)
     time.sleep(1)
     if status == 'WideScreen':
         d.click(60,292)
     elif status == 'StandardScreen':
         d.click(180,292)
     time.sleep(2)
     state = commands.getoutput(PictureSize_STATE)
     statevalue = state.find(status)
     if statevalue == -1:
         self.fail('set camera picture size to' + status +'fail!')
 def testWeibo(self):
     assert d.exists(text='Weibo') , 'wechat app not appear on the home screen'
     #assert d.exists(text='Apps')  , 'not appear on the home screen'
     d(text='Weibo').click.wait()
     assert d(className='android.widget.TextView', description="MainEdit").wait.exists(timeout=10000), 'weibo cient unable to open in 10 secs'
     if d.exists(text='Sent failed. It has been saved in the draft.'):
         d(text='Sent failed. It has been saved in the draft.').click.wait()
         d.press('back')
     d.swipe(350, 420, 350, 820)
     d.sleep(3)
     #d(description="首页列表").click.wait()
     
     d(className='android.widget.TextView', description="MainEdit").click.wait()
     assert d(className='android.widget.TextView', text="New Weibo").wait.exists(timeout=3000), 'unable to compose message'
     d(className='android.widget.EditText').set_text('funny funny bear')
     d(text='Send', description='Send').click.wait()
     assert not d(text='Sent failed. It has been saved in the draft.').wait.exists(timeout=10000), 'msg send failed'
     assert d(className='android.widget.TextView', description="MainEdit").wait.exists(timeout=10000), 'unable to back to home screen in 10 secs'
 def testShareAlbumViaPicasa(self):
     """
     Summary: Share album via Picasa
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album thumbnail to select it
     3. Tap share icon
     4. Tap See all option
     5. Tap Picasa option
     6. Back to SocialGallery app
     7.Exit SocialGallery app
     """
     # Step 2 
     d.swipe(355,575,356,576)
     # Step 3 + Step 4 + Step 5
     u.shareItem('Picasa')
     # confirm enter Picasa
     assert d(text = 'Upload 20 photos/videos').wait.exists(timeout = 2000)
 def testShareAlbumViaDrive(self):
     """
     Summary: Share album via Drive
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album thumbnail to select it
     3. Tap share icon
     4. Tap See all option
     5. Tap Drive option
     6. Back to SocialGallery app
     7.Exit SocialGallery app
     """
     # Step 2 
     d.swipe(355,575,356,576)
     # Step 3 + Step 4 + Step 5
     u.shareItem('Drive')
     # confirm enter Driver
     assert d(text = 'Upload to Drive').wait.exists(timeout = 2000)
 def testShareAlbumViaFacebook(self):
     """
     Summary: Share album via Facebook
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album thumbnail to select it
     3. Tap share icon
     4. Tap See all option
     5. Tap Facebook option
     6. Back to SocialGallery app
     7.Exit SocialGallery app
     """
     # Step 2 
     d.swipe(355,575,356,576)
     # Step 3 + Step 4 + Step 5
     u.shareItem('Facebook')
     # confirm enter Facebook
     assert d(text = 'Loading...').wait.exists(timeout = 2000)
 def testShareAlbumViaBluetooth(self):
     """
     Summary: Share album via Bluetooth
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album thumbnail to select it
     3. Tap share icon
     4. Tap See all option
     5. Tap Bluetooth option
     6. Back to SocialGallery app
     7.Exit SocialGallery app
     """
     # Step 2 
     d.swipe(355,575,356,576)
     # Step 3 + Step 4 + Step 5
     u.shareItem('Bluetooth')
     # confirm enter Bluetooth
     assert d(text = 'Bluetooth device chooser').wait.exists(timeout = 2000)
 def testCancelDeleteAlbum(self):
     """
     Summary: Cancel Delete an album
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album thumbnail to select it
     3. Tap Delete icon
     4. Select Cancle option to cancel delete
     5. Exit SocialGallery app
     """
     # Step 2 
     d.swipe(355,575,356,576)
     # Step 3 + Step 4
     u.deleteItem('Cancel')
     # confirm Delete complete
     result = commands.getoutput('adb shell ls -l /sdcard/testalbum/testpictures1 | grep jpg | wc -l')
     if string.atoi(result) == 0:
         self.fail('Cancel delete failed!')
 def _slideImageLtoR(self):
     #Swipe screen from left to right
     d.swipe(60, 300, 650, 300, 2)
     time.sleep(2)
Exemple #38
0
 def holdFirstImage(self):
     d.swipe(FIRSTITEM_X, FIRSTITEM_Y, FIRSTITEM_X + 1, FIRSTITEM_Y + 1)
 def _slideImageRtoL(self):
     #Swipe screen from right to left
     d.swipe(650, 300, 60, 300, 2)
     time.sleep(2)