Example #1
0
 def testCancelDeleteAllAlbum(self):
     """
     Summary: Cancel Delete all album
     Steps: 
     1. Launch SocialGallery app
     2. Long tap on an album to select it
     3. Tap Select Album Dropdown
     4. Select Select all option to select all the albums
     5. Tap Delete icon
     6. Tap Cancel Delete option
     7. Exit SocialGallery app
     """
     # Step 2
     d.swipe(550, 1100, 551, 1101)
     # Step 3
     d(text='1 selected').click()
     # Step 4
     d(text='Select all').click()
     # Step 5 + Step 6
     u.deleteItem('Cancel')
     # confirm Cancel 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!')
Example #2
0
def inputCode():
    d(resourceId="com.android.systemui:id/key1").click()
    d(resourceId="com.android.systemui:id/key2").click()
    d(resourceId="com.android.systemui:id/key3").click()
    d(resourceId="com.android.systemui:id/key4").click()
    time.sleep(2)
    d(resourceId="com.android.systemui:id/key_enter").click()
Example #3
0
 def testTurnOffOnUpdateNotification(self):
     """
     Summary: Turn off/on Update Notification in SocialGallery settings.
     Steps: 
     1. Launch SocialGallery app
     2. Press menu
     3. Tap Settings
     4. Tap Update Notifications to turn it off
     5. Tap Update Notifications to turn it on
     6. Exit SocialGallery app
     """
     # Step 2 + Step 3
     u.setMenuOptions('Settings')
     # step 4
     d(text='Update Notification').click()
     result = commands.getoutput(
         'adb shell cat data/data/com.intel.android.gallery3d/shared_prefs/SocialGallery2.0_Pref.xml | grep background_fr_notification'
     )
     if result.find('false') == -1:
         self.fail('turn Update Notification failed')
     # step 5
     d(text='Update Notification').click()
     time.sleep(2)
     result = commands.getoutput(
         'adb shell cat data/data/com.intel.android.gallery3d/shared_prefs/SocialGallery2.0_Pref.xml| grep background_fr_notification'
     )
     if result.find('true') == -1:
         self.fail('turn Update Notification failed')
 def tearDown(self):
     super(GalleryTest,self).tearDown()
     u.pressBack(4)
     #Discard sharing action
     if d(text = 'OK').wait.exists(timeout = 2000):
         d(text = 'OK').click.wait()
     u.pressBack(4)
Example #5
0
 def testSwitchSong(self):
     """
     launch  app store and exit
     """
     for i in xrange(8):
         d.press('right')
     assert d(text="网络电台").exists, 'FM app icon not found!'
     d(text="网络电台").click.wait()
     assert d(resourceId='com.xiaomi.mimusic:id/play_btn').wait.exists(
         timeout=20000), 'Open FM failed!'
     d.sleep(10)
     assert d(resourceId='com.xiaomi.mimusic:id/title').child(
         className="android.widget.TextView"
     ).exists, 'song play screen not found!'
     first_song_name = d(resourceId='com.xiaomi.mimusic:id/title').child(
         className="android.widget.TextView").info['text']
     d.press('right')
     d.sleep(15)
     assert d(resourceId='com.xiaomi.mimusic:id/title').child(
         className="android.widget.TextView"
     ).exists, 'song play screen not found!'
     second_song_name = d(resourceId='com.xiaomi.mimusic:id/title').child(
         className="android.widget.TextView").info['text']
     assert not second_song_name == first_song_name, 'switch song failed!'
     d.press('right')
     d.sleep(15)
     assert d(resourceId='com.xiaomi.mimusic:id/title').child(
         className="android.widget.TextView"
     ).exists, 'song play screen not found!'
     third_song_name = d(resourceId='com.xiaomi.mimusic:id/title').child(
         className="android.widget.TextView").info['text']
     assert not third_song_name == second_song_name, 'switch song failed!'
     d.press('back')
     d.sleep(2)
     d.press('back')
Example #6
0
 def _launchMMS(self):
     commands.getoutput(
         'adb shell am start -n com.android.mms/.ui.ConversationList')
     time.sleep(1)
     d(resourceId='com.android.mms:id/action_compose_new').click.wait()
     assert d(resourceId='com.android.mms:id/send_button_sms').wait.exists(
         timeout=3000), 'enter MMS send screen fail'
Example #7
0
 def testPlayLocalVideo(self):
     """
     launch  app store and exit
     """
     for i in xrange(5):
         d.press('right')
     assert d(text="高清播放器").exists, 'Media Explorer icon not found!'
     d(text="高清播放器").click.wait()
     assert d(resourceId='com.xiaomi.mitv.mediaexplorer:id/entry_name', text='设备').wait.exists(timeout=5000), 'launch Media Explorer failed!'
     assert d(resourceId='com.xiaomi.mitv.mediaexplorer:id/entry_name', text="视频").wait.exists(timeout=5000), 'launch Media Explorer failed!'
     d.press('right')
     d.sleep(2)
     d.press('right')
     d.sleep(2)
     d.press('down')
     d.sleep(2)
     d.press('enter')
     assert d(resourceId='com.xiaomi.mitv.mediaexplorer:id/device_label', text="移动存储设备").wait.exists(timeout=10000), 'enter Device list screen failed!'
     d.press('enter')
     assert d(className="android.widget.ListView").child(text="视频").wait.exists(timeout=10000), 'enter USB device list failed!'
     d.press('enter')
     assert d(className="android.widget.ListView").child(resourceId="com.xiaomi.mitv.mediaexplorer:id/iv_image").wait.exists(timeout=10000), 'enter USB device video list failed!'
     for i in xrange(16):
         for j in xrange(random.randint(0, 16)):
             d.press('down')
             d.sleep(1)
         for k in xrange(random.randint(0, 8)):
             d.press('up')
             d.sleep(1)
         d.press('enter')
         assert d(className="android.widget.ListView").child(resourceId="com.xiaomi.mitv.mediaexplorer:id/iv_image").wait.gone(timeout=10000), 'start to play video failed!'
         d.sleep(600)
         d.press('back')
         assert d(className="android.widget.ListView").child(resourceId="com.xiaomi.mitv.mediaexplorer:id/iv_image").wait.exists(timeout=10000), 'enter USB device video list failed!'
 def tearDown(self):
     super(GalleryTest, self).tearDown()
     u.pressBack(4)
     #There will be a dialog ask user if save the edited photo when pressing back after case failed
     if d(text='Cancel').wait.exists(timeout=2000):
         d(text='Cancel').click.wait()
     u.pressBack(4)
Example #9
0
 def setUp(self):
     super(CameraTest, self).setUp()
     self._launchCamera()
     time.sleep(2)
     if d(text='OK').wait.exists(timeout=3000):
         d(text='OK').click.wait()
     sm.switchCaptureMode('burstfast')
Example #10
0
 def testAnimateToVideoAllInGridView(self):
     """
     Summary: Animate all 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 Convert option
     8.Select the video convert settings
     9.Tap animate button
     10.Tap Save button
     """
     # 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('Animate')
     d(text = 'Video').click()
     d(text = 'Create').click()
     time.sleep(10)
     d(text = 'Save').click.wait()
     time.sleep(2)
     # confirm create complete
     result = commands.getoutput('adb shell ls -l /sdcard/Sharing | grep mp4 | wc -l')
     if string.atoi(result) != 1:
         raise Exception('animated failed')
 def setUp(self):
     super(CameraTest,self).setUp()
     self._launchCamera()
     time.sleep(2)
     if d(text = 'OK').wait.exists(timeout = 3000):
         d(text = 'OK').click.wait()        
     sm.switchCaptureMode('burstslow')
Example #12
0
 def switchBackOrFrontCamera(self,status):
     d(description = FRONTBACKBUTTON_DESCR).click.wait()
     #Dictionary
     camerastatus = {'back': '0','front':'1'}  
     # Get the current camera status
     currentstatus = commands.getoutput(CAMERA_ID)
     # Confirm the current status of the user is required
     if currentstatus.find(camerastatus.get(status)) == -1:
         # draw down the menu
         commands.getoutput(DRAWDOWN_MENU)
         time.sleep(1)
         # set the camera status
         d(description = FRONTBACKBUTTON_DESCR).click.wait()
         time.sleep(3)
         # Get the current camera status
         currentstatus = commands.getoutput(CAMERA_ID)
         # check the result
         if currentstatus.find(camerastatus.get(status)) != -1:
             print ('set camera is '+status)
             return True
         else:
             print ('set camera is '+status+' fail')
             return False
     else:
         print('Current camera is ' + status)
Example #13
0
 def _setFDFRMode(self,option):
     d(resourceId = 'com.intel.camera22:id/left_menus_face_tracking').click()
     FDFRStatus = commands.getoutput('adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0.xml | grep pref_fdfr_key')
     if FDFRStatus.find(option) == -1:
         d(resourceId = 'com.intel.camera22:id/left_menus_face_tracking').click()
     else:
         pass
Example #14
0
	def setUp(self):
		u.setUp()
		#Launch music player
		d.start_activity(component='com.smartisanos.music/.activities.MusicMain')
		assert d(resourceId = 'com.smartisanos.music:id/ib_right').wait.exists(timeout=5000),'Launch music player failed in 5s!'
		d(text = '歌曲',resourceId = 'com.smartisanos.music:id/rb_song').click.wait()
		assert d(resourceId = 'com.smartisanos.music:id/tv_title',text = '歌曲').wait.exists(timeout = 5000),'Switch to music list failed in 5s!'
Example #15
0
def tearDown():
	for i in xrange(2):
		d.press('back')
	if d(textContains = '退出').exists:
		d(text = '确定').click()
	d.press('home')
	checkSystemWatchers()
Example #16
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()
Example #17
0
 def _launchCamera(self):
     d.start_activity(component=ACTIVITY_NAME)
     #When it is the first time to launch camera there will be a dialog to ask user 'remember location', so need to check
     if d(text='OK').wait.exists(timeout=2000):
         d(text='OK').click.wait()
     assert d(resourceId='com.intel.camera22:id/mode_button').wait.exists(
         timeout=3000), 'Launch camera failed in 3s'
 def tearDown(self):
     super(GalleryTest,self).tearDown()
     u.pressBack(4)
     #There will be a dialog ask user if save the edited photo when pressing back after case failed
     if d(text = 'Cancel').wait.exists(timeout = 2000):
         d(text = 'Cancel').click.wait()
     u.pressBack(4)
Example #19
0
 def testLaunchAndExitMiracast(self):
     for i in xrange(4):
         d.press('right')
     assert d(text="无线显示").exists, 'Miracast icon not found!'
     d(text="无线显示").click.wait()
     d.press('back')
     assert d(text="无线显示").wait.exists(timeout=10000), 'exit from Miracast failed!'
 def _recognizeAFace(self):
     #Face recognize
     u.tapOnCenter() #Tap on the face
     time.sleep(2)
     u.tapOnCenter() #Tap on the contact on the screen center
     if d(text = 'Crop').wait.exists(timeout = 2000):
         d(text = 'Crop').click.wait()
Example #21
0
 def testSwitchSong(self):
     """
     launch  app store and exit
     """
     for i in xrange(8):
         d.press('right')
     assert d(text="网络电台").exists, 'FM app icon not found!'
     d(text="网络电台").click.wait()
     assert d(resourceId='com.xiaomi.mimusic:id/play_btn').wait.exists(timeout=10000), 'Open FM failed!'
     d.sleep(10)
     assert d(resourceId='com.xiaomi.mimusic:id/title').child(className="android.widget.TextView").exists, 'song play screen not found!'
     first_song_name = d(resourceId='com.xiaomi.mimusic:id/title').child(className="android.widget.TextView").info['text']
     d.press('right')
     d.sleep(15)
     assert d(resourceId='com.xiaomi.mimusic:id/title').child(className="android.widget.TextView").exists, 'song play screen not found!'
     second_song_name = d(resourceId='com.xiaomi.mimusic:id/title').child(className="android.widget.TextView").info['text']
     assert not second_song_name == first_song_name, 'switch song failed!'
     d.press('right')
     d.sleep(15)
     assert d(resourceId='com.xiaomi.mimusic:id/title').child(className="android.widget.TextView").exists, 'song play screen not found!'
     third_song_name = d(resourceId='com.xiaomi.mimusic:id/title').child(className="android.widget.TextView").info['text']
     assert not third_song_name == second_song_name, 'switch song failed!'
     d.press('back')
     d.sleep(2)
     d.press('back')
Example #22
0
 def _recognizeAFace(self):
     #Face recognize
     u.tapOnCenter()  #Tap on the face
     time.sleep(2)
     u.tapOnCenter()  #Tap on the contact on the screen center
     if d(text='Crop').wait.exists(timeout=2000):
         d(text='Crop').click.wait()
Example #23
0
 def launchGallery(self):
     d.start_activity(component = ACTIVITY_NAME)
     if d(text = 'Camera Roll').wait.exists(timeout = 3000):
         d(text = 'Camera Roll').click.wait()
         d(text = 'Albums').click.wait()
         self.setMenuOptions('Sort by name, A-Z')
     time.sleep(1) #Switch filter may take a few seconds
Example #24
0
 def testPlayVideoOnline(self):
     #d.start_activity('--activity-clear-task', component='com.duokan.duokantv/.MainActivity')
     assert d(text="在线影视").exists, 'Online Video icon not found!'
     d(text="在线影视").sibling(className='android.view.View').click.wait()
     #menu_hot_highlight_focus_png =  os.path.join(PIC_DIR, 'menu_hot_highlight_focus.png')
     #menu_hot_highlight_nofocus_png  =  os.path.join(PIC_DIR, 'menu_hot_highlight_nofocus.png')
     #preview_shoucang_png =  os.path.join(PIC_DIR, 'video_preview_sub_shoucang.png')
     #preview_pinglun_png =  os.path.join(PIC_DIR, 'video_preview_sub_pinglun.png')
     if  d.find('menu_hot_highlight_focus.png', timeout=30) :
         d.press('down')
         d.sleep(2)
         d.press('enter') 
     elif  d.find('menu_hot_highlight_nofocus.png', timeout=30):
         d.press('enter')
     else:
         assert False, 'launch video failed'  
     d.expect('video_preview_sub_shoucang.png', timeout=30)
     d.sleep(2)
     d.press('enter')
     assert d(resourceId='com.duokan.duokantv:id/main_frame').wait.exists(timeout=30000), 'video not start!'
     #assert not d.find('video_preview_sub_shoucang.png', timeout=30), 'video not start!'
     d.sleep(120)
     d.press('back')
     d.expect('video_preview_sub_shoucang.png', timeout=30)
     d.press('back')
Example #25
0
 def testAnimateToGIFAllInGridView(self):
     """
     Summary: Animate all 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 Convert option
     8.Select the GIF convert settings
     9.Tap animate button
     10.Tap Save button
     """
     # Step 3
     self._longtouchscreencenter()
     # Step 4 + Step 5
     d(text = '1 selected').click()
     d(text = 'Select all').click()
     # Step 6 + Step 7
     u.setMenuOptions('Animate')
     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')
Example #26
0
 def testAnimateToGIFAllInGridView(self):
     """
     Summary: Animate all 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 Convert option
     8.Select the GIF convert settings
     9.Tap animate button
     10.Tap Save button
     """
     # Step 3
     self._longtouchscreencenter()
     # Step 4 + Step 5
     d(text = '1 selected').click()
     d(text = 'Select all').click()
     # Step 6 + Step 7
     u.setMenuOptions('Animate')
     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')
Example #27
0
 def testPlayVideoOnline(self):
     #d.start_activity('--activity-clear-task', component='com.duokan.duokantv/.MainActivity')
     assert d(text="在线影视").exists, 'Online Video icon not found!'
     d(text="在线影视").sibling(className='android.view.View').click.wait()
     #menu_hot_highlight_focus_png =  os.path.join(PIC_DIR, 'menu_hot_highlight_focus.png')
     #menu_hot_highlight_nofocus_png  =  os.path.join(PIC_DIR, 'menu_hot_highlight_nofocus.png')
     #preview_shoucang_png =  os.path.join(PIC_DIR, 'video_preview_sub_shoucang.png')
     #preview_pinglun_png =  os.path.join(PIC_DIR, 'video_preview_sub_pinglun.png')
     if d.find('menu_hot_highlight_focus.png', timeout=30):
         d.press('down')
         d.sleep(2)
         d.press('enter')
     elif d.find('menu_hot_highlight_nofocus.png', timeout=30):
         d.press('enter')
     else:
         assert False, 'launch video failed'
     d.expect('video_preview_sub_shoucang.png', timeout=30)
     d.sleep(2)
     d.press('enter')
     assert d(resourceId='com.duokan.duokantv:id/main_frame').wait.exists(
         timeout=30000), 'video not start!'
     #assert not d.find('video_preview_sub_shoucang.png', timeout=30), 'video not start!'
     d.sleep(120)
     d.press('back')
     d.expect('video_preview_sub_shoucang.png', timeout=30)
     d.press('back')
Example #28
0
	def testVisitWebPage4G(self):
		# turn off wifi
		self._setWifistatus('off')
		d.sleep(3)

		#Launch Browser
		self._launchBrowser()
		# visite webpage
		d(resourceId = 'com.android.browser:id/url', text = '输入网址').set_text(TOP5[3])
		d.press('enter')
		d.expect(CHECK_POINT[3], timeout=15)
		# browse webpage
		d.swipe(1000,1300,1000,600,10)
		d.sleep(1)
		d.swipe(1000,1300,1000,600,10)
		d.sleep(1)
		d.swipe(1000,600,1000,1300,10)
		d.sleep(1)
		d.swipe(1000,600,1000,1300,10)
		d.sleep(1)

		# turn on wifi
		self._setWifistatus('on')
		d.start_activity(component='com.android.browser/.BrowserActivity')
		assert d(resourceId = 'com.android.browser:id/switch_btn').wait.exists(timeout = 5000),'Launch browser failed in 5s!'
 def _setFDFRMode(self,option):
     d(resourceId = 'com.intel.camera22:id/left_menus_face_tracking').click()
     FDFRStatus = commands.getoutput('adb shell cat /data/data/com.intel.camera22/shared_prefs/com.intel.camera22_preferences_0.xml | grep pref_fdfr_key')
     if FDFRStatus.find(option) == -1:
         d(resourceId = 'com.intel.camera22:id/left_menus_face_tracking').click()
     else:
         pass
 def tearDown(self):
     super(GalleryTest, self).tearDown()
     u.pressBack(4)
     #Discard sharing action
     if d(text='OK').wait.exists(timeout=2000):
         d(text='OK').click.wait()
     u.pressBack(4)
Example #31
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!')
Example #32
0
 def _setpictureas(self,option):
     '''
     if option == 'Wallpaper':
         d(text = 'com.intel.android.gallery3d').click()
     else:
     '''
     d(text = option).click()
Example #33
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)
Example #34
0
 def testLaunchAndExitMiracast(self):
     for i in xrange(4):
         d.press('right')
     assert d(text="无线显示").exists, 'Miracast icon not found!'
     d(text="无线显示").click.wait()
     d.press('back')
     assert d(text="无线显示").wait.exists(
         timeout=10000), 'exit from Miracast failed!'
 def testDeleteOneByOne(self):
     self._clearAndPush500Pic()
     u.launchGallery()
     u.enterXView('fullview')
     u.showPopCard()
     for i in range(2):
         u.setMenuOptions('Delete')
         d(text = 'Delete').click.wait() #Confirm it
Example #36
0
 def launchGallery(self):
     #d.start_activity(component = ACTIVITY_NAME)
     subprocess.Popen('adb shell am start -n '+ACTIVITY_NAME, stdout=subprocess.PIPE, shell=True)
     time.sleep(3)
     if d(text='Camera Roll').wait.exists(timeout=3000):
         d(text = 'Camera Roll').click.wait()
         d(text = 'Albums').click.wait()
     time.sleep(1) #Switch filter may take a few seconds
Example #37
0
 def test_open_close(self):
     u.recordcase(self.test_open_close, "FileManager.Priority1")
     for i in xrange(self.loop):
         self._launch_filemanager()
         time.sleep(2)
         d(resourceId="android:id/mwCloseBtn").click()
         time.sleep(2)
     u.log()
Example #38
0
 def _setPicAs(self, setact):
     d.press('menu')
     d(text='Set picture as').click.wait()
     setmode = {
         'contact': 'Contact photo',
         'wallpaper': 'com.intel.android.gallery3d'
     }
     d(text=setmode[setact]).click.wait()
Example #39
0
	def _swipeScreen(self,direction,step=None):
		if direction == 'left':
			d(resourceId = 'com.smartisanos.launcher:id/glview').swipe.left(steps=step)
		elif direction == 'right':
			d(resourceId = 'com.smartisanos.launcher:id/glview').swipe.right(steps=step)
		else:
			raise NameError
			print 'invalid string'
 def _SlideShowIconEditScreen(self,status):
     d(resourceId = 'com.intel.android.gallery3d:id/action_edit_burst').click.wait()
     time.sleep(1)
     d(resourceId = 'com.intel.android.gallery3d:id/selection_menu').click.wait()
     d(text = 'Select all').click.wait()
     d(className = 'android.widget.TextView').click.wait()
     d(text = status).click.wait()
     time.sleep(7) 
Example #41
0
 def switchcamera(self,mode):
     d(resourceId = MODE_LIST_BUTTON).click.wait()
     try:
         assert d(resourceId = 'com.intel.camera22:id/mode_wave_smile')
         self._touchmode(mode)
     except:
         d(resourceId = 'com.intel.camera22:id/mode_wave_photo').click()
         self._touchmode(mode)
Example #42
0
 def takeVideo(self, status):
     # Start record video
     d(resourceId=CPTUREBUTTON_RESOURCEID).click.wait()
     # Set recording time
     time.sleep(status - 2)
     #Stop record video
     d(resourceId=CPTUREBUTTON_RESOURCEID).click.wait()
     return True
Example #43
0
 def testDeleteOneByOne(self):
     self._clearAndPush500Pic()
     u.launchGallery()
     u.enterXView('fullview')
     u.showPopCard()
     for i in range(100):
         d(description='Delete').click.wait()
         d(text='Delete').click.wait()  #Confirm it
Example #44
0
 def _SlideShowIconEditScreen(self,status):
     d(resourceId = 'com.intel.android.gallery3d:id/action_edit_burst').click.wait()
     time.sleep(1)
     d(resourceId = 'com.intel.android.gallery3d:id/selection_menu').click.wait()
     d(text = 'Select all').click.wait()
     d(description = 'Slideshow').click.wait()
     d(text = status).click.wait()
     time.sleep(10) 
Example #45
0
 def takeVideo(self,status):
     # Start record video
     d(resourceId = CPTUREBUTTON_RESOURCEID).click.wait() 
     # Set recording time
     time.sleep(status - 2)
     #Stop record video
     d(resourceId = CPTUREBUTTON_RESOURCEID).click.wait() 
     return True
Example #46
0
 def tearDown(self):
     super(GalleryTest,self).tearDown()
     #4.Exit activity
     u.pressBack(4)
     #Force close tap on OK
     if d(text = 'OK').wait.exists(timeout = 2000):
         d(text = 'OK').click.wait()
         u.pressBack(4)
Example #47
0
 def tearDown(self):
     super(GalleryTest,self).tearDown()
     #4.Exit activity
     u.pressBack(4)
     #Force close tap on OK
     if d(text = 'OK').wait.exists(timeout = 2000):
         d(text = 'OK').click.wait()
         u.pressBack(4)
Example #48
0
 def switchcamera(self, mode):
     d(resourceId=MODE_LIST_BUTTON).click.wait()
     try:
         assert d(resourceId='com.intel.camera22:id/mode_wave_smile')
         self._touchmode(mode)
     except:
         d(resourceId='com.intel.camera22:id/mode_wave_photo').click()
         self._touchmode(mode)
Example #49
0
 def _touchmode(self, mode):
     if mode == 'burstslow':
         d(resourceId=MODE_ID[mode]).click.wait()
         d(text='SLOW').click.wait()
     elif mode == 'burstfast':
         d(resourceId=MODE_ID[mode]).click.wait()
         d(text='FAST').click.wait()
     else:
         d(resourceId=MODE_ID[mode]).click.wait()
Example #50
0
 def launchGallery(self):
     time.sleep(2)
     d.start_activity(component = ACTIVITY_NAME)
     time.sleep(2)
     #Confirm gallery launch successfully by the icon on left-top corner
     #assert d(packageName = PACKAGE_NAME).wait.exists(timeout = 3000), 'Gallery launch failed'
     if d(text = 'Camera Roll').wait.exists(timeout = 3000):
         d(text = 'Camera Roll').click.wait()
         d(text = 'Albums').click.wait()
     time.sleep(2)
Example #51
0
 def testCropPictureCancel(self):
     u._confirmResourceExists()
     u.launchGallery()
     u.enterXView('fullview')
     u.showPopCard()
     for i in range(100):
         u.setMenuOptions('Crop')
         assert d(text='Crop picture').wait.exists(timeout=3000)
         d(text='Cancel').click.wait()
         assert d(text='Crop').wait.gone(timeout=2000)
Example #52
0
 def _SlideShowIconEditScreen(self, status):
     d(resourceId='com.intel.android.gallery3d:id/action_edit_burst'
       ).click.wait()
     time.sleep(1)
     d(resourceId='com.intel.android.gallery3d:id/selection_menu'
       ).click.wait()
     d(text='Select all').click.wait()
     d(className='android.widget.TextView').click.wait()
     d(text=status).click.wait()
     time.sleep(7)
Example #53
0
 def testRotateAllInGridView(self):
     """
     Summary: rotate all in grid view
     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 Rotate left/Rotate right
     """
     # Step 3
     self._longtouchscreencenter()
     # Step 4 + Step 5
     d(text = '1 selected').click()
     d(text = 'Select all').click()
     # Step 6 + Step 7
     u.setMenuOptions('Rotate left')
     time.sleep(2)
     self._longtouchscreencenter()
     d(text = '1 selected').click()
     d(text = 'Select all').click()
     u.setMenuOptions('Rotate right')
     # confirm back to gallery
     assert d(description = 'Switch to camera').wait.exists(timeout = 2000)
Example #54
0
 def testSelectAllBusrtPicsConvertInEditView(self):
     """
     Summary:This case test select all burst pictures export to gallery in burst edit view.
     Precondition: There are burst pictures in sdcard
     Steps:
       1.Launch gallery activity 
       2.Enter Burst Edit View
       3.Select all pictures
       4.Tap extra menu icon
       5.Tap animate option
     """
     d(resourceId='com.intel.android.gallery3d:id/action_edit_burst'
       ).click.wait()
     time.sleep(1)
     d(resourceId='com.intel.android.gallery3d:id/selection_menu'
       ).click.wait()
     resultNO1 = commands.getoutput(STORAGE + 'gif' + ' | wc -l')
     d(text='Select all').click.wait()
     self._burstMenuOption('Animate marked', 'Animated GIF', 'Create')
     time.sleep(3)
     assert d(text='Save').wait.exists(timeout=3000), 'create picture fail'
     d(text='Save').click.wait()
     resultNO2 = commands.getoutput(STORAGE + 'gif' + ' | wc -l')
     if resultNO1 == resultNO2:
         self.fail('Create BST picture fail')
Example #55
0
 def setUp(self):
     super(CameraTest, self).setUp()
     # rm DCIM folder and refresh from adb shell
     a.cmd('rm', '/sdcard/DCIM/100ANDRO')
     a.cmd('refresh', '/sdcard/DCIM/100ANDRO')
     #Because default camera after launching is single mode, so we set this step in setUp().
     #Step 1. Launch single capture activity
     a.cmd('launch', 'com.intel.camera22/.Camera')
     time.sleep(2)
     if d(text='OK').wait.exists(timeout=3000):
         d(text='OK').click.wait()
Example #56
0
 def _launchemail(self):
     commands.getoutput(
         'adb shell am start -n com.android.email/.activity.Welcome')
     time.sleep(2)
     if d(text='Account setup').wait.exists(timeout=1000):
         #print 'login the email account'
         pass
     else:
         assert d(resourceId='com.android.email:id/compose').wait.exists(
             timeout=2000), 'enter email fail'
     time.sleep(1)
 def testSharePictureToBlueTooth(self):
     '''
         Summary: Share 1 picture in bluetooth
         Steps:   1.Enter full view
                  2.Click share icon
                  3.Click bluetooth icon
     '''
     u.shareItem('Bluetooth')
     if d(text = 'Turn on').wait.exists(timeout = 2000):
         d(text = 'Turn on').click.wait()
     assert d(text = 'Scan for devices').wait.exists(timeout = 2000)
Example #58
0
 def testUPIcon(self):
     u._confirmResourceExists()
     u.launchGallery()
     u.enterXView('fullview')
     u.showPopCard()
     for i in range(100):
         d(resourceId='android:id/home').click.wait()
         assert d(description='Switch to camera').wait.exists(timeout=2000)
         u.pressBack(4)
         u.launchGallery()
         u.enterXView('fullview')
         u.showPopCard()
Example #59
0
 def testChangeContactPhoto(self):
     '''
         Summary: Test change contact photo
         Steps:   1. Launch gallery and open a picture has recognized face
                  2. Tap on the face menu icon and select change contact photo
                  3. Click crop
     '''
     self._recognizeAFace()
     #Change contact photo
     self._editFDFR('Change contact photo')
     d(text='Crop').click.wait()
     assert d(description='Delete').wait.exists(timeout=2000)