Best JavaScript code snippet using appium-xcuitest-driver
select-multiple.js
Source:select-multiple.js
...619 .elementByAccessibilityId('se_mul_c35')620 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))621 .sleep(1000)622 .elementById('vn.rta.rtsurvey:id/recycler_view')623 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.TextView').tap())624 .elementByAccessibilityId('se_mul_c35')625 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))626 .sleep(1000)627 .elementById('vn.rta.rtsurvey:id/recycler_view')628 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.TextView').tap())629 });630 it("Scroll To Specific Question", function () {631 return driver.scrollTo('//*[@content-desc="se_mul_c36"]//android.widget.EditText');632 });633 it("se_mul_c36 : 2,1", function () {634 return driver635 .elementByAccessibilityId('se_mul_c36')636 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))637 .sleep(1000)638 .elementById('vn.rta.rtsurvey:id/recycler_view')639 .then(el => el.elementByXPath('//android.widget.RelativeLayout[3]//android.widget.TextView').tap())640 .elementByAccessibilityId('se_mul_c36')641 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))642 .sleep(1000)643 .elementById('vn.rta.rtsurvey:id/recycler_view')644 .then(el => el.elementByXPath('//android.widget.RelativeLayout[2]//android.widget.TextView').tap())645 });646 it("Scroll To Specific Question", function () {647 return driver.scrollTo('//*[@content-desc="se_mul_c37"]//android.widget.EditText');648 });649 it("se_mul_c37 : 3,0", function () {650 return driver651 .elementByAccessibilityId('se_mul_c37')652 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))653 .sleep(1000)654 .elementById('vn.rta.rtsurvey:id/recycler_view')655 .then(el => el.elementByXPath('//android.widget.RelativeLayout[4]//android.widget.TextView').tap())656 .elementByAccessibilityId('se_mul_c37')657 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))658 .sleep(1000)659 .elementById('vn.rta.rtsurvey:id/recycler_view')660 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.TextView').tap())661 });662 it("Scroll To Specific Question", function () {663 return driver.scrollTo('//*[@content-desc="se_mul_c38"]//android.widget.EditText');664 });665 it("se_mul_c38 : 3,1", function () {666 return driver667 .elementByAccessibilityId('se_mul_c38')668 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))669 .sleep(1000)670 .elementById('vn.rta.rtsurvey:id/recycler_view')671 .then(el => el.elementByXPath('//android.widget.RelativeLayout[4]//android.widget.TextView').tap())672 .elementByAccessibilityId('se_mul_c38')673 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))674 .sleep(1000)675 .elementById('vn.rta.rtsurvey:id/recycler_view')676 .then(el => el.elementByXPath('//android.widget.RelativeLayout[2]//android.widget.TextView').tap())677 });678 it("Scroll To Specific Question", function () {679 return driver.scrollTo('//*[@content-desc="se_mul_c39"]//android.widget.LinearLayout[2]//android.widget.TextView');680 });681 it("se_mul_c39 : 1,4", function () {682 return driver683 .elementByAccessibilityId('se_mul_c39')684 .then(function (el) {685 return el686 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')687 .then(function (els) {688 return Q.all([els[1].tap(), els[4].tap()])689 })690 })691 });692 it("Scroll To Specific Question", function () {693 return driver.scrollTo('//*[@content-desc="se_mul_c40"]//android.widget.LinearLayout[2]//android.widget.TextView');694 });695 it("se_mul_c40 : 2,4", function () {696 return driver697 .elementByAccessibilityId('se_mul_c40')698 .then(function (el) {699 return el700 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')701 .then(function (els) {702 return Q.all([els[2].tap(), els[4].tap()])703 })704 })705 });706 it("Scroll To Specific Question", function () {707 return driver.scrollTo('//*[@content-desc="se_mul_c41"]//android.widget.LinearLayout[2]//android.widget.TextView');708 });709 it("se_mul_c41 : 0,0", function () {710 return driver711 .elementByAccessibilityId('se_mul_c41')712 .then(function (el) {713 return el714 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')715 .then(function (els) {716 return Q.all([els[0].tap(), els[0].tap()])717 })718 })719 });720 it("Scroll To Specific Question", function () {721 return driver.scrollTo('//*[@content-desc="se_mul_c42"]//android.widget.LinearLayout[2]//android.widget.TextView');722 });723 it("se_mul_c42 : 0,3", function () {724 return driver725 .elementByAccessibilityId('se_mul_c42')726 .then(function (el) {727 return el728 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')729 .then(function (els) {730 return Q.all([els[0].tap(), els[3].tap()])731 })732 })733 });734 it("Scroll To Specific Question", function () {735 return driver.scrollTo('//*[@content-desc="se_mul_c43"]//android.widget.LinearLayout[2]//android.widget.TextView');736 });737 it("se_mul_c43 : 4,3", function () {738 return driver739 .elementByAccessibilityId('se_mul_c43')740 .then(function (el) {741 return el742 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')743 .then(function (els) {744 return Q.all([els[4].tap(), els[3].tap()])745 })746 })747 });748 it("Scroll To Specific Question", function () {749 return driver.scrollTo('//*[@content-desc="se_mul_c44"]//android.widget.LinearLayout[2]//android.widget.TextView');750 });751 it("se_mul_c44 : 2,3", function () {752 return driver753 .elementByAccessibilityId('se_mul_c44')754 .then(function (el) {755 return el756 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')757 .then(function (els) {758 return Q.all([els[2].tap(), els[3].tap()])759 })760 })761 });762 it("Scroll To Specific Question", function () {763 return driver.scrollTo('//*[@content-desc="se_mul_c45"]//android.widget.LinearLayout[2]//android.widget.TextView');764 });765 it("se_mul_c45 : 0,4", function () {766 return driver767 .elementByAccessibilityId('se_mul_c45')768 .then(function (el) {769 return el770 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')771 .then(function (els) {772 return Q.all([els[0].tap(), els[4].tap()])773 })774 })775 });776 it("Scroll To Specific Question", function () {777 return driver.scrollTo('//*[@content-desc="se_mul_c46"]//android.widget.LinearLayout[2]//android.widget.TextView');778 });779 it("se_mul_c46 : 3,1", function () {780 return driver781 .elementByAccessibilityId('se_mul_c46')782 .then(function (el) {783 return el784 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')785 .then(function (els) {786 return Q.all([els[3].tap(), els[1].tap()])787 })788 })789 });790 it("Scroll To Specific Question", function () {791 return driver.scrollTo('//*[@content-desc="se_mul_c47"]//android.widget.LinearLayout[2]//android.widget.TextView');792 });793 it("se_mul_c47 : 0,0", function () {794 return driver795 .elementByAccessibilityId('se_mul_c47')796 .then(function (el) {797 return el798 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')799 .then(function (els) {800 return Q.all([els[0].tap(), els[0].tap()])801 })802 })803 });804 it("Scroll To Specific Question", function () {805 return driver.scrollTo('//*[@content-desc="se_mul_c48"]//android.widget.LinearLayout[2]//android.widget.TextView');806 });807 it("se_mul_c48 : 1,4", function () {808 return driver809 .elementByAccessibilityId('se_mul_c48')810 .then(function (el) {811 return el812 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')813 .then(function (els) {814 return Q.all([els[1].tap(), els[4].tap()])815 })816 })817 });818 it("Scroll To Specific Question", function () {819 return driver.scrollTo('//*[@content-desc="se_mul_c49"]//android.widget.LinearLayout[2]//android.widget.TextView');820 });821 it("se_mul_c49 : 3,0", function () {822 return driver823 .elementByAccessibilityId('se_mul_c49')824 .then(function (el) {825 return el826 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')827 .then(function (els) {828 return Q.all([els[3].tap(), els[0].tap()])829 })830 })831 });832 it("Scroll To Specific Question", function () {833 return driver.scrollTo('//*[@content-desc="se_mul_c50"]//android.widget.LinearLayout[2]//android.widget.TextView');834 });835 it("se_mul_c50 : 0,0", function () {836 return driver837 .elementByAccessibilityId('se_mul_c50')838 .then(function (el) {839 return el840 .elementsByXPath('//android.widget.LinearLayout[2]//android.widget.TextView')841 .then(function (els) {842 return Q.all([els[0].tap(), els[0].tap()])843 })844 })845 });846 it("Scroll To Specific Question", function () {847 return driver.scrollTo('//*[@content-desc="se_mul_c51"]//android.widget.MultiAutoCompleteTextView');848 });849 it("se_mul_c51 : 1,2", function () {850 return driver851 .elementByAccessibilityId('se_mul_c51')852 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))853 .sleep(1000)854 .elementById('vn.rta.rtsurvey:id/selection_view')855 .getLocation()856 .then(function (loc) {857 var ma = new wd.MultiAction(driver);858 var action_1 = new wd.TouchAction(driver);859 action_1.tap({x: loc.x + 100, y: loc.y + 227}).release();860 ma.add(action_1)861 var action_2 = new wd.TouchAction(driver);862 action_2.tap({x: loc.x + 100, y: loc.y + 324}).release();863 ma.add(action_2)864 return driver.performMultiAction(ma).sleep(3000);865 })866 .back().back().back();867 });868 it("Scroll To Specific Question", function () {869 return driver.scrollTo('//*[@content-desc="se_mul_c52"]//android.widget.MultiAutoCompleteTextView');870 });871 it("se_mul_c52 : 3,4", function () {872 return driver873 .elementByAccessibilityId('se_mul_c52')874 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))875 .sleep(1000)876 .elementById('vn.rta.rtsurvey:id/selection_view')877 .getLocation()878 .then(function (loc) {879 var ma = new wd.MultiAction(driver);880 var action_3 = new wd.TouchAction(driver);881 action_3.tap({x: loc.x + 100, y: loc.y + 324}).release();882 ma.add(action_3)883 var action_4 = new wd.TouchAction(driver);884 action_4.tap({x: loc.x + 100, y: loc.y + 324}).release();885 ma.add(action_4)886 return driver.performMultiAction(ma).sleep(3000);887 })888 .back().back().back();889 });890 it("Scroll To Specific Question", function () {891 return driver.scrollTo('//*[@content-desc="se_mul_c53"]//android.widget.MultiAutoCompleteTextView');892 });893 it("se_mul_c53 : 1,3", function () {894 return driver895 .elementByAccessibilityId('se_mul_c53')896 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))897 .sleep(1000)898 .elementById('vn.rta.rtsurvey:id/selection_view')899 .getLocation()900 .then(function (loc) {901 var ma = new wd.MultiAction(driver);902 var action_1 = new wd.TouchAction(driver);903 action_1.tap({x: loc.x + 100, y: loc.y + 227}).release();904 ma.add(action_1)905 var action_3 = new wd.TouchAction(driver);906 action_3.tap({x: loc.x + 100, y: loc.y + 324}).release();907 ma.add(action_3)908 return driver.performMultiAction(ma).sleep(3000);909 })910 .back().back().back();911 });912 it("Scroll To Specific Question", function () {913 return driver.scrollTo('//*[@content-desc="se_mul_c54"]//android.widget.MultiAutoCompleteTextView');914 });915 it("se_mul_c54 : 4,0", function () {916 return driver917 .elementByAccessibilityId('se_mul_c54')918 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))919 .sleep(1000)920 .elementById('vn.rta.rtsurvey:id/selection_view')921 .getLocation()922 .then(function (loc) {923 var ma = new wd.MultiAction(driver);924 var action_4 = new wd.TouchAction(driver);925 action_4.tap({x: loc.x + 100, y: loc.y + 324}).release();926 ma.add(action_4)927 var action_0 = new wd.TouchAction(driver);928 action_0.tap({x: loc.x + 100, y: loc.y + 132}).release();929 ma.add(action_0)930 return driver.performMultiAction(ma).sleep(3000);931 })932 .back().back().back();933 });934 it("Scroll To Specific Question", function () {935 return driver.scrollTo('//*[@content-desc="se_mul_c55"]//android.widget.MultiAutoCompleteTextView');936 });937 it("se_mul_c55 : 3,0", function () {938 return driver939 .elementByAccessibilityId('se_mul_c55')940 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))941 .sleep(1000)942 .elementById('vn.rta.rtsurvey:id/selection_view')943 .getLocation()944 .then(function (loc) {945 var ma = new wd.MultiAction(driver);946 var action_3 = new wd.TouchAction(driver);947 action_3.tap({x: loc.x + 100, y: loc.y + 324}).release();948 ma.add(action_3)949 var action_0 = new wd.TouchAction(driver);950 action_0.tap({x: loc.x + 100, y: loc.y + 132}).release();951 ma.add(action_0)952 return driver.performMultiAction(ma).sleep(3000);953 })954 .back().back().back();955 });956 it("Scroll To Specific Question", function () {957 return driver.scrollTo('//*[@content-desc="se_mul_c56"]//android.widget.MultiAutoCompleteTextView');958 });959 it("se_mul_c56 : 3,1", function () {960 return driver961 .elementByAccessibilityId('se_mul_c56')962 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))963 .sleep(1000)964 .elementById('vn.rta.rtsurvey:id/selection_view')965 .getLocation()966 .then(function (loc) {967 var ma = new wd.MultiAction(driver);968 var action_3 = new wd.TouchAction(driver);969 action_3.tap({x: loc.x + 100, y: loc.y + 324}).release();970 ma.add(action_3)971 var action_1 = new wd.TouchAction(driver);972 action_1.tap({x: loc.x + 100, y: loc.y + 227}).release();973 ma.add(action_1)974 return driver.performMultiAction(ma).sleep(3000);975 })976 .back().back().back();977 });978 it("Scroll To Specific Question", function () {979 return driver.scrollTo('//*[@content-desc="se_mul_c57"]//android.widget.EditText');980 });981 it("se_mul_c57 : 4,2", function () {982 return driver983 .elementByAccessibilityId('se_mul_c57')984 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))985 .sleep(1000)986 .elementById('vn.rta.rtsurvey:id/recycler_view')987 .then(el => el.elementByXPath('//android.widget.RelativeLayout[5]//android.widget.TextView').tap())988 .elementByAccessibilityId('se_mul_c57')989 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))990 .sleep(1000)991 .elementById('vn.rta.rtsurvey:id/recycler_view')992 .then(el => el.elementByXPath('//android.widget.RelativeLayout[3]//android.widget.TextView').tap())993 });994 it("Scroll To Specific Question", function () {995 return driver.scrollTo('//*[@content-desc="se_mul_c58"]//android.widget.EditText');996 });997 it("se_mul_c58 : 4,3", function () {998 return driver999 .elementByAccessibilityId('se_mul_c58')1000 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))1001 .sleep(1000)1002 .elementById('vn.rta.rtsurvey:id/recycler_view')1003 .then(el => el.elementByXPath('//android.widget.RelativeLayout[5]//android.widget.TextView').tap())1004 .elementByAccessibilityId('se_mul_c58')1005 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))1006 .sleep(1000)1007 .elementById('vn.rta.rtsurvey:id/recycler_view')1008 .then(el => el.elementByXPath('//android.widget.RelativeLayout[4]//android.widget.TextView').tap())1009 });1010 it("Scroll To Specific Question", function () {1011 return driver.scrollTo('//*[@content-desc="se_mul_c59"]//android.widget.EditText');1012 });1013 it("se_mul_c59 : 3,4", function () {1014 return driver1015 .elementByAccessibilityId('se_mul_c59')1016 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))1017 .sleep(1000)1018 .elementById('vn.rta.rtsurvey:id/recycler_view')1019 .then(el => el.elementByXPath('//android.widget.RelativeLayout[4]//android.widget.TextView').tap())1020 .elementByAccessibilityId('se_mul_c59')1021 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))1022 .sleep(1000)1023 .elementById('vn.rta.rtsurvey:id/recycler_view')1024 .then(el => el.elementByXPath('//android.widget.RelativeLayout[5]//android.widget.TextView').tap())1025 });1026 it("se_mul_c60 : 3,0", function () {1027 return driver1028 .elementByAccessibilityId('se_mul_c60')1029 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))1030 .sleep(1000)1031 .elementById('vn.rta.rtsurvey:id/recycler_view')1032 .then(el => el.elementByXPath('//android.widget.RelativeLayout[4]//android.widget.TextView').tap())1033 .elementByAccessibilityId('se_mul_c60')1034 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))1035 .sleep(1000)1036 .elementById('vn.rta.rtsurvey:id/recycler_view')1037 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.TextView').tap())1038 });1039 it("Next Question", function () {1040 return driver1041 .elementById('vn.rta.rtsurvey:id/questionholder')1042 .flick(-500, 1, 500)1043 .elementByAccessibilityId('se_mul_c61')1044 .should.eventually.exist1045 });1046 it("se_mul_c61 : 4,1", function () {1047 return driver1048 .elementByAccessibilityId('se_mul_c61')1049 .then(function (el) {1050 return el1051 .elementsByClassName('android.widget.CheckBox')1052 .then(function (els) {1053 return Q.all([els[4].tap(), els[1].tap()])1054 })1055 })1056 });1057 it("se_mul_c62 : 3,0", function () {1058 return driver1059 .elementByAccessibilityId('se_mul_c62')1060 .then(function (el) {1061 return el1062 .elementsByClassName('android.widget.CheckBox')1063 .then(function (els) {1064 return Q.all([els[3].tap(), els[0].tap()])1065 })1066 })1067 });1068 it("Next Question", function () {1069 return driver1070 .elementById('vn.rta.rtsurvey:id/questionholder')1071 .flick(-500, 1, 500)1072 .elementByAccessibilityId('exit1')1073 .should.eventually.exist1074 });1075 it("exit1 : 1", function () {1076 return driver1077 .elementByAccessibilityId('exit1')1078 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.RadioButton').tap())1079 });1080 it("Next Question", function () {1081 return driver1082 .elementById('vn.rta.rtsurvey:id/questionholder')1083 .flick(-500, 1, 500)1084 .elementByAccessibilityId('text_q2')1085 .should.eventually.exist1086 });1087 it("text_q2 : ", function () {1088 return driver1089 .elementByAccessibilityId('text_q2')1090 .then(function (el) {1091 return el1092 .elementByClassName('android.widget.TextView')...
select-one.js
Source:select-one.js
...72 });73 it("se_one_b2 : 3", function () {74 return driver75 .elementByAccessibilityId('se_one_b2')76 .then(el => el.elementByXPath('//android.widget.RelativeLayout[3]//android.widget.RadioButton').tap())77 });78 it("se_one_b2 : 0", function () {79 return driver80 .elementByAccessibilityId('se_one_b2')81 .then(el => el.elementsByClassName('android.widget.RadioButton'))82 .then(els => els[0].tap())83 });84 it("se_one_b2 : 1", function () {85 return driver86 .elementByAccessibilityId('se_one_b2')87 .then(el => el.elementsByClassName('android.widget.RadioButton'))88 .at(1)89 .tap()90 });91 /*it("se_one_b3 : 3", function () {92 return driver93 .elementByAccessibilityId('se_one_b3')94 .then(function (el) {95 return el96 .elementByClassName('android.widget.RatingBar')97 .then(function (el) {98 return Q.all([99 el.getSize(),100 el.getLocation()101 ])102 .then(function (res) {103 let size = res[0];104 let loc = res[1];105 let yCenter = size.height / 2;106 let starWidth = size.width / 5;107 let action = new wd.TouchAction(driver);108 action.tap({x:loc.x+2*starWidth+yCenter, y:loc.y+yCenter});109 return driver.performTouchAction(action);110 })111 })112 })113 });114 it("se_one_b4 : 5", function () {115 return driver116 .elementByAccessibilityId('se_one_b4')117 .then(function (el) {118 return el119 .elementByClassName('android.widget.RatingBar')120 .then(function (el) {121 return Q.all([122 el.getSize(),123 el.getLocation()124 ])125 .then(function (res) {126 let size = res[0];127 let loc = res[1];128 let yCenter = size.height / 2;129 let starWidth = size.width / 5;130 let action = new wd.TouchAction(driver);131 action.tap({x:loc.x+4*starWidth+yCenter, y:loc.y+yCenter});132 return driver.performTouchAction(action);133 })134 })135 })136 });137 it("se_one_b5 : 1", function () {138 return driver139 .elementByAccessibilityId('se_one_b5')140 .then(function (el) {141 return el142 .elementByClassName('android.widget.RatingBar')143 .then(function (el) {144 return Q.all([145 el.getSize(),146 el.getLocation()147 ])148 .then(function (res) {149 let size = res[0];150 let loc = res[1];151 let yCenter = size.height / 2;152 let starWidth = size.width / 5;153 let action = new wd.TouchAction(driver);154 action.tap({x:loc.x+starWidth+yCenter, y:loc.y+yCenter});155 return driver.performTouchAction(action);156 })157 })158 })159 });160 it("se_one_b6 : 1", function () {161 return driver162 .elementByAccessibilityId('se_one_b6')163 .then(function (el) {164 return el165 .elementByClassName('android.widget.RatingBar')166 .then(function (el) {167 return Q.all([168 el.getSize(),169 el.getLocation()170 ])171 .then(function (res) {172 let size = res[0];173 let loc = res[1];174 let yCenter = size.height / 2;175 let starWidth = size.width / 5;176 let action = new wd.TouchAction(driver);177 action.tap({x:loc.x+starWidth+yCenter, y:loc.y+yCenter});178 return driver.performTouchAction(action);179 })180 })181 })182 });183 it("se_one_b7 : 5", function () {184 return driver185 .elementByAccessibilityId('se_one_b7')186 .then(function (el) {187 return el188 .elementByClassName('android.widget.RatingBar')189 .then(function (el) {190 return Q.all([191 el.getSize(),192 el.getLocation()193 ])194 .then(function (res) {195 let size = res[0];196 let loc = res[1];197 let yCenter = size.height / 2;198 let starWidth = size.width / 5;199 let action = new wd.TouchAction(driver);200 action.tap({x:loc.x+4*starWidth+yCenter, y:loc.y+yCenter});201 return driver.performTouchAction(action);202 })203 })204 })205 });206 it("se_one_b8 : 4", function () {207 return driver208 .elementByAccessibilityId('se_one_b8')209 .then(function (el) {210 return el211 .elementByClassName('android.widget.RatingBar')212 .then(function (el) {213 return Q.all([214 el.getSize(),215 el.getLocation()216 ])217 .then(function (res) {218 let size = res[0];219 let loc = res[1];220 let yCenter = size.height / 2;221 let starWidth = size.width / 5;222 let action = new wd.TouchAction(driver);223 action.tap({x:loc.x+3*starWidth+yCenter, y:loc.y+yCenter});224 return driver.performTouchAction(action);225 })226 })227 })228 });229 it("se_one_b9 : 4", function () {230 return driver231 .elementByAccessibilityId('se_one_b9')232 .then(function (el) {233 return el234 .elementByClassName('android.widget.RatingBar')235 .then(function (el) {236 return Q.all([237 el.getSize(),238 el.getLocation()239 ])240 .then(function (res) {241 let size = res[0];242 let loc = res[1];243 let yCenter = size.height / 2;244 let starWidth = size.width / 5;245 let action = new wd.TouchAction(driver);246 action.tap({x:loc.x+3*starWidth+yCenter, y:loc.y+yCenter});247 return driver.performTouchAction(action);248 })249 })250 })251 });252 it("Scroll To Specific Question", function () {253 return driver.scrollTo('//*[@content-desc="se_one_b10"]//android.widget.RatingBar');254 });255 it("se_one_b10 : 4", function () {256 return driver257 .elementByAccessibilityId('se_one_b10')258 .then(function (el) {259 return el260 .elementByClassName('android.widget.RatingBar')261 .then(function (el) {262 return Q.all([263 el.getSize(),264 el.getLocation()265 ])266 .then(function (res) {267 let size = res[0];268 let loc = res[1];269 let yCenter = size.height / 2;270 let starWidth = size.width / 5;271 let action = new wd.TouchAction(driver);272 action.tap({x:loc.x+3*starWidth+yCenter, y:loc.y+yCenter});273 return driver.performTouchAction(action);274 })275 })276 })277 });278 it("Scroll To Specific Question", function () {279 return driver.scrollTo('//*[@content-desc="se_one_b17"]//android.widget.LinearLayout[2]//android.widget.TextView');280 });281 it("se_one_b17 : 3", function () {282 return driver283 .elementByAccessibilityId('se_one_b17')284 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView').tap())285 .elementByXPath('//android.widget.ListView//android.widget.CheckedTextView[3]').tap()286 });287 it("Scroll To Specific Question", function () {288 return driver.scrollTo('//*[@content-desc="se_one_b18"]//android.widget.LinearLayout[2]//android.widget.TextView');289 });290 it("se_one_b18 : 1", function () {291 return driver292 .elementByAccessibilityId('se_one_b18')293 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView').tap())294 .elementByXPath('//android.widget.ListView//android.widget.CheckedTextView[1]').tap()295 });296 it("Scroll To Specific Question", function () {297 return driver.scrollTo('//*[@content-desc="se_one_b19"]//android.widget.LinearLayout[2]//android.widget.TextView');298 });299 it("se_one_b19 : 4", function () {300 return driver301 .elementByAccessibilityId('se_one_b19')302 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView').tap())303 .elementByXPath('//android.widget.ListView//android.widget.CheckedTextView[4]').tap()304 });305 it("Scroll To Specific Question", function () {306 return driver.scrollTo('//*[@content-desc="se_one_b20"]//android.widget.GridView//android.widget.TextView[4]');307 });308 it("se_one_b20 : 4", function () {309 return driver310 .elementByAccessibilityId('se_one_b20')311 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[4]').tap())312 });313 it("Scroll To Specific Question", function () {314 return driver.scrollTo('//*[@content-desc="se_one_b21"]//android.widget.GridView//android.widget.TextView[4]');315 });316 it("se_one_b21 : 2", function () {317 return driver318 .elementByAccessibilityId('se_one_b21')319 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[4]').tap())320 });321 it("Scroll To Specific Question", function () {322 return driver.scrollTo('//*[@content-desc="se_one_b22"]//android.widget.GridView//android.widget.TextView[2]');323 });324 it("se_one_b22 : 2", function () {325 return driver326 .elementByAccessibilityId('se_one_b22')327 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[2]').tap())328 });329 it("Scroll To Specific Question", function () {330 return driver.scrollTo('//*[@content-desc="se_one_b23"]//android.widget.GridView//android.widget.TextView[1]');331 });332 it("se_one_b23 : 1", function () {333 return driver334 .elementByAccessibilityId('se_one_b23')335 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[1]').tap())336 });337 it("Scroll To Specific Question", function () {338 return driver.scrollTo('//*[@content-desc="se_one_b24"]//android.widget.GridView//android.widget.TextView[1]');339 });340 it("se_one_b24 : 1", function () {341 return driver342 .elementByAccessibilityId('se_one_b24')343 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[1]').tap())344 });345 it("Scroll To Specific Question", function () {346 return driver.scrollTo('//*[@content-desc="se_one_b25"]//android.widget.GridView//android.widget.TextView[2]');347 });348 it("se_one_b25 : 2", function () {349 return driver350 .elementByAccessibilityId('se_one_b25')351 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[2]').tap())352 });353 it("Scroll To Specific Question", function () {354 return driver.scrollTo('//*[@content-desc="se_one_b26"]//android.widget.GridView//android.widget.TextView[4]');355 });356 it("se_one_b26 : 4", function () {357 return driver358 .elementByAccessibilityId('se_one_b26')359 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[4]').tap())360 });361 it("Scroll To Specific Question", function () {362 return driver.scrollTo('//*[@content-desc="se_one_b27"]//android.widget.GridView//android.widget.TextView[1]');363 });364 it("se_one_b27 : 1", function () {365 return driver366 .elementByAccessibilityId('se_one_b27')367 .then(el => el.elementByXPath('//android.widget.GridView//android.widget.TextView[1]').tap())368 });369 it("Scroll To Specific Question", function () {370 return driver.scrollTo('//*[@content-desc="se_one_b28"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');371 });372 it("se_one_b28 : 2", function () {373 return driver374 .elementByAccessibilityId('se_one_b28')375 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())376 });377 it("Scroll To Specific Question", function () {378 return driver.scrollTo('//*[@content-desc="se_one_b29"]//android.widget.LinearLayout[2]//android.widget.TextView[1]');379 });380 it("se_one_b29 : 1", function () {381 return driver382 .elementByAccessibilityId('se_one_b29')383 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[1]').tap())384 });385 it("Scroll To Specific Question", function () {386 return driver.scrollTo('//*[@content-desc="se_one_b30"]//android.widget.LinearLayout[2]//android.widget.TextView[4]');387 });388 it("se_one_b30 : 4", function () {389 return driver390 .elementByAccessibilityId('se_one_b30')391 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[4]').tap())392 });393 it("Scroll To Specific Question", function () {394 return driver.scrollTo('//*[@content-desc="se_one_b31"]//android.widget.LinearLayout[2]//android.widget.TextView[3]');395 });396 it("se_one_b31 : 3", function () {397 return driver398 .elementByAccessibilityId('se_one_b31')399 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[3]').tap())400 });401 it("Scroll To Specific Question", function () {402 return driver.scrollTo('//*[@content-desc="se_one_b32"]//android.widget.LinearLayout[2]//android.widget.TextView[3]');403 });404 it("se_one_b32 : 3", function () {405 return driver406 .elementByAccessibilityId('se_one_b32')407 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[3]').tap())408 });409 it("Scroll To Specific Question", function () {410 return driver.scrollTo('//*[@content-desc="se_one_b33"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');411 });412 it("se_one_b33 : 2", function () {413 return driver414 .elementByAccessibilityId('se_one_b33')415 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())416 });417 it("Scroll To Specific Question", function () {418 return driver.scrollTo('//*[@content-desc="se_one_b34"]//android.widget.LinearLayout[2]//android.widget.TextView[1]');419 });420 // error421 it("se_one_b34 : 1", function () {422 return driver423 .elementByAccessibilityId('se_one_b34')424 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[1]').tap())425 });426 it("Scroll To Specific Question", function () {427 return driver.scrollTo('//*[@content-desc="se_one_b35"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');428 });429 it("se_one_b35 : 2", function () {430 return driver431 .elementByAccessibilityId('se_one_b35')432 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())433 });434 it("Scroll To Specific Question", function () {435 return driver.scrollTo('//*[@content-desc="se_one_b36"]//android.widget.LinearLayout[2]//android.widget.TextView[1]');436 });437 it("se_one_b36 : 1", function () {438 return driver439 .elementByAccessibilityId('se_one_b36')440 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[1]').tap())441 });442 it("Scroll To Specific Question", function () {443 return driver.scrollTo('//*[@content-desc="se_one_b37"]//android.widget.LinearLayout[2]//android.widget.TextView[3]');444 });445 it("se_one_b37 : 3", function () {446 return driver447 .elementByAccessibilityId('se_one_b37')448 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[3]').tap())449 });450 it("Scroll To Specific Question", function () {451 return driver.scrollTo('//*[@content-desc="se_one_b38"]//android.widget.LinearLayout[2]//android.widget.TextView[1]');452 });453 it("se_one_b38 : 1", function () {454 return driver455 .elementByAccessibilityId('se_one_b38')456 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[1]').tap())457 });458 it("Scroll To Specific Question", function () {459 return driver.scrollTo('//*[@content-desc="se_one_b39"]//android.widget.LinearLayout[2]//android.widget.TextView[4]');460 });461 it("se_one_b39 : 4", function () {462 return driver463 .elementByAccessibilityId('se_one_b39')464 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[4]').tap())465 });466 it("Scroll To Specific Question", function () {467 return driver.scrollTo('//*[@content-desc="se_one_b40"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');468 });469 it("se_one_b40 : 2", function () {470 return driver471 .elementByAccessibilityId('se_one_b40')472 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))473 .sleep(1000)474 .elementById('vn.rta.rtsurvey:id/selection_view')475 .getLocation()476 .then(function (loc) {477 var action = new wd.TouchAction(driver);478 action.tap({x: loc.x + 100, y: loc.y + 290});479 return driver.performTouchAction(action).sleep(1000)480 })481 .back().back().back()482 });483 it("Scroll To Specific Question", function () {484 return driver.scrollTo('//*[@content-desc="se_one_b41"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');485 });486 it("se_one_b41 : 2", function () {487 return driver488 .elementByAccessibilityId('se_one_b41')489 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))490 .sleep(1000)491 .elementById('vn.rta.rtsurvey:id/selection_view')492 .getLocation()493 .then(function (loc) {494 var action = new wd.TouchAction();495 action.tap({x: loc.x + 100, y: loc.y + 290}).release();496 return driver.performTouchAction(action).sleep(1000)497 })498 .back().back().back()499 });500 it("Scroll To Specific Question", function () {501 return driver.scrollTo('//*[@content-desc="se_one_b42"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');502 });503 it("se_one_b42 : 2", function () {504 return driver505 .elementByAccessibilityId('se_one_b42')506 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))507 .sleep(1000)508 .elementById('vn.rta.rtsurvey:id/selection_view')509 .getLocation()510 .then(function (loc) {511 var action = new wd.TouchAction();512 action.tap({x: loc.x + 100, y: loc.y + 290}).release();513 return driver.performTouchAction(action).sleep(1000)514 })515 .back().back().back()516 });517 it("Scroll To Specific Question", function () {518 return driver.scrollTo('//*[@content-desc="se_one_b43"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');519 });520 it("se_one_b43 : 1", function () {521 return driver522 .elementByAccessibilityId('se_one_b43')523 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))524 .sleep(1000)525 .elementById('vn.rta.rtsurvey:id/selection_view')526 .getLocation()527 .then(function (loc) {528 var action = new wd.TouchAction();529 action.tap({x: loc.x + 100, y: loc.y + 205}).release();530 return driver.performTouchAction(action).sleep(1000)531 })532 .back().back().back()533 });534 it("Scroll To Specific Question", function () {535 return driver.scrollTo('//*[@content-desc="se_one_b44"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');536 });537 it("se_one_b44 : 3", function () {538 return driver539 .elementByAccessibilityId('se_one_b44')540 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))541 .sleep(1000)542 .elementById('vn.rta.rtsurvey:id/selection_view')543 .getLocation()544 .then(function (loc) {545 var action = new wd.TouchAction();546 action.tap({x: loc.x + 100, y: loc.y + 290});547 return driver.performTouchAction(action).sleep(1000)548 })549 .back().back().back()550 });551 it("Scroll To Specific Question", function () {552 return driver.scrollTo('//*[@content-desc="se_one_b45"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');553 });554 it("se_one_b45 : 3", function () {555 return driver556 .elementByAccessibilityId('se_one_b45')557 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))558 .sleep(1000)559 .elementById('vn.rta.rtsurvey:id/selection_view')560 .getLocation()561 .then(function (loc) {562 var action = new wd.TouchAction();563 action.tap({x: loc.x + 100, y: loc.y + 290});564 return driver.performTouchAction(action).sleep(1000)565 })566 .back().back().back()567 });568 it("Scroll To Specific Question", function () {569 return driver.scrollTo('//*[@content-desc="se_one_b46"]//android.widget.EditText');570 });571 it("se_one_b46 : 1", function () {572 return driver573 .elementByAccessibilityId('se_one_b46')574 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))575 .sleep(1000)576 .elementById('vn.rta.rtsurvey:id/recycler_view')577 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.TextView').tap())578 });579 it("Scroll To Specific Question", function () {580 return driver.scrollTo('//*[@content-desc="se_one_b47"]//android.widget.EditText');581 });582 it("se_one_b47 : 2", function () {583 return driver584 .elementByAccessibilityId('se_one_b47')585 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))586 .sleep(1000)587 .elementById('vn.rta.rtsurvey:id/recycler_view')588 .then(el => el.elementByXPath('//android.widget.RelativeLayout[2]//android.widget.TextView').tap())589 });590 it("Scroll To Specific Question", function () {591 return driver.scrollTo('//*[@content-desc="se_one_b48"]//android.widget.EditText');592 });593 it("se_one_b48 : 3", function () {594 return driver595 .elementByAccessibilityId('se_one_b48')596 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))597 .sleep(1000)598 .elementById('vn.rta.rtsurvey:id/recycler_view')599 .then(el => el.elementByXPath('//android.widget.RelativeLayout[3]//android.widget.TextView').tap())600 });601 it("Scroll To Specific Question", function () {602 return driver.scrollTo('//*[@content-desc="se_one_b49"]//android.widget.EditText');603 });604 it("se_one_b49 : 4", function () {605 return driver606 .elementByAccessibilityId('se_one_b49')607 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))608 .sleep(1000)609 .elementById('vn.rta.rtsurvey:id/recycler_view')610 .then(el => el.elementByXPath('//android.widget.RelativeLayout[4]//android.widget.TextView').tap())611 });612 it("Scroll To Specific Question", function () {613 return driver.scrollTo('//*[@content-desc="se_one_b50"]//android.widget.LinearLayout[2]//android.widget.TextView[4]');614 });615 it("se_one_b50 : 4", function () {616 return driver617 .elementByAccessibilityId('se_one_b50')618 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[4]').tap())619 });620 it("Scroll To Specific Question", function () {621 return driver.scrollTo('//*[@content-desc="se_one_b51"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');622 });623 it("se_one_b51 : 2", function () {624 return driver625 .elementByAccessibilityId('se_one_b51')626 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())627 });628 it("Scroll To Specific Question", function () {629 return driver.scrollTo('//*[@content-desc="se_one_b52"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');630 });631 it("se_one_b52 : 2", function () {632 return driver633 .elementByAccessibilityId('se_one_b52')634 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())635 });636 it("Scroll To Specific Question", function () {637 return driver.scrollTo('//*[@content-desc="se_one_b53"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');638 });639 it("se_one_b53 : 2", function () {640 return driver641 .elementByAccessibilityId('se_one_b53')642 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())643 });644 it("Scroll To Specific Question", function () {645 return driver.scrollTo('//*[@content-desc="se_one_b50"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');646 });647 it("se_one_b54 : 2", function () {648 return driver649 .elementByAccessibilityId('se_one_b54')650 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())651 });652 it("Scroll To Specific Question", function () {653 return driver.scrollTo('//*[@content-desc="se_one_b55"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');654 });655 it("se_one_b55 : 2", function () {656 return driver657 .elementByAccessibilityId('se_one_b55')658 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())659 });660 it("Scroll To Specific Question", function () {661 return driver.scrollTo('//*[@content-desc="se_one_b56"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');662 });663 it("se_one_b56 : 2", function () {664 return driver665 .elementByAccessibilityId('se_one_b56')666 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())667 });668 it("Scroll To Specific Question", function () {669 return driver.scrollTo('//*[@content-desc="se_one_b57"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');670 });671 it("se_one_b57 : 2", function () {672 return driver673 .elementByAccessibilityId('se_one_b57')674 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())675 });676 it("Scroll To Specific Question", function () {677 return driver.scrollTo('//*[@content-desc="se_one_b58"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');678 });679 it("se_one_b58 : 2", function () {680 return driver681 .elementByAccessibilityId('se_one_b58')682 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())683 });684 it("Scroll To Specific Question", function () {685 return driver.scrollTo('//*[@content-desc="se_one_b59"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');686 });687 it("se_one_b59 : 2", function () {688 return driver689 .elementByAccessibilityId('se_one_b59')690 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())691 });692 it("Scroll To Specific Question", function () {693 return driver.scrollTo('//*[@content-desc="se_one_b60"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');694 });695 it("se_one_b60 : 2", function () {696 return driver697 .elementByAccessibilityId('se_one_b60')698 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())699 });700 it("Scroll To Specific Question", function () {701 return driver.scrollTo('//*[@content-desc="se_one_b61"]//android.widget.LinearLayout[2]//android.widget.TextView[2]');702 });703 it("se_one_b61 : 2", function () {704 return driver705 .elementByAccessibilityId('se_one_b61')706 .then(el => el.elementByXPath('//android.widget.LinearLayout[2]//android.widget.TextView[2]').tap())707 });708 it("Scroll To Specific Question", function () {709 return driver.scrollTo('//*[@content-desc="se_one_b62"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');710 });711 it("se_one_b62 : 3", function () {712 return driver713 .elementByAccessibilityId('se_one_b62')714 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))715 .sleep(1000)716 .elementById('vn.rta.rtsurvey:id/selection_view')717 .getLocation()718 .then(function (loc) {719 var action = new wd.TouchAction();720 action.tap({x: loc.x + 100, y: loc.y + 290});721 return driver.performTouchAction(action).sleep(1000)722 })723 .back().back().back()724 });725 it("Scroll To Specific Question", function () {726 return driver.scrollTo('//*[@content-desc="se_one_b63"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');727 });728 it("se_one_b63 : 3", function () {729 return driver730 .elementByAccessibilityId('se_one_b63')731 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))732 .sleep(1000)733 .elementById('vn.rta.rtsurvey:id/selection_view')734 .getLocation()735 .then(function (loc) {736 var action = new wd.TouchAction();737 action.tap({x: loc.x + 100, y: loc.y + 290});738 return driver.performTouchAction(action).sleep(1000)739 })740 .back().back().back()741 });742 it("Scroll To Specific Question", function () {743 return driver.scrollTo('//*[@content-desc="se_one_b64"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');744 });745 it("se_one_b64 : 0", function () {746 return driver747 .elementByAccessibilityId('se_one_b64')748 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))749 .sleep(1000)750 .elementById('vn.rta.rtsurvey:id/selection_view')751 .getLocation()752 .then(function (loc) {753 var action = new wd.TouchAction();754 action.tap({x: loc.x + 100, y: loc.y + 120});755 return driver.performTouchAction(action).sleep(1000)756 })757 .back().back().back()758 });759 it("Scroll To Specific Question", function () {760 return driver.scrollTo('//*[@content-desc="se_one_b65"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');761 });762 it("se_one_b65 : 2", function () {763 return driver764 .elementByAccessibilityId('se_one_b65')765 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))766 .sleep(1000)767 .elementById('vn.rta.rtsurvey:id/selection_view')768 .getLocation()769 .then(function (loc) {770 var action = new wd.TouchAction();771 action.tap({x: loc.x + 100, y: loc.y + 290});772 return driver.performTouchAction(action).sleep(1000)773 })774 .back().back().back()775 });776 it("Scroll To Specific Question", function () {777 return driver.scrollTo('//*[@content-desc="se_one_b66"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');778 });779 it("se_one_b66 : 2", function () {780 return driver781 .elementByAccessibilityId('se_one_b66')782 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))783 .sleep(1000)784 .elementById('vn.rta.rtsurvey:id/selection_view')785 .getLocation()786 .then(function (loc) {787 var action = new wd.TouchAction();788 action.tap({x: loc.x + 100, y: loc.y + 290});789 return driver.performTouchAction(action).sleep(1000)790 })791 .back().back().back()792 });793 it("Scroll To Specific Question", function () {794 return driver.scrollTo('//*[@content-desc="se_one_b67"]//*[@resource-id="vn.rta.rtsurvey:id/selection_view"]');795 });796 it("se_one_b67 : 1", function () {797 return driver798 .elementByAccessibilityId('se_one_b67')799 .then(el => el.elementById('vn.rta.rtsurvey:id/selection_view').setImmediateValue('h'))800 .sleep(1000)801 .elementById('vn.rta.rtsurvey:id/selection_view')802 .getLocation()803 .then(function (loc) {804 var action = new wd.TouchAction();805 action.tap({x: loc.x + 100, y: loc.y + 120});806 return driver.performTouchAction(action).sleep(1000)807 })808 .back().back().back()809 });810 it("Scroll To Specific Question", function () {811 return driver.scrollTo('//*[@content-desc="se_one_b68"]//android.widget.EditText');812 });813 it("se_one_b68 : 1", function () {814 return driver815 .elementByAccessibilityId('se_one_b68')816 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))817 .sleep(1000)818 .elementById('vn.rta.rtsurvey:id/recycler_view')819 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.TextView').tap())820 });821 it("Scroll To Specific Question", function () {822 return driver.scrollTo('//*[@content-desc="se_one_b69"]//android.widget.EditText');823 });824 it("se_one_b69 : 2", function () {825 return driver826 .elementByAccessibilityId('se_one_b69')827 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))828 .sleep(1000)829 .elementById('vn.rta.rtsurvey:id/recycler_view')830 .then(el => el.elementByXPath('//android.widget.RelativeLayout[2]//android.widget.TextView').tap())831 });832 it("Scroll To Specific Question", function () {833 return driver.scrollTo('//*[@content-desc="se_one_b70"]//android.widget.EditText');834 });835 it("se_one_b70 : 3", function () {836 return driver837 .elementByAccessibilityId('se_one_b70')838 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))839 .sleep(1000)840 .elementById('vn.rta.rtsurvey:id/recycler_view')841 .then(el => el.elementByXPath('//android.widget.RelativeLayout[3]//android.widget.TextView').tap())842 });843 it("Scroll To Specific Question", function () {844 return driver.scrollTo('//*[@content-desc="se_one_b71"]//android.widget.EditText');845 });846 it("se_one_b71 : 4", function () {847 return driver848 .elementByAccessibilityId('se_one_b71')849 .then(el => el.elementByClassName('android.widget.EditText').setImmediateValue('h'))850 .sleep(1000)851 .elementById('vn.rta.rtsurvey:id/recycler_view')852 .then(el => el.elementByXPath('//android.widget.RelativeLayout[4]//android.widget.TextView').tap())853 });*/...
map-steps.js
Source:map-steps.js
...74 });75 };76 loopForElement();77 function clickableEle(el) {78 el.elementByXPath(XPath2, function(err, ele) {79 if(err || !ele) {80 el.elementByXPath('..', function(err, eleParent) {81 if(err || !eleParent) {82 reject(err);83 } else {84 clickableEle(eleParent);85 }86 });87 } else {88 // waitForElementEnabled clicks on things to make sure its89 // enabled already90 helper.waitForElementEnabled(ele, 5000, function(err) {91 if(err) {92 reject(err);93 } else {94 resolve();95 }96 });97 }98 });99 }100 });101 };102 this.clickXPathComponent = function(XPath, self){103 var browser = self.browser;104 return Q.Promise(function(resolve, reject, notify) {105 106 browser.waitForElementByXPath(XPath, function (err, el) {107 if (err || (el == null) ) {108 err = err ? err : new Error('Did not find component');109 reject(err);110 } else {111 helper.waitForElementEnabled(el, 5000, function(err) {112 if (err){113 reject(err);114 } else {115 resolve();116 }117 });118 }119 });120 });121 };122 this.typeIntoXPathComponent = function(text, XPath, self){123 var browser = self.browser;124 return Q.Promise(function(resolve, reject, notify) {125 browser.waitForElementByXPath(XPath, function (err, el) {126 if (err || (el == null) ) {127 reject(err);128 } else {129 el.clear(function(err) {130 if (err) {131 reject(err);132 } else {133 browser.type(el, text, function(err) {134 if (err) {135 reject(err);136 } else {137 resolve();138 }139 });140 }141 });142 }143 });144 });145 };146 this.waitForTextPresent = function(text, timeout, self) {147 var startTime = (new Date()).getTime();148 return Q.Promise(function(resolve, reject, notify) {149 function loopForPresentText() {150 mapSteps.isTextPresent(text, self).then(151 function() {152 resolve();153 },154 function(reason) {155 if( (new Date()).getTime() - startTime > timeout ) {156 reject(new Error('Text present timed out'));157 } else {158 loopForPresentText();159 }160 }161 );162 }163 loopForPresentText();164 });165 }166 this.isTextPresent = function(text, self){167 var XPath = self.namedSelectors.getXPath("content_contains", text);168 return Q.Promise(function(resolve, reject, notify) {169 self.browser.waitForElementByXPath(XPath, self.asserters.isDisplayed, function(err, el) {170 if (helper.exists(el) && ! err) {171 resolve();172 } else {173 reject(err);174 }175 });176 });177 };178 this.keyHit = function(key, self) {179 return Q.Promise(function(resolve, reject, notify) {180 self.browser.keys(self.specialKeys[key], function(err) {181 if(err) {182 reject(err);183 } else {184 resolve();185 }186 });187 });188 };189 this.shouldFindBothInTheSameRow = function(textOne, textTwo, parentElement, self) {190 var XPath = self.namedSelectors.getXPath('node_with_content', textOne);191 var browser = self.browser;192 return Q.Promise(function(resolve, reject, notify) {193 browser.waitForElementByXPath(XPath, function(err, el) {194 if(err) {195 reject(err);196 } else {197 findParent(el);198 }199 });200 function findParent(el){201 var XPath = self.namedSelectors.getXPath('node_with_content', textTwo);202 el.elementByXPath(XPath, function(err, ele) {203 // If we didn't find the element that contains our text204 if(err || !ele) {205 // Get the parent element206 el.elementByXPath('..', function(err, eleParent) {207 // If there is no parent element then we are at root208 // and the text does not exists209 if(err || !eleParent) {210 reject(err);211 } else {212 // Find the text in our parent function213 findParent(eleParent);214 }215 });216 } else {217 // We found our element, ele that contains218 // our text!219 el.getTagName(function(err, name) {220 if(err || name != parentElement) {221 //reject(err);222 el.elementByXPath('..', function(err, eleParent) {223 // If there is no parent element then we are at root224 // and the text does not exists225 if(err || !eleParent) {226 reject(err);227 } else {228 // Find the text in our parent function229 findParent(eleParent);230 }231 });232 } else {233 resolve();234 }235 });236 }...
ios-selectOne-simulator.js
Source:ios-selectOne-simulator.js
...94 // .then(_p.filterDisplayed)95 // .then(function (els) {els.should.have.length(1); return els;})96 // .first()97 .elementByAccessibilityId('se_one_b2')98 .then(el => el.elementByXPath('//XCUIElementTypeOther[2]//XCUIElementTypeOther[3]//XCUIElementTypeButton').tap())99 });100 it("se_one_b3", function () {101 return driver102 .elementsByAccessibilityId('se_one_b3')103 .then(_p.filterDisplayed)104 .then(els => {els.should.have.length(1); return els;})105 .first()106 .elementsByClassName('>', 'XCUIElementTypeButton')107 .at(0).tap()108 });109 it("se_one_b4", function () {110 return driver111 .elementByAccessibilityId('se_one_b4')112 .elementsByClassName('>', 'XCUIElementTypeButton').at(1).tap()113 });114 it("se_one_b5", function () {115 return driver116 .elementByAccessibilityId('se_one_b5')117 .then(el => el.elementByXPath('//XCUIElementTypeButton[3]').tap())118 });119 it("se_one_b6", function () {120 return driver121 .elementByAccessibilityId('se_one_b6')122 .then(el => el.elementByXPath('//XCUIElementTypeButton[4]').tap())123 });124 it("se_one_b7", function () {125 return driver126 .elementByAccessibilityId('se_one_b7')127 .then(el => el.elementByXPath('//XCUIElementTypeButton[5]').tap())128 });129 it("se_one_b8", function () {130 return driver131 .elementByAccessibilityId('se_one_b8')132 .then(el => el.elementByXPath('//XCUIElementTypeButton[5]').tap())133 });134 it("Scroll Down", function () {135 return driver.swipe({startX: 100, startY: 600, endX: 100, endY: 100, duration: 1000})136 });137 it("se_one_b9", function () {138 return driver139 .elementByAccessibilityId('se_one_b9')140 .then(el => el.elementByXPath('//XCUIElementTypeButton[5]').tap())141 });142 it("se_one_b10", function () {143 return driver144 .elementByAccessibilityId('se_one_b10')145 .then(el => el.elementByXPath('//XCUIElementTypeButton[5]').tap())146 });147 // it("se_one_b11", function () {148 // return driver149 // .elementByAccessibilityId('se_one_b11')150 // .then(el => el.elementByXPath('//XCUIElementTypeOther[2]//XCUIElementTypeOther[5]//XCUIElementTypeButton').tap())151 // });152 it("Scroll to b17", function () {153 return driver.scrollTo('se_one_b17');154 });155 156 it("se_one_b17", function () {157 return driver158 .elementByAccessibilityId('se_one_b17')159 .then(el => el.elementByClassName('XCUIElementTypeButton').tap())160 .elementByClassName('XCUIElementTypeTable')161 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())162 .elementByName('Done').tap()163 });164 /*it("se_one_b18", function () {165 return driver166 .elementByAccessibilityId('se_one_b18')167 .then(el => el.elementByClassName('XCUIElementTypeButton').tap())168 .elementByClassName('XCUIElementTypeTable')169 .then(el => el.elementByXPath('//XCUIElementTypeButton[1]').tap())170 .elementByName('Done').tap()171 });172 it("se_one_b19", function () {173 return driver174 .elementByAccessibilityId('se_one_b19')175 .then(el => el.elementByClassName('XCUIElementTypeButton').tap())176 .elementByClassName('XCUIElementTypeTable')177 .then(el => el.elementByXPath('//XCUIElementTypeButton[1]').tap())178 .elementByName('Done').tap()179 });180 it("se_one_b20", function () {181 return driver182 .elementByAccessibilityId('se_one_b20')183 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())184 });185 it("se_one_b21", function () {186 return driver187 .elementByAccessibilityId('se_one_b21')188 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())189 });190 it("se_one_b22", function () {191 return driver192 .elementByAccessibilityId('se_one_b22')193 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())194 });195 it("se_one_b23", function () {196 return driver197 .elementByAccessibilityId('se_one_b23')198 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())199 });200 it("se_one_b24", function () {201 return driver202 .elementByAccessibilityId('se_one_b24')203 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())204 });205 it("se_one_b25", function () {206 return driver207 .elementByAccessibilityId('se_one_b25')208 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())209 });210 it("Scroll Down", function () {211 return driver.swipe({startX: 100, startY: 600, endX: 100, endY: 100, duration: 1000})212 });213 it("se_one_b26", function () {214 return driver215 .elementByAccessibilityId('se_one_b26')216 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())217 });218 it("se_one_b27", function () {219 return driver220 .elementByAccessibilityId('se_one_b27')221 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())222 });223 it("se_one_b28", function () {224 return driver225 .elementByAccessibilityId('se_one_b28')226 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())227 });228 it("se_one_b29", function () {229 return driver230 .elementByAccessibilityId('se_one_b29')231 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())232 });233 it("se_one_b30", function () {234 return driver235 .elementByAccessibilityId('se_one_b30')236 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())237 });238 it("se_one_b31", function () {239 return driver240 .elementByAccessibilityId('se_one_b31')241 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())242 });243 it("Scroll Down", function () {244 return driver.swipe({startX: 100, startY: 600, endX: 100, endY: 100, duration: 1000})245 });246 it("se_one_b32", function () {247 return driver248 .elementByAccessibilityId('se_one_b32')249 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())250 });251 it("se_one_b33", function () {252 return driver253 .elementByAccessibilityId('se_one_b33')254 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())255 });256 it("se_one_b34", function () {257 return driver258 .elementByAccessibilityId('se_one_b34')259 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())260 });261 it("se_one_b35", function () {262 return driver263 .elementByAccessibilityId('se_one_b35')264 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())265 });266 it("se_one_b36", function () {267 return driver268 .elementByAccessibilityId('se_one_b36')269 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())270 });271 it("Scroll Down", function () {272 return driver.swipe({startX: 100, startY: 600, endX: 100, endY: 100, duration: 1000})273 });274 it("se_one_b37", function () {275 return driver276 .elementByAccessibilityId('se_one_b37')277 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())278 });279 it("se_one_b38", function () {280 return driver281 .elementByAccessibilityId('se_one_b38')282 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())283 });284 it("se_one_b39", function () {285 return driver286 .elementByAccessibilityId('se_one_b39')287 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())288 });289 it("se_one_b40", function () {290 return driver291 .elementByAccessibilityId('se_one_b40')292 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))293 .elementByClassName('XCUIElementTypeTable')294 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())295 });296 it("se_one_b41", function () {297 return driver298 .elementByAccessibilityId('se_one_b41')299 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))300 .elementByClassName('XCUIElementTypeTable')301 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())302 });303 it("se_one_b42", function () {304 return driver305 .elementByAccessibilityId('se_one_b42')306 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))307 .elementByClassName('XCUIElementTypeTable')308 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())309 });310 it("se_one_b43", function () {311 return driver312 .elementByAccessibilityId('se_one_b43')313 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))314 .elementByClassName('XCUIElementTypeTable')315 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())316 });317 it("se_one_b44", function () {318 return driver319 .elementByAccessibilityId('se_one_b44')320 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))321 .elementByClassName('XCUIElementTypeTable')322 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())323 });324 it("se_one_b45", function () {325 return driver326 .elementByAccessibilityId('se_one_b45')327 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))328 .elementByClassName('XCUIElementTypeTable')329 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())330 });331 it("se_one_b46", function () {332 return driver333 .elementByAccessibilityId('se_one_b46')334 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))335 .elementByClassName('XCUIElementTypeTable')336 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())337 });338 it("se_one_b47", function () {339 return driver340 .elementByAccessibilityId('se_one_b47')341 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))342 .elementByClassName('XCUIElementTypeTable')343 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())344 });345 it("se_one_b48", function () {346 return driver347 .elementByAccessibilityId('se_one_b48')348 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))349 .elementByClassName('XCUIElementTypeTable')350 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())351 });352 it("se_one_b49", function () {353 return driver354 .elementByAccessibilityId('se_one_b49')355 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))356 .elementByClassName('XCUIElementTypeTable')357 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())358 });359 it("Scroll Down", function () {360 return driver.swipe({startX: 100, startY: 600, endX: 100, endY: 100, duration: 1000})361 });362 it("se_one_b50", function () {363 return driver364 .elementByAccessibilityId('se_one_b50')365 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())366 });367 it("se_one_b51", function () {368 return driver369 .elementByAccessibilityId('se_one_b51')370 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())371 });372 it("se_one_b52", function () {373 return driver374 .elementByAccessibilityId('se_one_b52')375 .then(function (el) {376 return el377 .elementsByClassName('XCUIElementTypeCell')378 .then(function (els) {379 return els[0].tap()380 })381 })382 });383 it("se_one_b53", function () {384 return driver385 .elementByAccessibilityId('se_one_b53')386 .then(function (el) {387 return el388 .elementsByClassName('XCUIElementTypeCell')389 .then(function (els) {390 return els[0].tap()391 })392 })393 });394 it("se_one_b54", function () {395 return driver396 .elementByAccessibilityId('se_one_b54')397 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())398 });399 it("se_one_b55", function () {400 return driver401 .elementByAccessibilityId('se_one_b55')402 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())403 });404 it("se_one_b56", function () {405 return driver406 .elementByAccessibilityId('se_one_b56')407 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())408 });409 it("Scroll Down 7", function () {410 return driver.swipe({startX: 100, startY: 600, endX: 100, endY: 100, duration: 1000})411 });412 it("se_one_b57", function () {413 return driver414 .elementByAccessibilityId('se_one_b57')415 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())416 });417 it("se_one_b58", function () {418 return driver419 .elementByAccessibilityId('se_one_b58')420 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())421 });422 it("se_one_b59", function () {423 return driver424 .elementByAccessibilityId('se_one_b59')425 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())426 });427 it("se_one_b60", function () {428 return driver429 .elementByAccessibilityId('se_one_b60')430 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())431 });432 it("se_one_b61", function () {433 return driver434 .elementByAccessibilityId('se_one_b61')435 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())436 });437 it("Scroll Down 8", function () {438 return driver.swipe({startX: 100, startY: 600, endX: 100, endY: 100, duration: 1000})439 });440 it("se_one_b62", function () {441 return driver442 .elementByAccessibilityId('se_one_b62')443 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))444 .elementByClassName('XCUIElementTypeTable')445 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())446 });447 it("se_one_b63", function () {448 return driver449 .elementByAccessibilityId('se_one_b63')450 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))451 .elementByClassName('XCUIElementTypeTable')452 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())453 });454 it("se_one_b64", function () {455 return driver456 .elementByAccessibilityId('se_one_b64')457 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))458 .elementByClassName('XCUIElementTypeTable')459 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())460 });461 it("se_one_b65", function () {462 return driver463 .elementByAccessibilityId('se_one_b65')464 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))465 .elementByClassName('XCUIElementTypeTable')466 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())467 });468 it("se_one_b66", function () {469 return driver470 .elementByAccessibilityId('se_one_b66')471 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))472 .elementByClassName('XCUIElementTypeTable')473 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())474 });475 it("se_one_b67", function () {476 return driver477 .elementByAccessibilityId('se_one_b67')478 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))479 .elementByClassName('XCUIElementTypeTable')480 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())481 });482 it("se_one_b68", function () {483 return driver484 .elementByAccessibilityId('se_one_b68')485 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))486 .elementByClassName('XCUIElementTypeTable')487 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())488 });489 it("se_one_b69", function () {490 return driver491 .elementByAccessibilityId('se_one_b69')492 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))493 .elementByClassName('XCUIElementTypeTable')494 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())495 });496 it("se_one_b70", function () {497 return driver498 .elementByAccessibilityId('se_one_b70')499 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))500 .elementByClassName('XCUIElementTypeTable')501 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())502 });503 it("se_one_b71", function () {504 return driver505 .elementByAccessibilityId('se_one_b71')506 .then(el => el.elementByClassName('XCUIElementTypeTextView').setImmediateValue('a'))507 .elementByClassName('XCUIElementTypeTable')508 .then(el => el.elementByXPath('//XCUIElementTypeCell[1]').tap())509 });*/...
text.js
Source:text.js
...163 });164 it("text_p8 : 1", function () {165 return driver166 .elementByAccessibilityId('text_p8')167 .then(el => el.elementByXPath('//android.widget.RadioButton[1]').tap())168 });169 it("text_p8 : 2", function () {170 return driver171 .elementByAccessibilityId('text_p8')172 .then(el => el.elementByXPath('//android.widget.RadioButton[2]').tap())173 });174 it("text_p8 : 3", function () {175 return driver176 .elementByAccessibilityId('text_p8')177 .then(el => el.elementByXPath('//android.widget.RadioGroup//android.widget.RadioButton[3]').tap())178 });179 it("text_p8 : 4", function () {180 return driver181 .elementByAccessibilityId('text_p8')182 .then(el => el.elementByXPath('//android.widget.RadioGroup//android.widget.RadioButton[4]').tap())183 });184 it("Scroll To Specific Question", function () {185 return driver.scrollTo('//*[@content-desc="text_p9"]');186 });187 it("text_p9 : bibendum, placerat enim vitae, tristique sapien. Proin aliquet non risus sit amet porttitor. Donec malesuada leo sit amet lacus venenatis,", function () {188 return driver189 .elementByAccessibilityId('text_p9')190 .then(el => el.elementByClassName('android.widget.EditText'))191 .setImmediateValue("bibendum, placerat enim vitae, tristique sapien. Proin aliquet non risus sit amet porttitor. Donec malesuada leo sit amet lacus venenatis,")192 .elementById('vn.rta.rtsurvey:id/btOk')193 .tap();194 })195 it("text_p10 : non ipsum at massa egestas feugiat eu in velit. Maecenas molestie magna et neque auctor vestibulum. Proin eget velit non", function () {196 return driver197 .elementByAccessibilityId('text_p10')198 .then(el => el.elementByClassName('android.widget.EditText'))199 .setImmediateValue("non ipsum at massa egestas feugiat eu in velit. Maecenas molestie magna et neque auctor vestibulum. Proin eget velit non")200 .hideKeyboard();201 })202 it("text_p11 : semper cursus. Praesent ultricies diam leo, et congue elit ultrices non. Pellentesque egestas venenatis turpis. Aenean ultricies sapien quis diam", function () {203 return driver204 .elementByAccessibilityId('text_p11')205 .then(el => el.elementByClassName('android.widget.EditText'))206 .setImmediateValue("semper cursus. Praesent ultricies diam leo, et congue elit ultrices non. Pellentesque egestas venenatis turpis. Aenean ultricies sapien quis diam")207 .hideKeyboard();208 })209 it("text_p12 : elit. Cras varius eget ex et cursus. Curabitur nec accumsan lectus. Morbi vehicula, nunc vel accumsan laoreet, eros purus bibendum", function () {210 return driver211 .elementByAccessibilityId('text_p12')212 .then(el => el.elementByClassName('android.widget.EditText'))213 .setImmediateValue("elit. Cras varius eget ex et cursus. Curabitur nec accumsan lectus. Morbi vehicula, nunc vel accumsan laoreet, eros purus bibendum")214 .hideKeyboard();215 })216 it("text_p13 : turpis. Fusce non eros justo. Aenean vitae tellus porta, consectetur metus ut, viverra tortor. Aenean tincidunt dui augue, eget facilisis", function () {217 return driver218 .elementByAccessibilityId('text_p13')219 .then(el => el.elementByClassName('android.widget.EditText'))220 .setImmediateValue("turpis. Fusce non eros justo. Aenean vitae tellus porta, consectetur metus ut, viverra tortor. Aenean tincidunt dui augue, eget facilisis")221 .hideKeyboard();222 })223 it("text_p14 : nibh. Nullam vitae lorem ac justo pulvinar luctus. Donec et pharetra sapien. Curabitur nec risus felis. Proin maximus rhoncus nisi,", function () {224 return driver225 .elementByAccessibilityId('text_p14')226 .then(el => el.elementByClassName('android.widget.EditText'))227 .setImmediateValue("nibh. Nullam vitae lorem ac justo pulvinar luctus. Donec et pharetra sapien. Curabitur nec risus felis. Proin maximus rhoncus nisi,")228 .hideKeyboard();229 })230 it("text_p15 : 30", function () {231 return driver232 .elementByAccessibilityId('text_p15')233 .then(el => el.elementByClassName('android.widget.SeekBar'))234 .then(function (el) {235 return Q.all([el.getSize(), el.getLocation()])236 .then(function (res) {237 var unit = parseInt(res[0].width / 100);238 var action = new wd.TouchAction(driver);239 action.tap({x: res[1].x + 30*unit, y: res[1].y + 18});240 return driver.performTouchAction(action);241 })242 })243 });244 it("text_p16 : 40", function () {245 return driver246 .elementByAccessibilityId('text_p16')247 .then(el => el.elementByClassName('android.widget.SeekBar'))248 .then(function (el) {249 return Q.all([el.getSize(), el.getLocation()])250 .then(function (res) {251 var unit = parseInt(res[0].width / 100);252 var action = new wd.TouchAction(driver);253 action.tap({x: res[1].x + 40*unit, y: res[1].y + 18});254 return driver.performTouchAction(action);255 })256 })257 });258 it("text_p17 : 50", function () {259 return driver260 .elementByAccessibilityId('text_p17')261 .then(el => el.elementByClassName('android.widget.SeekBar'))262 .then(function (el) {263 return Q.all([el.getSize(), el.getLocation()])264 .then(function (res) {265 var unit = parseInt(res[0].width / 100);266 var action = new wd.TouchAction(driver);267 action.tap({x: res[1].x + 50*unit, y: res[1].y + 18});268 return driver.performTouchAction(action);269 })270 })271 });272 it("text_p18 : 80", function () {273 return driver274 .elementByAccessibilityId('text_p18')275 .then(el => el.elementByClassName('android.widget.SeekBar'))276 .then(function (el) {277 return Q.all([el.getSize(), el.getLocation()])278 .then(function (res) {279 var unit = parseInt(res[0].width / 100);280 var action = new wd.TouchAction(driver);281 action.tap({x: res[1].x + 80*unit, y: res[1].y + 18});282 return driver.performTouchAction(action);283 })284 })285 });286 it("text_p19 : 100", function () {287 return driver288 .elementByAccessibilityId('text_p19')289 .then(el => el.elementByClassName('android.widget.SeekBar'))290 .then(function (el) {291 return Q.all([el.getSize(), el.getLocation()])292 .then(function (res) {293 var unit = parseInt(res[0].width / 100);294 var action = new wd.TouchAction(driver);295 action.tap({x: res[1].x + 100*unit, y: res[1].y + 18});296 return driver.performTouchAction(action);297 })298 })299 });300 it("text_p20 : eros, egestas ultricies nisl. Phasellus aliquam elit nibh, eget tempus enim blandit a. Fusce convallis vestibulum commodo. Morbi ac nibh", function () {301 return driver302 .elementByAccessibilityId('text_p20')303 .then(el => el.elementByClassName('android.widget.EditText'))304 .setImmediateValue("eros, egestas ultricies nisl. Phasellus aliquam elit nibh, eget tempus enim blandit a. Fusce convallis vestibulum commodo. Morbi ac nibh")305 .hideKeyboard();306 })307 it("text_p21 : odio nec, porttitor ultrices libero. Phasellus lobortis orci dui, eget tempor dolor lobortis sed. Pellentesque nec magna est. Duis ac", function () {308 return driver309 .elementByAccessibilityId('text_p21')310 .then(el => el.elementByClassName('android.widget.EditText'))311 .setImmediateValue("odio nec, porttitor ultrices libero. Phasellus lobortis orci dui, eget tempor dolor lobortis sed. Pellentesque nec magna est. Duis ac")312 .hideKeyboard();313 })314 it("text_p22 : vestibulum commodo. Morbi ac nibh", function () {315 return driver316 .elementByAccessibilityId('text_p22')317 .then(el => el.elementByClassName('android.widget.EditText'))318 .setImmediateValue("vestibulum commodo. Morbi ac nibh")319 .hideKeyboard();320 })321 it("text_p23 : massa. Nam placerat vestibulum sollicitudin.", function () {322 return driver323 .elementByAccessibilityId('text_p23')324 .then(el => el.elementByClassName('android.widget.EditText'))325 .setImmediateValue("massa. Nam placerat vestibulum sollicitudin.")326 .hideKeyboard();327 })328 it("text_p24 : sit amet suscipit lectus blandit. Curabitur tristique suscipit auctor. Maecenas vitae lectus pulvinar, maximus tellus a, mollis massa. Nam placerat", function () {329 return driver330 .elementByAccessibilityId('text_p24')331 .then(el => el.elementByClassName('android.widget.EditText'))332 .setImmediateValue("sit amet suscipit lectus blandit. Curabitur tristique suscipit auctor. Maecenas vitae lectus pulvinar, maximus tellus a, mollis massa. Nam placerat")333 .hideKeyboard();334 })335 it("text_p25 : suscipit lectus blandit. Curabitur tristique suscipit auctor. Maecenas vitae lectus pulvinar, maximus tellus a, mollis massa. Nam placerat vestibulum sollicitudin.", function () {336 return driver337 .elementByAccessibilityId('text_p25')338 .then(el => el.elementByClassName('android.widget.EditText'))339 .setImmediateValue("suscipit lectus blandit. Curabitur tristique suscipit auctor. Maecenas vitae lectus pulvinar, maximus tellus a, mollis massa. Nam placerat vestibulum sollicitudin.")340 .hideKeyboard();341 })342 it("text_p26 : non. Pellentesque egestas venenatis turpis. Aenean ultricies sapien quis diam maximus finibus. Donec lacus odio, scelerisque id euismod ac, vestibulum", function () {343 return driver344 .elementByAccessibilityId('text_p26')345 .then(el => el.elementByClassName('android.widget.EditText'))346 .setImmediateValue("non. Pellentesque egestas venenatis turpis. Aenean ultricies sapien quis diam maximus finibus. Donec lacus odio, scelerisque id euismod ac, vestibulum")347 .hideKeyboard();348 })349 it("text_p27 : ngocnguyen@rta.vn", function () {350 return driver351 .elementByAccessibilityId('text_p27')352 .then(el => el.elementByClassName('android.widget.EditText'))353 .then(function (el) {354 return Q.all([el.setImmediateValue("ngocnguyen@rta.vn"), el.getSize(), el.getLocation()])355 .then(function (res) {356 let size = res[1];357 let loc = res[2];358 let action = new wd.TouchAction(driver);359 action.tap({x:loc.x + size.width - 30, y: loc.y + size.height / 2});360 return driver.performTouchAction(action).hideKeyboard();361 })362 })363 })364 it("Scroll To Specific Question", function () {365 return driver.scrollTo('//*[@content-desc="text_p65"]');366 });367 it("text_p65 : ", function () {368 return driver369 .elementByAccessibilityId('text_p65')370 .then(el => el.elementByClassName('android.widget.TextView').tap())371 });372 it("exit1 : 1", function () {373 return driver374 .elementByAccessibilityId('exit1')375 .then(el => el.elementByXPath('//android.widget.RelativeLayout[1]//android.widget.RadioButton').tap())376 });377 it("Next Question", function () {378 return driver379 .elementById('vn.rta.rtsurvey:id/questionholder')380 .flick(-500, 1, 500)381 .elementByAccessibilityId('text_q2')382 .should.eventually.exist383 });384 it("text_q2 : ", function () {385 return driver386 .elementByAccessibilityId('text_q2')387 .then(el => el.elementByClassName('android.widget.TextView').tap())388 });389});
ios-barcode.js
Source:ios-barcode.js
...69 });70 it("sections_select", function () {71 return driver72 .elementByAccessibilityId('sections_select')73 .then(el => el.elementByXPath('//XCUIElementTypeOther[2]//XCUIElementTypeOther[6]//XCUIElementTypeStaticText').tap())74 });75 it("Next Question", function () {76 return driver.swipe({startX: 200, startY: 100, endX: 100, endY: 100, duration: 1000})77 });78 it("bar_f1", function () {79 return driver80 .elementByAccessibilityId('bar_f1')81 .elementByClassName('>', 'XCUIElementTypeButton').tap()82 .sleep(5000)83 });84 it("bar_f2", function () {85 return driver86 .elementByAccessibilityId('bar_f2')87 .elementByClassName('>', 'XCUIElementTypeButton').tap()...
ios-real-device.js
Source:ios-real-device.js
...84 });85 it("se_one_b2 : 4", function () {86 return driver87 .elementByAccessibilityId('se_one_b2')88 .then(el => el.elementByXPath('//XCUIElementTypeOther[2]//XCUIElementTypeOther[5]//XCUIElementTypeButton').tap())89 });90 it("se_one_b3 : 4", function () {91 return driver92 .elementByAccessibilityId('se_one_b3')93 .then(el => el.elementByXPath('//XCUIElementTypeButton[5]').tap())94 });95 it("se_one_b4 : 2", function () {96 return driver97 .elementByAccessibilityId('se_one_b4')98 .then(el => el.elementByXPath('//XCUIElementTypeButton[3]').tap())99 });...
viewport-e2e-specs.js
Source:viewport-e2e-specs.js
1import chai from 'chai';2import chaiAsPromised from 'chai-as-promised';3import B from 'bluebird';4import { PNG } from 'pngjs';5import { SCROLL_CAPS } from '../desired';6import { initSession, deleteSession } from '../helpers/session';7chai.should();8chai.use(chaiAsPromised);9let driver;10describe('testViewportCommands', function () {11 before(async function () {12 driver = await initSession(SCROLL_CAPS);13 });14 after(async function () {15 if (driver) {16 await deleteSession();17 }18 });19 it('should get device pixel ratio, status bar height, and viewport rect', async function () {20 const {viewportRect, statBarHeight, pixelRatio} = await driver.sessionCapabilities();21 pixelRatio.should.exist;22 pixelRatio.should.not.equal(0);23 statBarHeight.should.exist;24 statBarHeight.should.not.equal(0);25 viewportRect.should.exist;26 viewportRect.left.should.exist;27 viewportRect.top.should.exist;28 viewportRect.width.should.exist;29 viewportRect.height.should.exist;30 });31 it('should get scrollable element', async function () {32 let scrollableEl = await driver.elementByXPath('//*[@scrollable="true"]');33 scrollableEl.should.exist;34 });35 it('should get content size from scrollable element found as uiobject', async function () {36 let scrollableEl = await driver.elementByXPath('//*[@scrollable="true"]');37 let contentSize = await scrollableEl.getAttribute('contentSize');38 contentSize.should.exist;39 JSON.parse(contentSize).scrollableOffset.should.exist;40 });41 it('should get content size from scrollable element found as uiobject2', async function () {42 let scrollableEl = await driver.elementByXPath('//android.widget.ScrollView');43 let contentSize = await scrollableEl.getAttribute('contentSize');44 contentSize.should.exist;45 JSON.parse(contentSize).scrollableOffset.should.exist;46 });47 it('should get first element from scrollable element', async function () {48 let scrollableEl = await driver.elementByXPath('//*[@scrollable="true"]');49 let element = await scrollableEl.elementByXPath('/*[@firstVisible="true"]');50 element.should.exist;51 });52 it('should get a cropped screenshot of the viewport without statusbar', async function () {53 // TODO: fails on CI with a `Does the current view have 'secure' flag set?` error54 if (process.env.CI) {55 return this.skip();56 }57 const {viewportRect, statBarHeight} = await driver.sessionCapabilities();58 const fullScreen = await driver.takeScreenshot();59 const viewScreen = await driver.execute('mobile: viewportScreenshot');60 const fullB64 = Buffer.from(fullScreen, 'base64');61 const viewB64 = Buffer.from(viewScreen, 'base64');62 const fullImg = new PNG({filterType: 4});63 await B.promisify(fullImg.parse).call(fullImg, fullB64);64 const viewImg = new PNG({filterType: 4});65 await B.promisify(viewImg.parse).call(viewImg, viewB64);66 viewportRect.top.should.eql(statBarHeight);67 viewImg.height.should.eql(viewportRect.height);68 viewImg.width.should.eql(fullImg.width);69 fullImg.height.should.be.above(viewImg.height);70 });...
Using AI Code Generation
1var webdriver = require('webdriverio');2var opts = {3 desiredCapabilities: {4 }5};6var driver = webdriver.remote(opts);7 .init()8 .setValue('Hello World!')9 .click()10 .end();11var webdriver = require('webdriverio');12var opts = {13 desiredCapabilities: {14 }15};16var driver = webdriver.remote(opts);17 .init()18 .elementByAccessibilityId('Search')19 .click()20 .end();21var webdriver = require('webdriverio');22var opts = {23 desiredCapabilities: {24 }25};26var driver = webdriver.remote(opts);27 .init()28 .elementByAndroidUIAutomator('new UiSelector().text("Search")')29 .click()30 .end();31var webdriver = require('webdriverio');32var opts = {33 desiredCapabilities: {34 }
Using AI Code Generation
1const wd = require('wd');2const capabilities = {3};4const driver = wd.promiseChainRemote('localhost', 4723);5 .init(capabilities)6 .then(() => {7 return driver.elementById('Go to WebView').click();8 })9 .then(() => {10 })11 .then(() => {12 })13 .then((element) => {14 return element.click();15 })16 .then(() => {17 })18 .then(() => {19 })20 .then(() => {21 return driver.quit();22 })23 .catch((error) => {24 console.error('Something went wrong!\n', error.stack, '\n');25 driver.quit();26 });
Using AI Code Generation
1var wd = require('wd');2var assert = require('assert');3var desiredCaps = {4};5var driver = wd.promiseChainRemote('localhost', 4723);6driver.init(desiredCaps)7 .then(function() {8 })9 .then(function(el) {10 return el.getAttribute('name');11 })12 .then(function(name) {13 console.log(name);14 })15 .fin(function() { return driver.quit(); })16 .done();17[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1517553223194 (16:53:43 GMT+0100 (CET))
Using AI Code Generation
1var wd = require('wd');2var assert = require('assert');3var username = process.env.SAUCE_USERNAME;4var accessKey = process.env.SAUCE_ACCESS_KEY;5var desiredCaps = {6};7var driver = wd.promiseChainRemote('ondemand.saucelabs.com', 443, username, accessKey);8 .init(desiredCaps)9 .then(function () {10 })11 .then(function (el) {12 return el.click();13 })14 .then(function () {15 })16 .then(function (el) {17 return el.click();18 })19 .then(function () {20 return driver.quit();21 })22 .catch(function (err) {23 console.log(err);24 });25var wd = require('wd');26var assert = require('assert');27var username = process.env.SAUCE_USERNAME;28var accessKey = process.env.SAUCE_ACCESS_KEY;29var desiredCaps = {30};31var driver = wd.promiseChainRemote('ondemand.saucelabs.com', 443, username, accessKey);32 .init(desiredCaps)33 .then(function () {34 })
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!