Wednesday, March 29, 2017

Calabash Cucumber Commands

start_test_server_in_background
query("all android.widget.LinearLayout id:'llDeaparting' child android.widget.TextView id:'flight_drawer_dept_airport' text:'DXB' parent android.widget.LinearLayout id:'search_result_parent' child android.support.v4.view.ViewPager android.widget.LinearLayout id:'search_result_scroll_view' android.widget.ScrollView id:'search_result_observable_scroll_view' android.widget.LinearLayout id:'search_result_observable_scroll_view_children' android.widget.LinearLayout id:'search_result_list_view_result' android.widget.RelativeLayout id:'search_result_row_item_panel'").size
query("all id:'search_result_list_view_result'").size
query("ListView",:getCount)
query("ScrollView",:getCount)
query("search_result_list_view_result",:getCount)
query("* id:'search_result_list_view_result'",:getCount)
query("ListView","getAdapter","getCount").first
query("ScrollView","getAdapter","getCount").first
query("ScrollView",:getCount)
query("ScrollView",:count).first
query("*")[0]
query("*")[0]
query("*")
query("ScrollView")
query("ListView","getAdapter","getCount").first
query("android.widget.ScrollView","getAdapter","getCount").first
query("android.widget.ScrollView",:count).first
query("android.widget.ScrollView",:getCount).first
exit
start_test_server_in_background
query('collectionView',numberOfItemsInSection:0).first
query('ScrollView',numberOfItemsInSection:0).first
perform_action('drag_coordinates', 200, 1000, 200, 700, 10)
perform_action('drag_coordinates', 200, 1000, 200, 700, 10)
query("all android.widget.LinearLayout id:'#{id}' descendant android.widget.EditText",:text)[0]
query("ListView",:getCount).first
query("all id:'list_selection_listView'").size
%x($ANDROID_HOME/platform-tools/adb shell svc wifi disable)
system(%x($ANDROID_HOME/platform-tools/adb shell svc wifi enable))
system($ANDROID_HOME/platform-tools/adb shell svc wifi enable)
system($ANDROID_HOME+ "/platform-tools/adb" shell svc wifi enable)
exit

query("* id:'myAccount_textField_details' marked:'Tier Miles: 0'").first['text']

query("* contentDescription:'myaccount_currencyspinner_textview' descendant * id:'text1'","text").first



Setting Emulator in Android Studio

1)      Open Android Studio
2)      Go to Tools -> Android -> AVD Manager



3)      Click Create Virtual Device (chose whatever device you want, but I would suggest to choose the defaults for the first time)



4)      Please note the error for HAXM on the right side of the window.



5)      Install Haxm by clicking the link in the window. It would install automatically if you have Admin rights.

6)      Close the Create Virtual Device & then open again to reflect the changes for Haxm software

7)      Click Next – Next until the last step and Finish the creation.

Note: Mobile settings like memory, RAM can be modified in the intermediate steps. But as I said, it is better to leave as default for now. Also we can change the OS version (android 6 or 7), but for that we have to download respective packages in Android Studio.

8)      You will see the below window:



9)      Click on the Play icon under Actions column. You would see the below images:



10)   Now, go to the Command prompt into Android SDK’s platform-tools directory, and run the command “adb devices” to see the Emulator in that.



11)   That’s it now we can go into the EK Project’s “MyTripsV2.0” folder and run the below command(s):
calabash-android resign APP-Rajatt-Feb-12.apk
12)   Followed by,
calabash-android run APP-Rajatt-Feb-12.apk

It would be very slow because all the PC’s are having 4GB RAM, so wait patiently until the Emirates app opens up in the Emulator.

Hosts file in Mac machine

Please find below the steps for editing Hosts file in Mac machine:

1)      Type “sudo vi /etc/hosts” and hit enter
2)      Enter your password
3)      Go to the end of the line and press “Esc + i” to invoke Insert mode
4)      Add “57.12.42.10              git.emirates.com” in the next line
5)      Press “Esc + : + wq” to save and close the vi editor.
6)      To verify the changes type “cat /etc/hosts”


After adding the hosts entry, we are able to access the Git repository from Mac machines.

CTS Outlook Configuration

You can configure outlook using the below settings. 1) Open Control panel and select Mail 2) Select show profile now 3) Select A...