5
5
from data .const import Colors
6
6
7
7
8
- # noinspection PyShadowingBuiltins
9
8
class ChangeSet (object ):
10
9
def __init__ (self , file_path , old_value , new_value , old_text = None , new_text = None , old_color = None , new_color = None ):
11
10
self .file_path = file_path
@@ -35,7 +34,8 @@ class JSHelloWord(object):
35
34
old_value = 'taps left' , new_value = 'clicks left' ,
36
35
old_text = 'taps left' , new_text = 'clicks left' )
37
36
CSS = ChangeSet (file_path = os .path .join ('app' , 'app.css' ),
38
- old_value = 'font-size: 18' , new_value = 'font-size: 50' ,
37
+ old_value = 'font-size: 18' ,
38
+ new_value = 'font-size: 18;\n background-color: red;' ,
39
39
old_color = None , new_color = None )
40
40
XML = ChangeSet (file_path = os .path .join ('app' , 'main-page.xml' ),
41
41
old_value = 'TAP' , new_value = 'HIT' ,
@@ -54,7 +54,8 @@ class TSHelloWord(object):
54
54
old_value = 'taps left' , new_value = 'clicks left' ,
55
55
old_text = 'taps left' , new_text = 'clicks left' )
56
56
CSS = ChangeSet (file_path = os .path .join ('app' , 'app.css' ),
57
- old_value = 'font-size: 18' , new_value = 'font-size: 50' ,
57
+ old_value = 'font-size: 18' ,
58
+ new_value = 'font-size: 18;\n background-color: red;' ,
58
59
old_color = None , new_color = None )
59
60
XML = ChangeSet (file_path = os .path .join ('app' , 'main-page.xml' ),
60
61
old_value = 'TAP' , new_value = 'HIT' ,
@@ -65,11 +66,10 @@ class NGHelloWorld(object):
65
66
old_value = 'Ter Stegen' , new_value = 'Unknown' ,
66
67
old_text = 'Ter Stegen' , new_text = 'Unknown' )
67
68
CSS = ChangeSet (file_path = os .path .join ('src' , 'app.css' ),
68
- old_value = 'light' , new_value = 'dark' ,
69
- old_color = Colors .WHITE , new_color = Colors .DARK )
70
- HTML = ChangeSet (file_path = os .path .join ('src' , 'app' , 'item' , 'items.component.html' ),
71
- old_value = '"item.name"' , new_value = '"item.id"' ,
72
- old_text = None , new_text = None )
69
+ old_value = '}' , new_value = '}\n ListView { background-color: pink;}\n ' ,
70
+ old_color = Colors .WHITE , new_color = Colors .PINK )
71
+ HTML = ChangeSet (file_path = os .path .join ('src' , 'app' , 'item' , 'items.component.html' ), old_value = '"item.name"' ,
72
+ new_value = '"item.id"' , old_text = None , new_text = None )
73
73
XML_ACTION_BAR = ChangeSet (file_path = os .path .join ('src' , 'app' , 'item' , 'items.component.html' ),
74
74
old_value = 'My App' , new_value = 'TestApp' ,
75
75
old_text = 'My App' , new_text = 'TestApp' )
@@ -89,33 +89,35 @@ class MasterDetailNG(object):
89
89
90
90
# This change should make title of cars pink
91
91
SCSS_ROOT_COMMON = ChangeSet (file_path = os .path .join ('src' , '_app-common.scss' ),
92
- old_value = '$accent-dark;' , new_value = 'pink;' ,
92
+ old_value = 'font-weight: 900;' ,
93
+ new_value = 'font-weight: 900;\n background-color: pink;\n ' ,
93
94
old_color = Colors .ACCENT_DARK , new_color = Colors .PINK )
94
95
95
96
# This change should add some red between list view items on home page
96
97
SCSS_ROOT_ANDROID = ChangeSet (file_path = os .path .join ('src' , 'app.android.scss' ),
97
98
old_value = 'Android here' ,
98
- new_value = 'Android here\n .page { background-color: red;}\n ' ,
99
- old_color = Colors .WHITE , new_color = Colors .RED_DARK )
99
+ new_value = 'Android here\n .m-r-20 { background-color: red; }\n ' ,
100
+ old_color = Colors .WHITE , new_color = Colors .RED )
100
101
SCSS_ROOT_IOS = ChangeSet (file_path = os .path .join ('src' , 'app.ios.scss' ),
101
102
old_value = 'iOS here' ,
102
- new_value = 'iOS here\n .page { padding: 30; background-color: red; }\n ' ,
103
+ new_value = 'iOS here\n .m-r-20{ background-color: red; }\n ' ,
103
104
old_color = Colors .WHITE , new_color = Colors .RED )
104
105
105
106
# This change should make background of items on home page purple
106
107
SCSS_NESTED_COMMON = ChangeSet (file_path = os .path .join ('src' , 'app' , 'cars' , '_car-list.component.scss' ),
107
- old_value = '$background-light;' , new_value = 'purple;' ,
108
- old_color = Colors .WHITE , new_color = Colors .PURPLE )
108
+ old_value = '$background-color: background' ,
109
+ new_value = '$background-color: purple' ,
110
+ old_color = Colors .WHITE , new_color = Colors .PURPLE_CUSTOM )
109
111
110
112
# This change should make icons on home page yellow
111
113
SCSS_NESTED_ANDROID = ChangeSet (file_path = os .path .join ('src' , 'app' , 'cars' , 'car-list.component.android.scss' ),
112
114
old_value = 'Android here' ,
113
- new_value = 'Android here\n .list-group{.list-group-item{.fa{ color:yellow;}} }\n ' ,
115
+ new_value = 'Android here\n .cars-list__item{ color: yellow; }\n ' ,
114
116
old_color = None , new_color = Colors .YELLOW )
115
117
116
118
SCSS_NESTED_IOS = ChangeSet (file_path = os .path .join ('src' , 'app' , 'cars' , 'car-list.component.ios.scss' ),
117
119
old_value = 'iOS here' ,
118
- new_value = 'iOS here\n .list-group{.list-group-item{.fa{ color:yellow;}} }\n ' ,
120
+ new_value = 'iOS here\n .cars-list__item{ color: yellow; }\n ' ,
119
121
old_color = None , new_color = Colors .YELLOW )
120
122
121
123
class JSTabNavigation (object ):
@@ -126,16 +128,19 @@ class JSTabNavigation(object):
126
128
old_value = 'Home' , new_value = 'Test' ,
127
129
old_text = 'Home' , new_text = 'Test' )
128
130
129
- # This change should make title of home red
130
- SCSS_VARIABLES = ChangeSet (file_path = os .path .join ('app' , '_app-variables.scss' ),
131
- old_value = '#D7D7D7' , new_value = 'red' ,
132
- old_color = '#D7D7D7' , new_color = Colors .RED )
131
+ # This change should make background of home red
132
+ SCSS_VARIABLES = ChangeSet (file_path = os .path .join ('app' , '_app-common.scss' ),
133
+ old_value = 'Font icon class' ,
134
+ new_value = 'Font icon class\n .page__content{ background-color: red; }\n ' ,
135
+ old_color = None , new_color = Colors .RED )
133
136
SCSS_ROOT_ANDROID = ChangeSet (file_path = os .path .join ('app' , 'app.android.scss' ),
134
- old_value = '$blue-dark;' , new_value = 'pink;' ,
135
- old_color = Colors .ACCENT_DARK , new_color = Colors .PINK )
137
+ old_value = 'Android here' ,
138
+ new_value = 'Android here\n .navigation__item{ background-color: yellow; }\n ' ,
139
+ old_color = None , new_color = Colors .YELLOW )
136
140
SCSS_ROOT_IOS = ChangeSet (file_path = os .path .join ('app' , 'app.ios.scss' ),
137
- old_value = '$item-active-color;' , new_value = 'pink;' ,
138
- old_color = Colors .ACCENT_DARK , new_color = Colors .PINK )
141
+ old_value = 'iOS here' ,
142
+ new_value = 'iOS here\n .navigation__item{ background-color: yellow; }\n ' ,
143
+ old_color = None , new_color = Colors .YELLOW )
139
144
140
145
class TSTabNavigation (object ):
141
146
TS = ChangeSet (file_path = os .path .join ('src' , 'app' , 'home' , 'home-items-view-model.ts' ),
@@ -194,15 +199,14 @@ class MasterDetailVUE(object):
194
199
old_text = '/day' , new_text = '/24h' )
195
200
196
201
class DateTimePicker (object ):
197
- COMMON_TS = ChangeSet ( file_path = os .path .join (
198
- Settings . TEST_SUT_HOME , 'nativescript-datetimepicker' , 'src' , 'ui' , 'date-picker-field.common.ts' ),
199
- old_value = 'name: "date",' , new_value = 'name: "date", defaultValue: new Date(),' )
200
- ANDROID_TS = ChangeSet ( file_path = os . path . join (
201
- Settings . TEST_SUT_HOME , 'nativescript-datetimepicker' , 'src' , 'datetimepicker.android.ts' ),
202
+ DATETIME_PICKER_PATH = os .path .join (Settings . TEST_SUT_HOME , 'nativescript-datetimepicker' , 'src' )
203
+ COMMON_TS = ChangeSet ( file_path = os . path . join ( DATETIME_PICKER_PATH , 'ui' , 'date-picker-field.common.ts' ),
204
+ old_value = 'name: "date",' ,
205
+ new_value = 'name: "date", defaultValue: new Date(),' )
206
+ ANDROID_TS = ChangeSet ( file_path = os . path . join ( DATETIME_PICKER_PATH , 'datetimepicker.android.ts' ),
202
207
old_value = 'datePicker.init(date.getFullYear(), date.getMonth(), date.getDate(), null);' ,
203
208
new_value = 'datePicker.init(2010, date.getMonth(), date.getDate(), null);' )
204
- IOS_TS = ChangeSet (file_path = os .path .join (
205
- Settings .TEST_SUT_HOME , 'nativescript-datetimepicker' , 'src' , 'datetimepicker.ios.ts' ),
209
+ IOS_TS = ChangeSet (file_path = os .path .join (DATETIME_PICKER_PATH , 'datetimepicker.ios.ts' ),
206
210
old_value = 'pickerView.date = date;' ,
207
211
new_value = 'date.setFullYear(2010); pickerView.date = date;' )
208
212
0 commit comments