Skip to content

Commit e85ed4f

Browse files
miroslavaivanovaNatalia-Hristova
authored and
Natalia-Hristova
committed
add test form resource generate icon which not generate by xcode (#140)
1 parent f9ee4e2 commit e85ed4f

15 files changed

+103
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"images": [
3+
{
4+
"idiom": "ipad",
5+
"size": "20x20",
6+
"scale": "1x",
7+
"filename": "Icon-20x20@1x.png"
8+
},
9+
{
10+
"idiom": "iphone",
11+
"size": "20x20",
12+
"scale": "2x",
13+
"filename": "Icon-20x20@2x.png"
14+
},
15+
{
16+
"idiom": "iphone",
17+
"size": "20x20",
18+
"scale": "3x",
19+
"filename": "Icon-20x20@3x.png"
20+
},
21+
{
22+
"idiom": "iphone",
23+
"size": "29x29",
24+
"scale": "1x",
25+
"filename": "Icon-29x29@1x.png"
26+
},
27+
{
28+
"idiom": "iphone",
29+
"size": "29x29",
30+
"scale": "2x",
31+
"filename": "Icon-29x29@2x.png"
32+
},
33+
{
34+
"idiom": "iphone",
35+
"size": "29x29",
36+
"scale": "3x",
37+
"filename": "Icon-29x29@3x.png"
38+
},
39+
{
40+
"idiom": "iphone",
41+
"size": "40x40",
42+
"scale": "2x",
43+
"filename": "Icon-40x40@2x.png"
44+
},
45+
{
46+
"idiom": "iphone",
47+
"size": "40x40",
48+
"scale": "3x",
49+
"filename": "Icon-40x40@3x.png"
50+
},
51+
{
52+
"idiom": "iphone",
53+
"size": "60x60",
54+
"scale": "2x",
55+
"filename": "Icon-60x60@2x.png"
56+
},
57+
{
58+
"idiom": "iphone",
59+
"size": "60x60",
60+
"scale": "3x",
61+
"filename": "Icon-60x60@3x.png"
62+
},
63+
{
64+
"idiom": "ipad",
65+
"size": "76x76",
66+
"scale": "1x",
67+
"filename": "Icon-76x76@1x.png"
68+
},
69+
{
70+
"idiom": "ipad",
71+
"size": "76x76",
72+
"scale": "2x",
73+
"filename": "Icon-76x76@2x.png"
74+
},
75+
{
76+
"idiom": "ios-marketing",
77+
"size": "1024x1024",
78+
"scale": "1x",
79+
"filename": "Icon-marketing-1024x1024.png"
80+
}
81+
],
82+
"info": {
83+
"version": 1,
84+
"author": "apetools.webprofusion.com"
85+
}
86+
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

tests/build/common/resources_generate_tests.py

+17
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from core.base_class.BaseClass import BaseClass
77
from core.osutils.command import run
88
from core.osutils.folder import Folder
9+
from core.osutils.file import File
910
from core.osutils.image_utils import ImageUtils
1011
from core.osutils.os_type import OSType
1112
from core.settings.settings import CURRENT_OS, TEST_RUN_HOME
@@ -142,6 +143,22 @@ def test_002_tns_resources_generate_splashes(self):
142143

143144
ResourcesGenerateTests.check_splashes(app_resources_android, app_resources_ios)
144145

146+
def test_003_tns_resources_generate_icons_apetools(self):
147+
#https://github.com/NativeScript/nativescript-cli/issues/3666
148+
Folder.cleanup(os.path.join(self.app_name, 'app', 'App_Resources', 'iOS', 'Assets.xcassets',
149+
'AppIcon.appiconset'))
150+
folder = os.path.join(TEST_RUN_HOME, "data", "images", "resources_generate", "apetool",
151+
"AppIcon.appiconset")
152+
destination = os.path.join(self.app_name, 'app', 'App_Resources', 'iOS', 'Assets.xcassets', 'AppIcon.appiconset')
153+
Folder.copy(folder, destination)
154+
icon_path = os.path.join(self.app_name, "app", "App_Resources", "iOS", "Assets.xcassets",
155+
"AppIcon.appiconset", "Icon-76x76@2x.png")
156+
157+
output = run("tns resources generate icons \"" + icon_path + "\"" + " --path " + self.app_name)
158+
assert "Generating icons" in output
159+
assert "Icons generation completed" in output
160+
assert "Invalid settings specified for the resizer." not in output
161+
145162
def test_100_tns_resources_generate_icons_old_template_structure(self):
146163
app_resources_android = os.path.join(TEST_RUN_HOME, self.app_based_on_old_template, self.app_resources_old)
147164
app_resources_ios = os.path.join(TEST_RUN_HOME, self.app_based_on_old_template, self.assets_icons)

0 commit comments

Comments
 (0)