* Test plan for component: camera-app

Dependents/Clients

Test Plan

This test plan is not supposed to be complete; use it to guide your manual testing so they dont miss big functional areas that are part in the component; also this should be used as guideline to inspire the exploratory testing which should be adapted smartly based on the real content of a MP

Test Flash

Before performing any of these tests, the appplication settings file: adb shell "rm -rf /home/phablet/.config/com.ubuntu.camera/"

A. Switching recording mode - is flash set properly?

  1. ensure you are in picture mode
  2. set flash mode to force flash < shoot < ensure flash fires

  3. switch mode to video recording < verify torch is off while recording

  4. turn torch on < verify torch is on when recording

  5. switch mode to picture < shoot < ensure flash fires

  6. switch mode to video recording < verify torch is on while recording

B. Switching camera - is flash set properly? https://bugs.launchpad.net/camera-app/+bug/1479638

  1. ensure the current camera is the back-facing camera
  2. set flash mode to force flash < shoot < ensure flash fires

  3. switch to the front-facing camera
  4. switch to the back-facing camera < shoot < ensure flash fires

C. Suspend app then resume app - is flash set properly? https://bugs.launchpad.net/camera-app/+bug/1517450

  1. ensure you are in recording mode
  2. set flash mode to torch < ensure torch is on

  3. switch away from the app then go back to the app
  4. ensure torch is on

D. Video recording light and focusing interact properly? https://bugs.launchpad.net/canonical-devices-system-image/+bug/1424740

  1. switch to video recording
  2. set focus mode to torch < ensure torch is on while recording

  3. tap to focus < ensure torch is on while recording

E. Correct flash mode at startup

  1. run the app < ensure you are in picture mode and flash is set to auto

  2. cover the camera with your hand as to make the picture dark and shoot < ensure flash fires

  3. switch to video recording mode < ensure torch is off

  4. record and ensure torch is off while recording

F. Correct flash mode at startup - with settings

  1. turn flash to forced flash
  2. switch to recording mode < turn torch on

  3. restart the app
  4. ensure you are in picture mode and flash is set to forced flash
  5. shoot < ensure flash does fire

  6. switch to video recording mode < ensure torch is on

  7. record and ensure torch is on while recording

Stress Testing

Create a library of thousands of photos to do performance testing. Helper script to duplicate a given photo 2000 times:

for n in $(seq -w 2000); do cp <reference_picture>.jpg ~/Pictures/com.ubuntu.camera/picture_${n}.jpg; done

for n in $(seq -w 2000); do cp <reference_picture>.jpg /media/phablet/<someId>/Pictures/com.ubuntu.camera/picture_${n}.jpg; done

Several stories need testing in this scenario:

  1. Opening up the app should not show any sort of lag or freeze and the photo roll should have a loading message
  2. Deleting all the 2000 photos from the photo roll should be relatively quick, no more than 2-3 seconds
  3. Taking a picture should be as quick as if there were very few photos in the library; no more than 1 second once focused and without flash

Thumbnails

  1. Open camera-app and take a picture in portrait mode using the back camera.
  2. Swipe to the left to view the image in the photo roll. Make sure the image has the expected aspect ratio (compare this image to what the camera-app's viewfinder shows live)
  3. In the upper right hand corner, tap the thumbnail view icon (a square with several smalls squares in a grid within it)
  4. Make sure the thumbnail has the same expected aspect ratio as the full image.
  5. On an Ubuntu desktop machine, navigate to Pictures/com.ubuntu.camera (device MTP) in Nautilus. Make sure that the thumbnail icon has the same expected aspect ratio as the full image and the thumbnail in photo roll on the device.

Repeat the same steps above for a landscape image. Repeat the same steps above for the front camera in both portrait and landscape.

  1. Run camera-app
  2. Swipe to reveal the photo roll. Switch to gallery/grid mode
  3. Open a shell to the device and run "top"
  4. Verify that camera-app is not continuously using CPU (it might sometimes appear in the list for a few milliseconds, but it should not stay in the list permanently)

Video Recording

Portrait

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in portrait mode
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait (should be full screen). Make sure that the video switches to landscape when rotating the phone's orientation to landscape. Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

90 Degree Landscape

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in landscape mode (i.e. start in portrait, rotate 90 degrees counter clockwise)
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait. Make sure that the video switches to landscape when rotating the phone's orientation to landscape (should be full screen). Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

180 Degree Portrait

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in portrait mode
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait (should be full screen). Make sure that the video switches to landscape when rotating the phone's orientation to landscape. Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

270 Degree Landscape

  1. Open camera-app and switch to video recording mode for the back camera
  2. Hold the camera in landscape mode (i.e. start in portrait, rotate 90 degrees counter clockwise)
  3. Tap the recording button and move the phone left to right, then top to bottom
  4. Tap the recording button to stop recording
  5. Swipe to the left in the viewfinder until the just recorded video is visible
  6. Tap the video to begin playback, make sure that the video orientation is in portrait if you hold the phone in portrait. Make sure that the video switches to landscape when rotating the phone's orientation to landscape (should be full screen). Make sure that the recorded movements (i.e. left to right, top to bottom) show as expected and are not mirrored.

Repeat all 4 orientations for the front camera.

Video Scope Thumbnail

  1. Start a new video recording
  2. Stop video recording
  3. Swipe out of the camera-app and over to the video scope
  4. Make sure the video that you just recorded shows a thumbnail in the scope.

Low disk space The camera-app will warn the user if free disk space falls below 200MB but still allow video recording/photo taking until 50MB or less are available. Not recording/photos will be allowed when under the 50MB threshold and existing recordings in progress will stop when the threshold is hit.

  1. Use the following command to reduce your disk space to less than 200MB but greater than 50MB. df -kh command will show how much space you have available in your /home partition.

fallocate -l <amount>M|G testfile.txt
  1. Launch the camera-app and verify warning displayed but camera controls still functional
  2. Start recording a video. Monitor available disk space by using 'df -kh'. When 50MB threshold reached, verify video recording is stopped and a message is displayed to the user.
  3. Verify camera recording controls are disabled
  4. Swipe to the photo roll. Verify you can play back your video.
  5. Now delete the video using the UI
  6. Return to the viewfinder and verify camera recording controls are enabled.

Trust Prompt

To begin each section below, execute the following to reset the camera trust store state:

rm -rf ~/.local/share/PulseAudio
rm -rf ~/.local/share/CameraService
restart cameraservice-trust-stored
restart pulseaudio-trust-stored

Still Image

  1. Start the camera-app, it should ask if the camera-app can access the camera.
  2. Press deny - it should block the camera-app from being able to use the camera. The preview window should be black and the image capture button should be disabled.
  3. Ensure that a dialog informing of the missing permissions appears as soon as the previous dialog is closed.
  4. Press the "Edit permissions" button on the dialog.
  5. Ensure that System Settings->Security & Privacy screen appears.

  6. Go to other app access->Camera - tick the checkbox for camera so that it is enabled.

  7. Switch back to camera-app and verify that no permissions pupup is displayed, the preview window is capturing live data from the camera and that the image capture button is enabled.
  8. Take a picture and verify that it's valid by swiping right to left into the photo roll.

Video Recording

  1. Start the camera-app, it should ask if the camera-app can access the camera.
  2. Press deny - it should block the camera-app from being able to use the camera. The preview window should be black and the recording button should be disabled.
  3. Ensure that a dialog informing of the missing permissions appears as soon as the previous dialog has closed.
  4. Press the "Edit permissions" button on the dialog.
  5. Ensure that System Settings->Security & Privacy screen appears.

  6. Go to other app access->Camera - tick the checkbox for camera so that it is enabled.

  7. Switch back to camera-app and verify that the preview window is capturing live data from the camera and that the image capture button is enabled.
  8. Start recording, camera-app should ask if the camera-app can access the microphone.
  9. Press deny - it should allow you to still record a valid video but without any audio
  10. Record a video without audio and swipe right to left to the video in the photo roll once finished recording. Verify that this video plays successfully and has no audio.
  11. Restart camera-app, and enter System Settings->Security & Privacy->Other app access->Mic - tick the checkbox for camera so that mic access is enabled.

  12. Record a video and swipe right to left to the video in the photo roll once finished recording. Verify that this video plays successfully and has audio.
  13. Repeat steps 6-9 again but this time wait > 30s before pressing deny or allow on the trust prompt. Verify that everything works as expected like noted above.

Front Camera

Take pictures when requested by other apps

Without camera running

  1. Ensure camera-app is not running
  2. Run messaging app
  3. Create a new message and press the "camera" button at the side of the input field
  4. Choose camera as source
  5. Ensure that camera app is launched, switched to photo capture, and that the button to switch to video recording is disabled
  6. Press the shutter button to take a picture. Ensure the review panel appears.
  7. Press the center "checkmark" button and verify that the picture is correctly sent to messaging app

With camera running

  1. Launch camera app
  2. Switch to video recording
  3. Run messaging app
  4. Create a new message and press the "camera" button at the side of the input field
  5. Choose camera as source
  6. Ensure that camera app is launched, switched to photo capture, and that the button to switch to video recording is disabled
  7. Press the shutter button to take a picture. Ensure the review panel appears.
  8. Press the center "checkmark" button and verify that the picture is correctly sent to messaging app

Read only SD card

Prepare a fake SD card file system to be mounted

  dd if=/dev/zero of=fatimage bs=1M count=210
  mkfs.vfat -F 32 -v fatimage

Mount it where camera-app expects it and ensure the Pictures directory is present (normally ciborium creates it when mounting the card)

  sudo mkdir -p /media/phablet/sd
  sudo mount -t vfat -o loop,uid=phablet,gid=phablet fatimage /media/phablet/sd
  mkdir /media/phablet/sd/Pictures

Now perform the following test:

  1. Run camera
  2. Open the options menu and verify that the "SD" icon is present
  3. Click on it and select "Save to SD card"
  4. Verify that no alert messages appear
  5. Shoot a picture and verify that it is present in /media/phablet/sd/Pictures/
  6. sudo mount -t vfat -o remount,ro,loop,uid=phablet,gid=phablet fatimage /media/phablet/sd
  7. Open the options menu and select "SD"
  8. Click on "Save internally" then again on "Save to SD card"
  9. Verify that a dialog appears notifying that "External storage not writeable"

When done:

   sudo umount /media/phablet/sd
   sudo rm -rf /media/phablet

Device Specific Testing

Arale

* Flickering header on top of share popover:

  1. Swipe right to photo roll
  2. Open menu and tap on 'Share'
  3. Share popover should be cover the photo roll entirely and the photo roll header should not be visible

Process/Merges/TestPlan/camera-app (last edited 2016-02-25 13:53:49 by localhost)