Пример #1
0
 def _setScenesToAuto(self):
     commands.getoutput('adb shell input swipe 530 6 523 22')
     time.sleep(1)
     d.click(300, 185)
     time.sleep(1)
     d.click(710, 282)
     time.sleep(1)
Пример #2
0
 def testAnimateInGridView(self):
     """
     Summary: animate picture in gallery
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Select two or more pics
     4.Tap Extra Menu
     5.Tap animate option
     6.Random select the options
     7.Tap create button
     """
     # Step 3 + Step 4
     self._longtouchscreencenter()
     d.click(100,300)
     d.click(100,500)
     # Step 4 + Step 5
     u.setMenuOptions('Animate')
     # Step 6 + Step 7
     d(text = 'Animated GIF').click()
     d(text = 'Create').click()
     time.sleep(2)
     d(text = 'Save').click.wait()
     time.sleep(2)
     # confirm create complete
     result = commands.getoutput('adb shell ls -l /sdcard/Sharing | grep gif | wc -l')
     if string.atoi(result) != 1:
         self.fail('animated failed')
 def _setScenesToAuto(self):
     commands.getoutput('adb shell input swipe 530 6 523 22')
     time.sleep(1)
     d.click(300,185)
     time.sleep(1)
     d.click(710,282)
     time.sleep(1)
Пример #4
0
	def testAddDelContact(self):
		#Launch phone app
		self._launchPhone()

		#Select Contacts
		d(text = '联系人').click.wait()
		assert d(text = '群组').wait.exists(timeout=5000),'Switch to phone book failed in 5s!'

		#Add new contact
		d(text = '添加').click.wait()
		assert d(text = '本地保存').wait.exists(timeout = 5000),'Pop-up reserve method failed in 5s!'
		d(text = '本地保存').click.wait()
		assert d(text = '新建 本地 联系人').wait.exists(timeout = 5000),'Switch to create contacts failed in 5s!'
		d(text="姓名").set_text("adele")
		# click the top of screen, prevent the duplication
		d.sleep(1)
		d.click(580,170)
		d(className = 'android.widget.EditText', text="电话").set_text('15050505050')
		d(text = '完成').click.wait()
		assert d(text = '联系人详情').wait.exists(timeout = 5000),'Switch to contacts detail failed in 5s!'
		assert d(text = 'adele').wait.exists(timeout = 5000), 'adele is not show on screen!'

		#Delete contact
		d(text = '删除此联系人').click.wait()
		assert d(textContains = '要删除联系人吗').wait.exists(timeout = 5000),'Delete confirm info does not pop-up in 5s!'
		d(text = '确认删除').click.wait()
		assert d(text = 'adele').wait.gone(timeout = 5000),'Delete contact failed in 5s!'
Пример #5
0
	def testTakePicture(self):
		#Launch camera
		self._launchCamera()

		#Take pics
		before_cap = commands.getoutput('adb shell ls /sdcard/DCIM/Camera/* | grep jpg | wc -l')
		d(resourceId = 'com.android.camera2:id/shutter_button').click.wait()
		d.sleep(2)  #wait for thumbnail refresh
		after_cap = commands.getoutput('adb shell ls /sdcard/DCIM/Camera/* | grep jpg | wc -l')
		result_cap = string.atoi(after_cap) - string.atoi(before_cap)
		assert result_cap == 1,'Take picture failed, No picture in /sdcard/DCIM/Camera'

		#Check Pics
		d(resourceId = 'com.android.camera2:id/thumbnail').click.wait()
		assert d(resourceId = 'com.android.gallery3d:id/gallery_root').wait.exists(timeout = 6000),'Switch to gallery view failed in 6s!'
		
		# delete pics
		before = commands.getoutput('adb shell ls /sdcard/DCIM/Camera/* | grep jpg | wc -l')
		#(975,145) is the position of delete icon
		d.click(975,145)
		d.sleep(3)
		assert d(textContains = '确认要删除这张图片').wait.exists(timeout = 5000),"Delete confirmation pop-up failed in 5s!"
		d(text = '确认删除').click.wait()
		d.sleep(2)
		after = commands.getoutput('adb shell ls /sdcard/DCIM/Camera/* | grep jpg | wc -l')
		result = string.atoi(before) - string.atoi(after)
		assert result == 1,'Delete file failed!'
Пример #6
0
 def testPlayPauseVideo(self):
     self._clearAndPushVideo()
     u.launchGallery()
     u.enterXView('fullview')
     for i in range(100):
         u.showPopCard()
         u.tapOnCenter()  #Press playback icon
         if d(text='Complete action using').wait.exists(timeout=2000):
             try:
                 assert d(text='Always',
                          enabled='true').wait.exists(timeout=2000)
             except:
                 d(text='com.intel.android.gallery3d').click.wait()
             finally:
                 d(text='Always').click.wait()
         time.sleep(10)  #Play video file 10 s
         d.click(550, 150)
         d.click(550, 150)  #Invoke pop card
         u.tapOnCenter()  #Pause the video playback
         assert d(
             resourceId=
             'com.intel.android.gallery3d:id/background_play_action_provider_button'
         ).wait.exists(timeout=2000)
         #d(resourceId = 'android:id/up').click.wait() #Back to the fullview
         u.pressBack(1)
Пример #7
0
 def testDeleteMultiplePictureInGridView(self):
     """
     Summary: delete the selected pics or vides
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Long touch a pic or a video to select 
     4.Tap another two file to select
     5.Tap Trash icon
     6.Tap Delete option
     """
     # Step 3
     self._longtouchscreencenter()
     # Step 4
     d.click(200, 400)
     d.click(200, 800)
     # Step 5 + Step 6
     u.deleteItem('Delete')
     # confirm picture deleted.
     time.sleep(2)
     result = commands.getoutput(
         'adb shell ls -l /sdcard/testalbum/testpictures2 | grep jpg | wc -l'
     )
     if string.atoi(result) != 17:
         self.fail('delete failed!')
Пример #8
0
	def testSendMMSWithPics(self):
		#Launch message app and enter new message screen
		self._launchAndEnterNewMsg()

		#Input receiver and text content
		self._editTestContent(MMS_RECEIVER,MMS_PICS_CONT)

		#Add pics as attachment
		d(resourceId = 'com.android.mms:id/switch_button').click.wait()
		# (120,1830) is the positon of '照片和视频'
		d.click(120,1830)
		#assert d(text = '请选择操作').wait.exists(timeout = 5000),"Trigger '照片和视频' failed in 5s!"
		#d(text = '选取照片').click.wait()
		assert d(packageName = 'com.android.gallery3d').wait.exists(timeout = 5000),'Switch to gallery view failed in 5s!'
		d.sleep(1)
		# (800,1825) is the position of '所有相册'
		d.click(800,1825)
		# select '根目录'
		d.click('MMS_Into_RootDir.png')
		d.sleep(1)
		d.click('MMS_Pics.png')
		d.sleep(1)
		# (1000,150) is the position of Done button
		d.click(1000,150)
		d.sleep(1)

		#Send MMS
		self._sendMessage()
Пример #9
0
 def testAnimateInGridView(self):
     """
     Summary: animate picture in gallery
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Select two or more pics
     4.Tap Extra Menu
     5.Tap animate option
     6.Random select the options
     7.Tap create button
     """
     # Step 3 + Step 4
     self._longtouchscreencenter()
     d.click(200,400)
     d.click(200,800)
     # Step 4 + Step 5
     u.setMenuOptions('Animate')
     # Step 6 + Step 7
     d(text = 'Animated GIF').click()
     d(text = 'Create').click()
     time.sleep(2)
     d(text = 'Save').click.wait()
     time.sleep(2)
     # confirm create complete
     result = commands.getoutput('adb shell ls -l /sdcard/Sharing | grep gif | wc -l')
     if string.atoi(result) != 1:
         self.fail('animated failed')
Пример #10
0
	def testDownloadVideo(self):
		#Launch Browser
		self._launchBrowser()

		# input download audio url
		d(resourceId = 'com.android.browser:id/url', text = '输入网址').set_text('http://pan.baidu.com/s/1eQcRK3o')
		d.press('enter')
		d.sleep(5)
		d.swipe(540,1400,540,400,100)
		# click download
		d.click(800,1550)
		assert d(text = '是否下载该文件?').wait.exists(timeout = 10000), 'Not trigger download. '
		d(text = '下载').click.wait()
		if  d(textContains = '您正在通过移动数据下载').exists:
			d(text = '继续').click.wait()
		#Looping 60s to check if download is ok
		for i in range(60):
			if u.getFileCount('/sdcard/Download', 'mp4') > 0:
				return
			d.sleep(1)
		assert False, 'Can not download video in 60s. '

		#Close all webpage windows and clear downloaded resource
		#self._closeWindows()
		self._clearData()
Пример #11
0
 def testAddKeywordsToAllInGridView(self):
     """
     Summary: animate picture in gallery
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Long touch a pic or video to select
     4.Tap select file dropdown 
     5.Tap select all option
     6.Tap extra menu
     7.Tap add keywords option
     8.Input tag and tap DONE icon
     9.Exit socialgallery app
     """
     # Step 3
     self._longtouchscreencenter()
     # Step 4 + Step 5
     d(text = '1 selected').click()
     d(text = 'Select all').click()
     # Step 6 + Step 7
     u.setMenuOptions('Add a keyword')
     # Step 8
     d(text="Enter new keyword").set_text("New Keyword")
     d.click(1100,1660) # click 'done' icon on the keyboard.
     # confirm back to gallery
     self._longtouchscreencenter()
     d(text = '1 selected').click()
     d(text = 'Select all').click()       
     u.setMenuOptions('Add a keyword')
     assert d(text = 'New Keyword').exists
Пример #12
0
 def testAddKeywordsToAllInGridView(self):
     """
     Summary: animate picture in gallery
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Long touch a pic or video to select
     4.Tap select file dropdown 
     5.Tap select all option
     6.Tap extra menu
     7.Tap add keywords option
     8.Input tag and tap DONE icon
     9.Exit socialgallery app
     """
     # Step 3
     self._longtouchscreencenter()
     # Step 4 + Step 5
     d(text = '1 selected').click()
     d(text = 'Select all').click()
     # Step 6 + Step 7
     u.setMenuOptions('Add a keyword')
     # Step 8
     d(text="Enter new keyword").set_text("New Keyword")
     d.click(650,1130) # click 'done' icon on the keyboard.
     # confirm back to gallery
     self._longtouchscreencenter()
     d(text = '1 selected').click()
     d(text = 'Select all').click()       
     u.setMenuOptions('Add a keyword')
     assert d(text = 'New Keyword').exists
Пример #13
0
 def testAddKeywordsToAllInGridView(self):
     """
     Summary: animate picture in gallery
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Long touch a pic or video to select
     4.Tap select file dropdown 
     5.Tap select all option
     6.Tap extra menu
     7.Tap add keywords option
     8.Input tag and tap DONE icon
     9.Exit socialgallery app
     """
     # Step 3
     u.holdTheCenter()
     # Step 4 + Step 5
     d(className = 'android.widget.ImageButton').click.wait()
     d(text = 'Select all').click()
     # Step 6 + Step 7
     u.setMenuOptions('Add keyword')
     # Step 8
     d(text="Enter new keyword").set_text("New Keyword")
     d.click(2358,1090) # click 'done' icon on the keyboard.
     # confirm back to gallery
     u.holdTheCenter()
     d(className = 'android.widget.ImageButton').click.wait()
     d(text = 'Select all').click()       
     u.setMenuOptions('Add keyword')
     assert d(text = 'New Keyword').exists
 def showPopCard(self):
     time.sleep(2)
     d.click(350,100) #The center of the top action bar
     time.sleep(2)
     d.click(350,100) #Sometimes there is no response if tap here only once. Although it has poped up, tap here would do no thing for the case
     time.sleep(2)
     assert d(description = 'Share').wait.exists(timeout = 5000), 'Pop card does not display after tapping on the top bar twice'       
Пример #15
0
	def _clearCache(self):
		# close all webpage
		d(resourceId = 'com.android.browser:id/switch_btn').click.wait()
		d(resourceId = 'com.android.browser:id/clearall').click.wait()
		d(text = '关闭').click.wait()
		# clear cache
		d(resourceId = 'com.android.browser:id/menu_btn').click.wait()
		d.sleep(2)
		#select setting in option list
		d.click(590,1700)
		#d(resourceId = 'com.android.browser:id/option_list_item_text',text = '设置').click.wait()
		assert d(text = '设置').wait.exists(timeout = 3000),'Switch to setting view failed in 3s!'
		d(text = '隐私和安全').click.wait()
		assert d(resourceId = 'com.android.browser:id/action_new_event_text',text = '隐私和安全').wait.exists(timeout = 3000),'Switch to event view failed in 3s!'
		d(text = '清除缓存').click.wait()
		if  d(resourceId = 'android:id/alertTitle',text = '清除缓存').exists:
			d(text = '确定').click.wait()
		d(text = '清除历史记录').click.wait()
		if  d(resourceId = 'android:id/alertTitle',text = '清除历史记录').exists:
			d(text = '确定').click.wait()
		d(text = '清除所有 Cookie 数据').click.wait()
		if  d(resourceId = 'android:id/alertTitle',text = '清除所有 Cookie 数据').exists:
			d(text = '确定').click.wait()
		d(text = '返回').click.wait()
		d(text = '完成').click.wait()
Пример #16
0
 def showPopCard(self):
     time.sleep(2)
     d.click(550,150) #The center of the top action bar
     time.sleep(2)
     d.click(550,150) #Sometimes there is no response if tap here only once. Although it has poped up, tap here would do no thing for the case
     time.sleep(2)
     assert d(description = 'Share').wait.exists(timeout = 5000), 'Pop card does not display after tapping on the top bar twice'       
Пример #17
0
 def testDeleteMultiplePictureInGridView(self):
     """
     Summary: delete the selected pics or vides
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Long touch a pic or a video to select 
     4.Tap another two file to select
     5.Tap Trash icon
     6.Tap Delete option
     """
     # Step 3
     u.holdTheCenter()
     # Step 4
     d.click(700,800)
     d.click(1000,800)
     # Step 5 + Step 6
     d(className = 'android.widget.ImageButton').click.wait()
     u.setMenuOptions('Delete')
     d(text = 'Delete').click.wait()
     # confirm picture deleted.
     time.sleep(2)
     result = commands.getoutput('adb shell ls -l /sdcard/testalbum/testpictures1 | grep jpg | wc -l')
     if string.atoi(result) != 18:
         raise Exception('delete failed!')
 def testPlayVideoFile(self):
     '''
         Summary: Play video file
         Steps:   1.Launch socialgallery 
                  2. Select video file and Enter full view
                  3.Touch play icon and play video file
                  4.Touch screen any point twice and pause this video
                  5. Exit socialgallery 
     '''
     u.tapOnCenter()  #Press playback icon
     if d(text='Complete action using').wait.exists(timeout=2000):
         try:
             assert d(text='Always',
                      enabled='true').wait.exists(timeout=2000)
         except:
             d(text='com.intel.android.gallery3d').click.wait()
         finally:
             d(text='Always').click.wait()
     time.sleep(10)  #Play video file 10 s
     d.click(350, 100)  #Invoke pop card
     d.click(350, 100)  #Invoke pop card
     assert d(description='Share').wait.exists(timeout=5000)
     u.tapOnCenter()  #Pause the video playback
     assert d(
         resourceId=
         'com.intel.android.gallery3d:id/background_play_action_provider_button'
     ).wait.exists(timeout=2000)
Пример #19
0
 def showPopCard(self):
     d.click(self.getSizeOfGallery()[4], self.getSizeOfGallery()[0] + 1)
     d(description = 'More options').click.wait()
     if d(text = 'View photonotes').wait.exists(timeout = 2000):
         d(text = 'View photonotes').click.wait()
     else:
         d.press('back')
     time.sleep(1)
Пример #20
0
    def setUp(self):
        u.clog()
        self.checkScreen()
        d.click(1380, 800)
        self.inputCode()

        time.sleep(2)
        for i in xrange(4):
            d.press("back")
        self._launch_filemanager()
Пример #21
0
    def setCameraOption(self, optiontext, option):
        """
           ***Usage***
            To set Scenes as 'sports':
                self.setCameraOption('Scenes','sports')

                You may need use the arguements that have been defined at the top of this file
        """
        d(resourceId="com.intel.camera22:id/camera_settings").click.wait()
        while d(text=optiontext).wait.gone(timeout=2000):
            self._slideSettingListUp()
        newoptiontext = optiontext.replace(" ", "_")
        # Get the current option
        if newoptiontext not in SETTINGS_0:
            stringcated = commands.getoutput(
                "adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0_0.xml | grep %s"
                % DICT_OPTION_KEY[newoptiontext]
            )
            currentoption = (((stringcated.split(">"))[1]).split("<"))[0]
        else:
            stringcated = commands.getoutput(
                "adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0.xml | grep %s"
                % DICT_OPTION_KEY[newoptiontext]
            )
            currentoption = (((stringcated.split(">"))[1]).split("<"))[0]
        currentindex = DICT_OPTION_NAME[newoptiontext].index(currentoption)
        targetindex = DICT_OPTION_NAME[newoptiontext].index(option)
        # Settinglayout do change UI very much, so need one more logic
        settinglayout = commands.getoutput(
            "adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0.xml | grep pref_settings_layout_key"
        )
        if settinglayout.find("Mini") != -1:
            # Get the current option's index and compare it with the target option
            # If current option is just the target option, do nothing('pass').
            if currentindex > targetindex:
                for i in range(currentindex - targetindex):
                    self._slideOptionLeftToRight(optiontext)
                    d(resourceId="com.intel.camera22:id/camera_settings").click.wait()
            elif currentindex < targetindex:
                for i in range(targetindex - currentindex):
                    self._slideOptionRightToLeft(optiontext)
                    d(resourceId="com.intel.camera22:id/camera_settings").click.wait()
            else:
                # Neither higher nor lower than the target option, that means the current option is just the target one.
                pass
            d(resourceId="com.intel.camera22:id/mini_layout_view").click.wait()
        else:
            if currentindex != targetindex:
                d.click(
                    self._getFirstItem() + self._getOptionWidthAndHeight()[1] * targetindex,
                    self._getOptionOrdinate(optiontext),
                )
            else:
                pass
Пример #22
0
	def testSwitchView(self):
		if d(resourceId = 'com.android.browser:id/stop').exists:
			d(resourceId = 'com.android.browser:id/newtab_btn').click.wait()
		if d(resourceId = 'com.android.browser:id/frame0').exists:
			d(resourceId = 'com.android.browser:id/switch_btn').click.wait()
		for i in range(1000):
			d(resourceId = 'com.android.browser:id/menu_btn').click.wait()
			d.click('hiden_mode.png')
			d.sleep(1)
			d(resourceId = 'com.android.browser:id/menu_btn').click.wait()
			d.click('normal_mode.png')
Пример #23
0
	def testWebNavigation(self):
		#Launch Browser
		self._launchBrowser()

		#Visite webpage
		d(resourceId = 'com.android.browser:id/url', text = '输入网址').set_text('wap.sohu.com')
		d.press('enter')
		d.expect('Web_Navigation_News.png',timeout=10, msg = 'Loading webpage failed in 10s!')

		#Click Navigation '新闻'
		d.click('Web_Navigation_News.png')
 def testPlayBurstPictures(self):
     """
     Steps:
          1.Launch gallery activity 
          2.Enter Full View
          3.Tap play burst icon
     """
     d.click(350,620)  
     time.sleep(7)
     d.click(324,100)
     time.sleep(1)
     assert d(resourceId = 'android:id/home').wait.exists(timeout=2000),'play fail '
Пример #25
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, 360)
         time.sleep(1) #Sometimes case failed if tap action is too fast
         x = x + 200 #The gap between two pictures are 150 pix
         if x > 1000: #The left boundry of the fifth image, so if abscissa over than 600, need swipe
             d.swipe(1000,360,1,360,steps=5)
             time.sleep(1)
             x = 100 #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    
Пример #27
0
 def testSlidePicture(self):
     self._clearAndPush500Pic()
     u.launchGallery()
     u.enterXView('fullview')
     d.click(550,150)
     d.click(550,150)
     time.sleep(10)
     assert d(description = 'Share').wait.exists(timeout = 5000), 'Pop card does not display after tapping on the top bar twice'       
     for i in range(2):
         for j in range(10):
             self._slideImageRtoL()
         for k in range(10):
             self._slideImageLtoR()
 def testSmallPlayBurstIconOfPageflip(self):
     """
     Summary:This case test play burst with Page flip mode in burst view.
     Precondition: There are burst pictures in sdcard
     Steps:
       1. Launch Intel gallery and enter to burst view
       2. Tap small play burst icon -> Page flip, wait some seconds to check if stopped the playing
     """ 
     self._burstMenuOption('Playback','Page flip')
     time.sleep(15)
     d.click(324,100)
     time.sleep(1)
     assert d(resourceId = 'com.intel.android.gallery3d:id/action_share').wait.exists(timeout = 3000), 'play fail'
Пример #29
0
 def testPlayBurstPictures(self):
     """
     Steps:
          1.Launch gallery activity 
          2.Enter Full View
          3.Tap play burst icon
     """
     d.click(550, 950)
     time.sleep(7)
     d.click(550, 150)
     time.sleep(1)
     assert d(resourceId='android:id/home').wait.exists(
         timeout=2000), 'play fail '
Пример #30
0
	def testSaveNoteAsPic(self):
		# Launch Note
		d.start_activity(component='com.smartisanos.notes/.NotesActivity')
		if d(text = '列表').exists:
			d(text = '列表').click.wait()
		assert d(text = '便签').wait.exists(timeout = 5000),'Launch Note failed in 5s!'
		for i in range(500):
			d(resourceId = 'com.smartisanos.notes:id/add_button').click.wait()
			assert d(resourceId = 'com.smartisanos.notes:id/delete_insert_button').wait.exists(timeout = 5000),'Switch to note editer failed in 5s!'
			d(resourceId = 'com.smartisanos.notes:id/detail_note_editor').set_text('test content...')
			d(resourceId = 'com.smartisanos.notes:id/delete_insert_button').click.wait()
			d.sleep(1)
			d.click(900,1830)
			d.click('image.png')
			# select first pic
			d.click(150,370)
			d.click('done.png')
			assert d(resourceId = 'com.smartisanos.notes:id/detail_note_image').wait.exists(timeout = 5000),'Add pic to note failed in 5s!'
			d(resourceId = 'com.smartisanos.notes:id/send_finish_button').click.wait()
			d(resourceId = 'com.smartisanos.notes:id/send_finish_button').click.wait()
			assert d(text = '请选择操作').wait.exists(timeout = 5000),'Share selector does not pop-up in 5s!'
			d(text = '以图片形式分享').click.wait()
			assert d(text = '保存图片').wait.exists(timeout = 5000),'Switch to thumbs failed in 5s!'
			d(text = '取消').click.wait()
			d(text = '列表').click.wait()
Пример #31
0
 def testSmallPlayBurstIconOfPageflip(self):
     """
     Summary:This case test play burst with Page flip mode in burst view.
     Precondition: There are burst pictures in sdcard
     Steps:
       1. Launch Intel gallery and enter to burst view
       2. Tap small play burst icon -> Page flip, wait some seconds to check if stopped the playing
     """
     self._burstMenuOption('Playback', 'Page flip')
     time.sleep(15)
     d.click(550, 150)
     time.sleep(1)
     assert d(resourceId='com.intel.android.gallery3d:id/action_share'
              ).wait.exists(timeout=3000), 'play fail'
Пример #32
0
	def testShareNoteToWeibo(self):
		# Launch Note
		d.start_activity(component='com.smartisanos.notes/.NotesActivity')
		assert d(text = '便签').wait.exists(timeout = 5000),'Launch Note failed in 5s!'
		for i in range(500):
			d(resourceId = 'com.smartisanos.notes:id/add_button').click.wait()
			assert d(resourceId = 'com.smartisanos.notes:id/delete_insert_button').wait.exists(timeout = 5000),'Switch to note editer failed in 5s!'
			d(resourceId = 'com.smartisanos.notes:id/detail_note_editor').set_text('test content...')
			d(resourceId = 'com.smartisanos.notes:id/delete_insert_button').click.wait()
			d.sleep(1)
			d.click(900,1830)
			d.click('image.png')
			# select first pic
			d.click(150,370)
			d.click('done.png')
			assert d(resourceId = 'com.smartisanos.notes:id/detail_note_image').wait.exists(timeout = 5000),'Add pic to note failed in 5s!'
			d(resourceId = 'com.smartisanos.notes:id/send_finish_button').click.wait()
			d(resourceId = 'com.smartisanos.notes:id/send_finish_button').click.wait()
			assert d(text = '请选择操作').wait.exists(timeout = 5000),'Share selector does not pop-up in 5s!'
			d(text = '发送至新浪微博').click.wait()
			#d(text = '生成长微博').click.wait()
			#d(text = '保存到相册并继续').click.wait()
			assert d(resourceId = 'com.smartisanos.notes:id/weibo_body_view').wait.exists(timeout = 5000),'Switch to Weibo proview failed in 5s!'
			d(text = '下一步').click.wait()
			assert d(text = '发送').wait.exists(timeout = 5000),'Prepare to send weibo failed in 5s!'
			d(text = '取消').click.wait()
			d(text = '取消').click.wait()
			d(text = '列表').click.wait()
Пример #33
0
 def testAddPlace(self):
     u._confirmResourceExists()
     u.launchGallery()
     u.enterXView('fullview')
     u.showPopCard()
     for i in range(10):
         self._addKeyWordEventVenue('venue',"kaihui")
         time.sleep(1)
         assert d(text = 'kaihui').wait.exists(timeout =2000),'add event fail' 
         d(resourceId='com.intel.android.gallery3d:id/venue_text').click.wait() 
         time.sleep(1)
         d(resourceId='com.intel.android.gallery3d:id/search_text_clear').click.wait()  
         d.click(2358,1090)     
         time.sleep(1)
Пример #34
0
	def testSendEmailWithAtt(self):
		#Launch Email
		self._launchEmail()

		#Edit mail content
		d(resourceId = 'com.android.email:id/compsoe_view').click.wait()
		assert d(text = '写邮件').wait.exists(timeout = 5000),'Switch to compose view failed in 5s!'
		d(resourceId = 'com.android.email:id/to_recipient_view').set_text(SEND_TO)
		d.press('enter')
		d(resourceId = 'com.android.email:id/subject').set_text(SUBJECT)
		d(resourceId = 'com.android.email:id/body').set_text(BODY)

		#Add attachment and then send out
		d(resourceId = 'com.android.email:id/compose_attach').click.wait()
		assert d(text = '选择应用添加附件').wait.exists(timeout = 5000),"'选择应用添加附件' does not pop-up in 5s!"
		d(text = '相册').click.wait()
		assert d(packageName = 'com.android.gallery3d').wait.exists(timeout = 5000),'Switch to gallery view failed in 5s!'
		d.sleep(3)
		# select pics as attachment
		#d.click('Attachment_Into_RootDir.png')
		#d.sleep(1)
		d.click('Attachment_Pics.png')
		d.sleep(1)
		#click done
		d.click(1000,150)
		d.sleep(1)
		d(text = '发送').click.wait()
		#d.sleep(1)
		assert d(text = '设置').wait.exists(timeout = 5000),'Switch to mail list (after click send icon) failed in 5s!'

		#Delete mail from sendbox
		d(resourceId = 'com.android.email:id/options_view').click.wait()
		assert d(resourceId = 'com.android.email:id/bottom_dialog_title_text',text = 'Exchange').wait.exists(timeout = 5000),'Trigger menu list failed in 5s!'
		d(text = '已发送邮件').click.wait()
		assert d(resourceId = 'com.android.email:id/title',text = '已发送邮件').wait.exists(timeout = 5000),'Switch to sended box failed in 5s!'
		# looping 60s to check if mail sending finished
		for i in range(12):
			d.sleep(5)
			if d(descriptionContains = SUBJECT).exists:
				break
			d(resourceId = 'com.android.email:id/refresh_view').click.wait()
		assert d(descriptionContains = BODY).wait.exists(timeout = 1000),'Send mail does not show in send box in 5s!'
		d(descriptionContains = BODY).click.wait()
		if d(descriptionContains = SUBJECT).exists:
			d(descriptionContains = SUBJECT).click.wait()
		assert d(resourceId = 'com.android.email:id/send_calendar_btn').wait.exists(timeout = 5000),'Open mail failed in 5s!'
		d(resourceId = 'com.android.email:id/detail_delete_view').click.wait()
		d(text = '确认删除').click.wait()
		assert d(text = '来往邮件').wait.exists(timeout = 5000),'Switch to sending box failed (after delete send mail) in 5s!'
 def testSmallPlayBurstIconOfDissolve(self):
     """
     Summary:This case test play burst with Dissolve mode in burst view.
     Precondition: There are burst pictures in sdcard
     Steps:
       1. Launch Intel gallery and enter to burst view
       2. Tap small play burst icon -> Dissolve, wait some seconds to check if stopped the playing
     """  
     #Step 2
     #Tap small play burst icon twice,the fist tap try to activity the tool bar due to it is disappeared
     self._burstMenuOption('Playback','Dissolve')
     time.sleep(7)
     d.click(324,100)
     time.sleep(1)
     assert d(resourceId = 'com.intel.android.gallery3d:id/action_share').wait.exists(timeout = 3000), 'play fail'
Пример #36
0
 def _enterBurstView(self):
     '''
     Enter the burst view...
     '''  
     time.sleep(1)
     #d.expect('100ANDRO.png')
     u.tapOnCenter()
     time.sleep(1)
     #d.expect('burst.png')
     u.tapOnCenter()
     time.sleep(2)
     #d.expect('burstview.png')
     d.click(550,150)
     #d.expect('GalleryBST.png')
     time.sleep(1)
Пример #37
0
 def testSlidePicture(self):
     self._clearAndPush500Pic()
     u.launchGallery()
     u.enterXView('fullview')
     d.click(550, 150)
     d.click(550, 150)
     time.sleep(10)
     assert d(description='Share').wait.exists(
         timeout=5000
     ), 'Pop card does not display after tapping on the top bar twice'
     for i in range(10):
         for j in range(10):
             self._slideImageRtoL()
         for k in range(10):
             self._slideImageLtoR()
Пример #38
0
 def _enterBurstView(self):
     '''
     Enter the burst view...
     '''
     time.sleep(1)
     #d.expect('100ANDRO.png')
     u.tapOnCenter()
     time.sleep(1)
     #d.expect('burst.png')
     u.tapOnCenter()
     time.sleep(2)
     #d.expect('burstview.png')
     d.click(550, 150)
     #d.expect('GalleryBST.png')
     time.sleep(1)
 def testEnterGalleryFromGalleryPreviewThumbnail100times(self):
     '''
     Summary: enter gallery from gallery preview thumbnail 100times
     Steps  : 1.Launch single capture activity
              2.enter gallery from gallery preview thumbnail 100times
              3.Exit  activity
     '''
     tb.takePicture('single')
     time.sleep(100)
     for i in range(5):
         d(resourceId = 'com.intel.camera22:id/thumbnail').click.wait()
         d.click(300,300)
         time.sleep(2)
         assert d(resourceId = 'com.intel.android.gallery3d:id/cardpop').wait.exists(timeout = 3000)
         d.press('back')
         time.sleep(1)
Пример #40
0
 def testSmallPlayBurstIconOfDissolve(self):
     """
     Summary:This case test play burst with Dissolve mode in burst view.
     Precondition: There are burst pictures in sdcard
     Steps:
       1. Launch Intel gallery and enter to burst view
       2. Tap small play burst icon -> Dissolve, wait some seconds to check if stopped the playing
     """
     #Step 2
     #Tap small play burst icon twice,the fist tap try to activity the tool bar due to it is disappeared
     self._burstMenuOption('Playback', 'Dissolve')
     time.sleep(7)
     d.click(550, 150)
     time.sleep(1)
     assert d(resourceId='com.intel.android.gallery3d:id/action_share'
              ).wait.exists(timeout=3000), 'play fail'
Пример #41
0
	def testRecordAudio(self):
		#Launch sound recorder
		d.start_activity(component='com.smartisanos.recorder/.activity.EmptyActivity')
		d.sleep(2)
		d.click(880,1545)
		assert d(text = '录音机').wait.exists(timeout = 5000),'Launch sound recorder failed in 5s!'

		#Start record
		for i in range(3):
			if i ==3:
				# kill recorder
				recorderPID = u.getPID('com.smartisanos.recorder')
				commands.getoutput('adb shell kill %s'%recorderPID)
				assert False,'Can not start recording!'
			d(resourceId = 'com.smartisanos.recorder:id/recorder_main_control_record').click()
			if d(resourceId='com.smartisanos.recorder:id/recorder_main_control_mark').enabled:
				break

		#Record 5s
		d.sleep(5)

		#Stop record and then save audio
		d(resourceId = 'com.smartisanos.recorder:id/recorder_main_control_stop').click.wait()
		if not d(text = '命名并保存').exists:
			recorderPID = u.getPID('com.smartisanos.recorder')
			commands.getoutput('adb shell kill %s'%recorderPID)
		assert d(text = '命名并保存').wait.exists(timeout=5000),'Save window does not pop-up in 5s!'
		d(text = '确定').click.wait()

		#Play the recorded video
		d(resourceId = 'com.smartisanos.recorder:id/recorder_main_title_list').click.wait()
		assert d(text = '录音列表').wait.exists(timeout=5000),'Switch audio list failed in 5s!'
		d(resourceId = 'com.smartisanos.recorder:id/list_item_arrow').click.wait()
		assert d(resourceId = 'com.smartisanos.recorder:id/recorder_edit_control_play').wait.exists(timeout=5000),'Switch to audio play view failed in 5s!'
		d(resourceId = 'com.smartisanos.recorder:id/recorder_edit_control_play').click()
		assert d(resourceId = 'com.smartisanos.recorder:id/recorder_edit_control_pause').wait.exists(timeout=5000),'Play audio failed in 5s!'
		#play audio time
		d.sleep(5)

		#Delete audio
		before = commands.getoutput('adb shell ls /sdcard/smartisan/Recorder/* | grep wav | wc -l')
		d(resourceId = 'com.smartisanos.recorder:id/recorder_edit_title_delete').click.wait()
		assert d(textContains = '确认要删除此音频文件').wait.exists(timeout=5000),'Delete confirmation does not pop-up in 5s!'
		d(text = '确认删除').click.wait()
		after = commands.getoutput('adb shell ls /sdcard/smartisan/Recorder/* | grep wav | wc -l')
		result = string.atoi(before) - string.atoi(after)
		assert result == 1,'Delete file failed!'
Пример #42
0
 def testEnterGalleryFromGalleryPreviewThumbnail100times(self):
     '''
     Summary: enter gallery from gallery preview thumbnail 100times
     Steps  : 1.Launch single capture activity
              2.enter gallery from gallery preview thumbnail 100times
              3.Exit  activity
     '''
     tb.takePicture('single')
     time.sleep(100)
     for i in range(5):
         d(resourceId='com.intel.camera22:id/thumbnail').click.wait()
         d.click(300, 300)
         time.sleep(2)
         assert d(resourceId='com.intel.android.gallery3d:id/cardpop'
                  ).wait.exists(timeout=3000)
         d.press('back')
         time.sleep(1)
Пример #43
0
 def switchCaptureMode(self,mode):
     '''
     Usage: This method is used to switch social camera 2.3 capture mode.
     e.g. SetCaptureMode.switchCaptureMode('single')
     '''
     d(description = 'Show switch camera mode list').click.wait()
     d.click(2195,910)        
     time.sleep(2)
     d(description = 'Show switch camera mode list').click.wait()        
     if mode == 'smile' or mode == 'hdr':
         d(text = POP_MODE[mode]).click.wait()
     elif mode == 'burstfast' or mode == 'burstslow':
         self._swipeCaptureList('burst')
         d(text = POP_MODE[mode]).click.wait()
     else:
         self._swipeCaptureList(mode)
         self._clickCaptureMode()
 def testQuickSwitchtoGallery(self):
     """
     Summary:testQuickSwitchtoGallery: Quick Switch to gallery 
     Steps:  1. Launch camera 
             2. Touch shutter button to capture a picture
             3. Touch the thubnail icon to view it in gallery 
     """ 
     # step 2
     time.sleep(1)
     self._checkCapturedPic()                                         # capture picture
     time.sleep(1)                                    
     d(resourceId = 'com.intel.camera22:id/thumbnail').click.wait()   # enter gallery
     time.sleep(2)
     # step 2
     d.click(500,500)
     time.sleep(1)
     assert d(resourceId = 'android:id/home').wait.exists(timeout = 3000)
Пример #45
0
 def testQuickSwitchtoGallery(self):
     """
     Summary:testQuickSwitchtoGallery: Quick Switch to gallery 
     Steps:  1. Launch camera 
             2. Touch shutter button to capture a picture
             3. Touch the thubnail icon to view it in gallery 
     """
     # step 2
     time.sleep(1)
     tb.captureAndCheckPicCount('single', 2)  # capture picture
     time.sleep(1)
     d(resourceId='com.intel.camera22:id/thumbnail').click.wait(
     )  # enter gallery
     time.sleep(2)
     # step 2
     d.click(1200, 800)
     time.sleep(1)
     assert d(resourceId='android:id/home').wait.exists(timeout=3000)
Пример #46
0
 def switchCaptureMode(self, mode):
     '''
     Usage: This method is used to switch social camera 2.3 capture mode.
     e.g. SetCaptureMode.switchCaptureMode('single')
     '''
     d(description='Show switch camera mode list').click.wait()
     d.click(2195, 910)
     time.sleep(1)
     d(description='Show switch camera mode list').click.wait()
     if mode == 'smile' or mode == 'hdr':
         d(text=POP_MODE[mode]).click.wait()
     elif mode == 'burstfast' or mode == 'burstslow':
         self._swipeCaptureList('burst')
         d(text=POP_MODE[mode]).click.wait()
     else:
         self._swipeCaptureList(mode)
         time.sleep(1)
         self._clickCaptureMode()
Пример #47
0
 def testAddKeywordsInGridView(self):
     """
     Summary: Add keywords in grid view
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Long touch a pic to select
     4.Tap Extra Menu
     5.Tap Add keywords option
     6.Type own custom tags
     7.Tap Save button
     """
     # Step 3
     self._longtouchscreencenter()
     # Step 4 + Step 5
     u.setMenuOptions('Add a keyword')
     # Step 6 + Step 7
     d(text="Enter new keyword").set_text("New Keyword")
     d.click(650,1130) # click 'done' icon on the keyboard.
Пример #48
0
 def testSearchKeywordsInGridView(self):
     """
     Summary:Search keywords picture.
     Step:
     1.Launch gallery activity 
     2.Enter Grid view
     3.Tap search icon
     4.Input your owner custom keywords.
     5.Touch the searched pics 
     """
     # before searching, a keyword is needed. this step is used to add keyword.
     self._longtouchscreencenter()
     u.setMenuOptions('Add a keyword')
     d(text="Enter new keyword").set_text("New Keyword")
     d.click(650,1130) # click 'done' icon on the keyboard.
     # Step 3
     d(description = 'Search').click()
     # Step 4
     d(resourceId = 'com.intel.android.gallery3d:id/search_src_text').set_text('New Keyword')
Пример #49
0
 def _addKeyWordEventVenue(self, word, text):
     self._burstMenuOption('Details')
     if word == 'Keyword':
         time.sleep(1)
         d().swipe.up()
         time.sleep(2)
         d(resourceId='com.intel.android.gallery3d:id/add' + word +
           'Button').click.wait()
         time.sleep(1)
         d(text="Enter new keyword").set_text(text)
         time.sleep(1)
     else:
         time.sleep(1)
         d(resourceId='com.intel.android.gallery3d:id/' + word +
           '_edit').click.wait()
         time.sleep(1)
         d(text="Enter new " + word).set_text(text)
         time.sleep(1)
     d.click(1000, 1660)
 def testSwitchGalleryToCamera(self):
     """
     Summary: Switch to camera by tap Switch to Camera icon
     Steps: 
     1. Launch SocialGallery app
     2. Tap Switch to Camera Icon
     3. Exit Camera app
     4. Exit SocialGallery app
     """
     # Step 2
     d(description = 'Switch to camera').click.wait(timeout = 1000)
     # If exists the first time of switch camera selection, click social camera and click always.
     if d(text = 'Complete action using').exists:
         d(text = 'com.intel.camera22').click.wait(timeout = 1000)
         d.click(resourceId = 'android:id/button_always')
     # confirm switch to camera.
     assert d(description = 'com.intel.camera22:id/shutter_button').wait.exists
     # Step 3
     u.pressBack(1)
 def testSearchAlbum(self):
     """
     Summary: Check Social Sync icon.
     Steps: 
     1. Launch SocialGallery app
     2. Tap Search Icon
     3. Input the search tag
     4. Exit SocialGallery app
     """
     # Before Searching, a keyword is needed.
     self._longtouchscreencenter()
     u.setMenuOptions('Add a keyword')
     d(text="Enter new keyword").set_text("New Keyword")
     d.click(650,1130)
     # Step 2
     d(description = 'Search').click.wait(timeout = 1000)
     # Step 3
     d(resourceId = 'com.intel.android.gallery3d:id/search_src_text').click.wait()
     d(resourceId = 'com.intel.android.gallery3d:id/search_src_text').set_text('New Keyword')
     # confirm searched item
     assert d(text = 'New Keyword').wait.exists
Пример #52
0
 def selectImages(self,selectCount):
     d.swipe(FIRSTITEM_X,FIRSTITEM_Y,FIRSTITEM_X + 1,FIRSTITEM_Y + 1)
     selectCount = selectCount - 1
     x = FIRSTITEM_X
     y = FIRSTITEM_Y + FIRSTITEM_Y
     while selectCount > 0:
         d.click(x, y)
         time.sleep(1)
         y = y + FIRSTITEM_Y
         #When y touch the boundry it means that it need swiching y back to the top
         if y > BODY_BOUNDS['bottom']:
             x = x + UNIT_WIDTH
             y = FIRSTITEM_Y
         #When x touch the boundry, it means that the images on the screen have all been highlighted. Need slide screen to a new page(without selected)
         if x > BODY_BOUNDS['right']:
             for i in range(0,COLUMN_MAX):
                 d.swipe(UNIT_WIDTH*2, FIRSTITEM_Y, UNIT_WIDTH, FIRSTITEM_Y, steps = 20)
                 time.sleep(1)
             #Reset x, y
             x = FIRSTITEM_X
             y = FIRSTITEM_Y
         selectCount = selectCount - 1    
 def testAddKeywordsToAlbum(self):
     """
     Summary: Add keywords
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album to select it
     3. Tap Extra Menu
     4. Tap Add keywords option
     5. Input keywords
     6. Tap Save button
     7. Exit SocialGallery app
     """
     # Step 2 
     self._longtouchscreencenter()
     # Step 3 + Step 4
     u.setMenuOptions('Add a keyword')
     # Step 5
     d(text="Enter new keyword").set_text("New Keyword")
     # Step 6
     d.click(650,1130)
     # confirm add keywords
     self._longtouchscreencenter()
     u.setMenuOptions('Add a keyword')
     assert d(text = 'New Keyword').wait.exists
Пример #54
0
 def _enterBurstView(self):
     '''
     Enter the burst view...
     '''
     time.sleep(1)
     #d.expect('100ANDRO.png')
     d.click(370, 720)
     time.sleep(1)
     #d.expect('burst.png')
     d.click(350, 660)
     time.sleep(2)
     #d.expect('burstview.png')
     d.click(324, 100)
     #d.expect('GalleryBST.png')
     time.sleep(1)
Пример #55
0
 def tapOnCenter(self):
     time.sleep(2)
     d.click(550,1100)
     time.sleep(2)
Пример #56
0
 def _tapOnDoneButton(self):
     #Touch on Done button on the soft keyboard
     d.click(650, 1130)
Пример #57
0
 def _tapOnDoneButton(self):
     #Touch on Done button on the soft keyboard
     d.click(1100, 1660)
Пример #58
0
 def _clickCaptureMode(self):
     # mode image center coordinate (2195,975)
     d.click(2195, 910)
Пример #59
0
    def setCameraOption(self, optiontext, option):
        '''
           ***Usage***
            To set Scenes as 'sports':
                self.setCameraOption('Scenes','sports')

                You may need use the arguements that have been defined at the top of this file
        '''
        d(resourceId='com.intel.camera22:id/camera_settings').click.wait()
        while not d(resourceId='com.intel.camera22:id/setting_item_name'
                    ).wait.exists(timeout=2000):
            d(resourceId='com.intel.camera22:id/camera_settings').click.wait()
        trytimes = 1
        while d(text=optiontext).wait.gone(timeout=3000) and trytimes < 5:
            self._slideSettingListUp()
            trytimes = trytimes + 1
        newoptiontext = optiontext.replace(' ', '_')
        cated_0_0 = int(
            commands.getoutput(
                'adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0_0.xml | wc -l'
            ))
        cated_0 = int(
            commands.getoutput(
                'adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0.xml | wc -l'
            ))
        #print '_0_0.xml wc -l = %s' %cated_0_0 + ' and _0.xml wc -l = %s' %cated_0
        #If it is the first time launching camera, there are only 4 lines in _0_0.xml. Need more logic.
        if cated_0_0 <= 4 or cated_0 <= 9:
            currentoption = DEFAULT_OPTION[newoptiontext]
            currentindex = DICT_OPTION_NAME[newoptiontext].index(currentoption)
            targetindex = DICT_OPTION_NAME[newoptiontext].index(option)
            diffindex = abs(currentindex - targetindex)
            # if currentindex > targetindex:
            #     self._slideOptionLeftToRight(optiontext, diffindex)
            # elif currentindex < targetindex:
            #     self._slideOptionRightToLeft(optiontext, diffindex)
            if currentindex != targetindex:
                d.click(
                    self._getFirstItem() +
                    self._getOptionWidthAndHeight()[0] * targetindex,
                    self._getOptionOrdinate(optiontext))
                d.click(1000, 500)
            else:
                #Neither higher nor lower than the target option, that means the current option is just the target one.
                #d(resourceId = 'com.intel.camera22:id/mini_layout_view').click.wait()
                d.click(1000, 500)
        else:
            #Get the current option
            if newoptiontext == 'Video_Size':
                stringcatedone = commands.getoutput(
                    'adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0_0.xml | grep %s'
                    % DICT_OPTION_KEY[newoptiontext][0])
                stringcatedtwo = commands.getoutput(
                    'adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0_0.xml | grep %s'
                    % DICT_OPTION_KEY[newoptiontext][1])
                currenthighspeed = ((
                    stringcatedone.split('value=\"')[1]).split('\"'))[0]
                currentqualitykey = ((
                    stringcatedtwo.split('>')[1]).split('<'))[0]
                currentoption = [currenthighspeed, currentqualitykey]
            else:
                if newoptiontext not in SETTINGS_0:
                    stringcated = commands.getoutput(
                        'adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0_0.xml | grep %s'
                        % DICT_OPTION_KEY[newoptiontext])
                    currentoption = ((stringcated.split('>')[1]).split('<'))[0]
                else:
                    stringcated = commands.getoutput(
                        'adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0.xml | grep %s'
                        % DICT_OPTION_KEY[newoptiontext])
                    currentoption = ((stringcated.split('>')[1]).split('<'))[0]
            #Get the current option's index and compare it with the target option
            currentindex = DICT_OPTION_NAME[newoptiontext].index(currentoption)
            targetindex = DICT_OPTION_NAME[newoptiontext].index(option)
            diffindex = abs(currentindex - targetindex)
            #Settinglayout do change UI very much, so need one more logic
            settinglayout = commands.getoutput(
                'adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0.xml | grep pref_settings_layout_key'
            )
            if settinglayout.find('Large') != -1:
                if currentindex != targetindex:
                    d.click(
                        self._getFirstItem() +
                        self._getOptionWidthAndHeight()[1] * targetindex,
                        self._getOptionOrdinate(optiontext))
                # else:
                # d(resourceId = 'com.intel.camera22:id/mini_layout_view').click.wait()
            else:
                #If current option is just the target option, do nothing('pass').
                if currentindex > targetindex:
                    self._slideOptionLeftToRight(optiontext, diffindex)
                elif currentindex < targetindex:
                    self._slideOptionRightToLeft(optiontext, diffindex)
                else:
                    #Neither higher nor lower than the target option, that means the current option is just the target one.
                    d(resourceId='com.intel.camera22:id/mini_layout_view'
                      ).click.wait()