Skip to content

Commit bd81dc2

Browse files
Zdravko BranzovZdravko Branzov
Zdravko Branzov
authored and
Zdravko Branzov
committed
chore: change the way we assert changes to improve tests stability
1 parent 70e1757 commit bd81dc2

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

data/changes.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ class DateTimePicker(object):
203203
COMMON_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'ui', 'date-picker-field.common.ts'),
204204
old_value='name: "date",',
205205
new_value='name: "date", defaultValue: new Date(),')
206-
ANDROID_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'datetimepicker.android.ts'),
207-
old_value='datePicker.init(date.getFullYear(), date.getMonth(), date.getDate(), null);',
208-
new_value='datePicker.init(2010, date.getMonth(), date.getDate(), null);')
209-
IOS_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'datetimepicker.ios.ts'),
210-
old_value='pickerView.date = date;',
211-
new_value='date.setFullYear(2010); pickerView.date = date;')
206+
ANDROID_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'ui', 'date-picker-field.android.ts'),
207+
old_value='this.nativeView.setFocusable(false);',
208+
new_value='this.nativeView.setFocusable(false); this.hint = "testMessage";')
209+
IOS_TS = ChangeSet(file_path=os.path.join(DATETIME_PICKER_PATH, 'ui', 'date-picker-field.ios.ts'),
210+
old_value='export class DatePickerField extends DatePickerFieldBase {',
211+
new_value='export class DatePickerField extends DatePickerFieldBase {initNativeView() {this.hint = "testMessage";}')
212212

213213
class AppFileChanges(object):
214214
CHANGE_XML_INVALID_SYNTAX = ChangeSet(file_path=os.path.join('app', 'main-page.xml'),

data/sync/plugin_src.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,4 @@ def sync_plugin_platform_spec(app_name, app_type, log_result, platform, device,
9696
app_type=app_type)
9797
TnsLogs.wait_for_log(log_file=log_result.log_file, string_list=strings, timeout=60)
9898
device.click(text="DatePickerField")
99-
device.wait_for_text("select date")
100-
device.click(text="select date")
101-
device.click(text="OK")
102-
date = datetime.date.today().replace(year=2010)
103-
date = date.strftime("%b %-d, %Y")
104-
device.wait_for_text(str(date))
99+
device.wait_for_text("testMessage")

0 commit comments

Comments
 (0)