Skip to content

Commit 7bdbf07

Browse files
committed
Merge branch 'develop_ios9' into ios9_come_back_full_screen_ipad
2 parents 8e64126 + 5e4e257 commit 7bdbf07

File tree

76 files changed

+508
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+508
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ DerivedData
1616
.idea/
1717
*.hmap
1818
*.xccheckout
19+
*.pyc
1920

2021
#CocoaPods
2122
Pods

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: objective-c
2-
osx_image: xcode6.4
2+
osx_image: xcode7
33
xcode_project: Owncloud iOs Client.xcodeproj
44
xcode_scheme: Owncloud iOs Client
55
xcode_sdk: iphonesimulator
66

77
before_install:
8-
- brew update
8+
- brew update; brew update

OCC2015_iOS_workshop.pdf

3.23 MB
Binary file not shown.

Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ - (void) manageDistinctFileOnPreview {
355355
DLog(@"ide file: %ld",(long)_file.idFile);
356356

357357
//Check if the file is in the device
358-
if (([_file isDownload] == notDownload) && _typeOfFile != otherFileType) {
358+
if ([_file isDownload] == notDownload) {
359359
//Download the file
360360
[self downloadTheFile];
361361
} else if (([_file isDownload] == downloading) || ([_file isDownload] == updating)) {

Owncloud iOs Client/Files/Preview/FilePreview/FilePreviewViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ - (void)handleFile {
477477
DLog(@"is Donwloaded: %ld",(long)_file.isDownload);
478478

479479
//Check if the file is in the device
480-
if (([_file isDownload] == notDownload) && _typeOfFile != otherFileType) {
480+
if ([_file isDownload] == notDownload) {
481481

482482
//Download the file
483483
[self downloadTheFile];
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Owncloud iOs Client/Tabs/FileTab/FilesViewController.m

+6-2
Original file line numberDiff line numberDiff line change
@@ -3166,9 +3166,13 @@ - (void) didSelectMoreOptions {
31663166
self.moreActionSheet = nil;
31673167
}
31683168

3169+
NSString *title = [self.selectedFileDto.fileName stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
3170+
31693171
if(_selectedFileDto.isDirectory) {
31703172

3171-
self.moreActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"rename_long_press", nil), NSLocalizedString(@"move_long_press", nil), nil];
3173+
title = [title substringToIndex:[title length]-1];
3174+
3175+
self.moreActionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"rename_long_press", nil), NSLocalizedString(@"move_long_press", nil), nil];
31723176
self.moreActionSheet.tag=200;
31733177

31743178
if (IS_IPHONE) {
@@ -3191,7 +3195,7 @@ - (void) didSelectMoreOptions {
31913195
favoriteOrUnfavoriteString = NSLocalizedString(@"favorite", nil);
31923196
}
31933197

3194-
self.moreActionSheet = [[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) destructiveButtonTitle: nil otherButtonTitles:NSLocalizedString(@"open_with_label", nil), NSLocalizedString(@"rename_long_press", nil), NSLocalizedString(@"move_long_press", nil), favoriteOrUnfavoriteString, nil];
3198+
self.moreActionSheet = [[UIActionSheet alloc]initWithTitle:title delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) destructiveButtonTitle: nil otherButtonTitles:NSLocalizedString(@"open_with_label", nil), NSLocalizedString(@"rename_long_press", nil), NSLocalizedString(@"move_long_press", nil), favoriteOrUnfavoriteString, nil];
31953199
self.moreActionSheet.tag=200;
31963200

31973201
if (IS_IPHONE) {

SETUP.md

+21-2

automation_Test/README.md

+89

automation_Test/actions.py

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# -*- coding: utf-8 -*-
2+
#!/usr/bin/env python
3+
4+
import time
5+
import os
6+
from time import sleep
7+
import constants as const
8+
import loginView
9+
import helpGuideView
10+
import filesView
11+
from appium import webdriver
12+
13+
def getWebDriver():
14+
wd = None
15+
desired_caps = {}
16+
desired_caps['appium-version'] = const.K_APPIUM_VER
17+
desired_caps['platformName'] = const.K_APP_PLATFORM_NAME
18+
desired_caps['platformVersion'] = const.K_APP_PLATFORM_VER
19+
desired_caps['deviceName'] = const.K_DEVICE_NAME
20+
desired_caps['app'] = os.path.dirname(os.path.realpath(__file__)) + const.K_APP_FILE_NAME
21+
wd = webdriver.Remote(const.K_WD_REMOTE_URL, desired_caps)
22+
wd.implicitly_wait(const.K_WD_EXPLICITY_WAIT)
23+
return wd
24+
25+
def doFirstLoginWith(self,server,user,password, ssl):
26+
driver = self.driver
27+
28+
skipButtonInHelpGuide = driver.find_elements_by_class_name(helpGuideView.skipButton_class)[helpGuideView.skipButton_index]
29+
self.assertEqual(skipButtonInHelpGuide.get_attribute("name"), helpGuideView.skipButton_name)
30+
skipButtonInHelpGuide.click()
31+
32+
doLoginWith(self,server,user,password,ssl)
33+
34+
def doLoginWith(self,server,user,password, ssl):
35+
driver = self.driver
36+
37+
user_field = driver.find_elements_by_class_name(loginView.user_field_class)[loginView.user_field_index]
38+
user_field.clear()
39+
user_field.set_value(user)
40+
41+
pass_field = driver.find_elements_by_class_name(loginView.pass_field_class)[loginView.pass_field_index]
42+
pass_field.clear()
43+
pass_field.set_value(password)
44+
45+
url_field = driver.find_elements_by_class_name(loginView.url_field_class)[loginView.url_field_index]
46+
url_field.clear()
47+
url_field.set_value(server)
48+
49+
table_view = driver.find_elements_by_class_name(loginView.table_view_class)[loginView.table_view_index]
50+
table_view.click()
51+
sleep(3)
52+
53+
if ssl == True:
54+
ok_button_alert_view = driver.find_element_by_xpath(loginView.ok_button_alert_view_xpath)
55+
ok_button_alert_view.click()
56+
sleep(3)
57+
58+
if ssl == True:
59+
text_to_check = loginView.secure_connection_name
60+
else:
61+
text_to_check = loginView.connection_name
62+
time_out = 60
63+
sleep_time = 1
64+
class_to_check = loginView.connection_field_class
65+
index_to_check = loginView.connection_field_index
66+
wait_until(check_values_by_name, time_out, sleep_time, driver, class_to_check, index_to_check, text_to_check)
67+
self.assertEqual(driver.find_elements_by_class_name(class_to_check)[index_to_check].get_attribute("name"), text_to_check)
68+
69+
login_button = driver.find_elements_by_class_name(loginView.login_button_class)[loginView.login_button_index]
70+
login_button.click()
71+
72+
def wait_until(some_method, timeout, period=0.25, *args, **kwargs):
73+
mustend = time.time() + timeout
74+
while time.time() < mustend:
75+
if some_method(*args, **kwargs): return True
76+
time.sleep(period)
77+
return False
78+
79+
def check_values_by_class_name(driver, class_name, exp_value):
80+
number_of_classes = len(driver.find_elements_by_class_name(class_name))
81+
if number_of_classes == exp_value: return True
82+
return False
83+
84+
def check_values_by_name(driver, class_name, index, exp_name):
85+
if driver.find_elements_by_class_name(class_name)[index].get_attribute("name") == exp_name: return True
86+
return False
87+
88+
def assert_is_in_files_view(self):
89+
sleep(1)
90+
91+
class_to_check = filesView.tabBar_class
92+
time_out = 20
93+
sleep_time = 1
94+
expected_class_found = 1
95+
wait_until(check_values_by_class_name, time_out, sleep_time, self.driver, class_to_check, expected_class_found)
96+
97+
self.assertTrue(check_values_by_class_name(self.driver, class_to_check, expected_class_found))
98+
99+
def assert_is_not_in_files_view(self):
100+
sleep(1)
101+
102+
class_to_check = filesView.tabBar_class
103+
time_out = 20
104+
sleep_time = 1
105+
expected_class_found = 0
106+
wait_until(check_values_by_class_name, time_out, sleep_time, self.driver, class_to_check, expected_class_found)
107+
108+
self.assertTrue(check_values_by_class_name(self.driver, class_to_check, expected_class_found))
109+

automation_Test/config.ini

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python
2+
#author : ownCloud, Inc.
3+
#description: description
4+
#copyright :Copyright (C) 2015, ownCloud, Inc. This code is covered by the GNU Public License Version 3. For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>.
5+
#version 1.0
6+
7+
[nosetests]
8+
verbosity = 2
9+
#Used to display print statements on console
10+
nocapture = 1
11+
#test only some modules with comma seperated values
12+
tests = loginTest.py,createFolderTest,

automation_Test/constants.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- coding: utf-8 -*-
2+
#!/usr/bin/env python
3+
4+
import os
5+
from datetime import datetime
6+
7+
#--Generic Variables for use through Appium connection
8+
K_APP_FILE_NAME = '/../../ownCloud.app'
9+
K_APPIUM_VER = '1.4.1'
10+
K_APP_PLATFORM_NAME = 'iOS'
11+
K_APP_PLATFORM_VER = '8.4'
12+
K_DEVICE_NAME = 'iPhone 6'
13+
14+
#--Webdriver property
15+
K_WD_EXPLICITY_WAIT = 20
16+
K_WD_REMOTE_URL = 'http://0.0.0.0:4723/wd/hub'
17+
18+
#--Result Files
19+
K_RST_FILE = '/Result/test.txt'
20+
K_RST_FILE_PATH = os.path.dirname(os.path.realpath(__file__)) + K_RST_FILE
21+
K_RST_HTML_FILE = '/result.html'
22+
K_RST_HTML_FILE_PATH = os.path.dirname(os.path.realpath(__file__)) + K_RST_HTML_FILE
23+
K_RST_PDF_FILE = 'Report'
24+
25+
#--Execption/Fails
26+
K_FILE_NOT_FOUND = 'File not found for given path %s'
27+
28+
#Login
29+
K_URL_1 = 'serverName1'
30+
K_USER_1 = 'userName1'
31+
K_PASSWORD_1 = 'passName1'
32+
K_PASSWORD_WRONG_1 = 'pass_wrong'
33+
K_SELF_SIGNED_1 = True
34+
35+
K_URL_2 = 'serverName2'
36+
K_USER_2 = 'userName2'
37+
K_PASSWORD_2 = 'passName2'
38+
K_SELF_SIGNED_2 = True
39+
40+
#Create Folder
41+
K_FOLDER_NAME = 'Test Folder ß'
42+
43+
class utility_functions():
44+
45+
#--Common utils for Apending string in test.txt file.
46+
def write_comment_in_file(self,text):
47+
f = open(K_RST_FILE_PATH, "a")
48+
f.write('Time: %s ' % datetime.now())
49+
f.write(text)
50+
f.close()
51+
return True

0 commit comments

Comments
 (0)