Best JavaScript code snippet using taiko
js.js
Source:js.js  
...105		residentialStatus('frei','property_space','Wohnstatus');106		residentialStatus('vermietet','property_space','Wohnstatus');107		residentialStatus('teilweise_vermietet','property_space','Wohnstatus'); 108109			function goBack(select,show,hide){110				document.getElementById(select).addEventListener('click',function(){111					document.getElementById(show).style.display = "flex";112					document.getElementById(hide).style.display = "none";113114				});115			}116			goBack('one_back','stepOne','Wohnstatus');117			goBack('two_back','Wohnstatus','property_space');118			goBack('three_back','property_space','property_built');119			goBack('four_back','property_built','condition');120			goBack('five_back','condition','balcony');121			goBack('six_back','balcony','desired_price');122			goBack('seven_back','desired_price','property_located');123			goBack('eight_back','property_located','last_step');124125126			function  goForward(select,show,hide){127				document.getElementById(select).addEventListener('click',function(){128					document.getElementById(show).style.display = "flex";129					document.getElementById(hide).style.display = "none";130131					 132				}); 133134			}135			goBack('one_next','property_built','property_space');136			goBack('two_next','condition','property_built');137			goBack('three_next','property_located','desired_price');138			goBack('four_next','last_step','property_located');139			//goBack('five_next','last_step','property_located');140141142	});143144145146147/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */148149 document.getElementById("five_next").addEventListener('click',function(){150	 var Firstname = document.getElementById("Firstname").value;151	 var Surname = document.getElementById("Surname").value;152	 var E_mail_address = document.getElementById("E_mail_address").value;153	 var Telephone_number = document.getElementById("Telephone_number").value;154155	 Email = E_mail_address;156	 MailingInfo = "First Name: "+Firstname+ "<br> Surname: "+Surname + "<br> Phone Number: "+ Telephone_number + "<br> Email: "+Email;157158	 console.log(MailingInfo); 159160	 document.getElementById("five_next").style.display = "none";161	 document.getElementById("stepOne").style.display = "none";162 	document.getElementById("completed").innerHTML = "<h1>All DOne</h1>";163164});165166167 168 169170/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */171172 173174}175clickImg('wohnung_select','Wohnstatus','stepOne');176 177 178 179180 181function haus_select(select,show,hide){182	document.getElementById(select).addEventListener('click',function(){ 183		document.getElementById(show).style.display = "flex";184		document.getElementById(hide).style.display = "none"; 185		PropertyName = this.alt;186		console.log(PropertyName); 187188		 189		function HomeDetails(select,show,hide){190		document.getElementById(select).addEventListener('click',function(){191192			document.getElementById(show).style.display = "flex";193			document.getElementById(hide).style.display = "none";  194			HomeDetails = this.alt;195			console.log(HomeDetails); 196197			function residentialStatus(select,show,hide){ 198				document.getElementById(select).addEventListener('click',function(){199200				document.getElementById(show).style.display = "flex";201				document.getElementById(hide).style.display = "none";  202				ResidentialStatus = this.alt;203				console.log(ResidentialStatus);204205206 207208				function condition_property(select,show,hide){209210					document.getElementById(select).addEventListener('click',function(){211						document.getElementById(show).style.display = "flex";212						document.getElementById(hide).style.display = "none";  213						ConditionProperty = this.alt;214						console.log(ConditionProperty); 215216217218219						function balcony(select,show,hide){220							document.getElementById(select).addEventListener('click',function(){221								document.getElementById(show).style.display = "flex";222								document.getElementById(hide).style.display = "none";  223								224								BalconyTerrace = this.alt;225								console.log(BalconyTerrace);226227								document.getElementById('desired_price_range').addEventListener('change',function(){228									DesiredPrice = this.value;229									console.log(DesiredPrice); 230231								});232233234								 document.getElementById("four_next").addEventListener('click',function(){235									 var StreetNo = document.getElementById("StreetNo").value;236									 var Postcode = document.getElementById("Postcode").value;237									 var Place = document.getElementById("Place").value;238									 RegionPropertyLocated = "Street No.: "+ StreetNo + "<br> Post Code: " + Postcode + "<br> Place Name: " + Place;239									 console.log(RegionPropertyLocated);  240								}); 241242							}); 243244245						}246						balcony('balkon','desired_price','balcony');247						balcony('terrasse','desired_price','balcony');248						balcony('balkon_and_terrasse','desired_price','balcony');249						balcony('weder_noch','desired_price','balcony');250251252					});253254				}255				condition_property('renovierungs_bedurftig','balcony','condition');256				condition_property('neuwertig','balcony','condition');257				condition_property('gepflegt','balcony','condition');258259  260261			});262263			}264			residentialStatus('selbst_bewohunt','property_space','Wohnstatus');265			residentialStatus('frei','property_space','Wohnstatus');266			residentialStatus('vermietet','property_space','Wohnstatus');267			residentialStatus('teilweise_vermietet','property_space','Wohnstatus'); 268			  269 	   270			271		});272273 274275		var property_space = document.getElementById("range");276			var sliderOutput = document.getElementById("amount"); 277			property_space.oninput = function(){278			  sliderOutput.innerHTML = this.value;279			  LivingSpace = this.value;280			  console.log(LivingSpace);281			}282			var slider = document.getElementById("property_built_range");283			var output = document.getElementById("property_built_amount"); 284			slider.oninput = function(){285			  output.innerHTML = this.value;286			  PropertyBuilt = this.value;287			  console.log(PropertyBuilt);288			}289290			var size_slider = document.getElementById("property_size_range");291			var size_output = document.getElementById("property_size_amount"); 292			size_slider.oninput = function(){293			  size_output.innerHTML = this.value;294			  PropertyArea = this.value;295			  console.log(PropertyArea);296			} 297		298		}299		HomeDetails('einfamilienhaus','Wohnstatus','HomeDetails');300		HomeDetails('mehrfamilienhaus','Wohnstatus','HomeDetails');301		HomeDetails('reihenhaus','Wohnstatus','HomeDetails');302		HomeDetails('doppelhaushalfte','Wohnstatus','HomeDetails'); 303304305306307308309310311			function goBack(select,show,hide){312				document.getElementById(select).addEventListener('click',function(){313					document.getElementById(show).style.display = "flex";314					document.getElementById(hide).style.display = "none";315316				}); 317			}318			goBack('one_back','HomeDetails','Wohnstatus');319			goBack('two_back','Wohnstatus','property_space');320			goBack('three_back','property_size','property_built');321			goBack('four_back','property_built','condition');322			goBack('five_back','condition','balcony');323			goBack('six_back','balcony','desired_price');324			goBack('seven_back','desired_price','property_located');325			goBack('eight_back','property_located','last_step');326			goBack('haus_one_back','stepOne','HomeDetails');327			goBack('size_three_back','property_space','property_size');328329330			function  goForward(select,show,hide){331				document.getElementById(select).addEventListener('click',function(){332					document.getElementById(show).style.display = "flex";333					document.getElementById(hide).style.display = "none";334335					 336				}); 337 338			}339			 goBack('one_next','property_size','property_space');340			goBack('two_next','condition','property_built');341			goBack('three_next','property_located','desired_price');342			goBack('four_next','last_step','property_located');343			goBack('size_two_next','property_built','property_size');344			//goBack('five_next','last_step','property_located');345346347348349350/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */351352 document.getElementById("five_next").addEventListener('click',function(){353	 var Firstname = document.getElementById("Firstname").value;354	 var Surname = document.getElementById("Surname").value;355	 var E_mail_address = document.getElementById("E_mail_address").value;356	 var Telephone_number = document.getElementById("Telephone_number").value;357358	 Email = E_mail_address;359	 MailingInfo = "First Name: "+Firstname+ "<br> Surname: "+Surname + "<br> Phone Number: "+ Telephone_number + "<br> Email: "+Email;360361	 console.log(MailingInfo); 362363	 document.getElementById("five_next").style.display = "none";364	 document.getElementById("stepOne").style.display = "none";365 	document.getElementById("completed").innerHTML = "<h1>All DOne</h1>";366367});368369370 371/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */372373374	});375376377  378379}380haus_select('haus_select','HomeDetails','stepOne');381 382 383384385386387388389390391 function grundstuck_select(select,show,hide){392	document.getElementById(select).addEventListener('click',function(){ 393		document.getElementById(show).style.display = "flex";394		document.getElementById(hide).style.display = "none"; 395		PropertyName = this.alt;396		console.log(PropertyName); 397398		function propertyInfo(select,show,hide){399			document.getElementById(select).addEventListener('click',function(){400				document.getElementById(show).style.display = "flex";401				document.getElementById(hide).style.display = "none"; 402				PropertyName = this.alt;403				console.log(PropertyName); 404 				405406 				function propertybuilton(select,show,hide){407 					document.getElementById(select).addEventListener('click',function(){408 						document.getElementById(show).style.display = "flex";409						document.getElementById(hide).style.display = "none"; 410						PropertyName = this.alt;411						console.log(PropertyName); 412413414						document.getElementById('desired_price_range').addEventListener('change',function(){415							DesiredPrice = this.value;416							console.log(DesiredPrice); 417418						});419420421						 document.getElementById("four_next").addEventListener('click',function(){422									 var StreetNo = document.getElementById("StreetNo").value;423									 var Postcode = document.getElementById("Postcode").value;424									 var Place = document.getElementById("Place").value;425									 RegionPropertyLocated = "Street No.: "+ StreetNo + "<br> Post Code: " + Postcode + "<br> Place Name: " + Place;426									 console.log(RegionPropertyLocated);  427								}); 428429430 					});431 				}432 				propertybuilton('kurzfristingbebaubar','desired_price','propertybuilton');433 				propertybuilton('eingeschrankt','desired_price','propertybuilton');434 				propertybuilton('nicht_bebaubar','desired_price','propertybuilton');435 				propertybuilton('unbekannt','desired_price','propertybuilton');436437438			});439		}440		propertyInfo('baugrundstuck','propertybuilton','propertyInformation');441		propertyInfo('gewerbegrundstuck','propertybuilton','propertyInformation');442		propertyInfo('agrarflache','propertybuilton','propertyInformation');443444445446447		function goBack(select,show,hide){448				document.getElementById(select).addEventListener('click',function(){449					document.getElementById(show).style.display = "flex";450					document.getElementById(hide).style.display = "none"; 451				}); 452			}453			goBack('one_back','HomeDetails','Wohnstatus');454			goBack('two_back','Wohnstatus','property_space');455			goBack('three_back','property_size','property_built');456			goBack('four_back','property_built','condition');457			goBack('five_back','condition','balcony'); 458			goBack('six_back','propertybuilton','desired_price');459			goBack('seven_back','desired_price','property_located');460			goBack('eight_back','property_located','last_step');461			goBack('propertyInfo_four_back','stepOne','propertyInformation'); 462			goBack('propertybuilton_four_back','propertyInformation','propertybuilton');463 464465			function  goForward(select,show,hide){466				document.getElementById(select).addEventListener('click',function(){467					document.getElementById(show).style.display = "flex";468					document.getElementById(hide).style.display = "none"; 469					 470				});  471			} 472			 goBack('one_next','property_size','property_space');473			goBack('two_next','condition','property_built');474475			goBack('three_next','property_located','desired_price');476			goBack('four_next','last_step','property_located');477			goBack('size_two_next','property_built','property_size');478479480481	});482}483grundstuck_select('grundstuck','propertyInformation','stepOne');484485486487function gewerbe_select(select,show,hide){488	document.getElementById(select).addEventListener('click',function(){ 489		document.getElementById(show).style.display = "flex";490		document.getElementById(hide).style.display = "none"; 491		PropertyName = this.alt;492		console.log(PropertyName); 493494495		function commercialpropertyinfo(select,show,hide){496			document.getElementById(select).addEventListener('click',function(){ 497				document.getElementById(show).style.display = "flex";498				document.getElementById(hide).style.display = "none"; 499				PropertyName = this.alt;500				console.log(PropertyName);501502503				function usagestatusInfo(select,show,hide){504					document.getElementById(select).addEventListener('click',function(){ 505						document.getElementById(show).style.display = "flex";506						document.getElementById(hide).style.display = "none"; 507						PropertyName = this.alt;508						console.log(PropertyName);509					});510				}511				usagestatusInfo('frei_status','property_space','usagestatus');512				usagestatusInfo('vermietet_status','property_space','usagestatus');513				usagestatusInfo('teilweise_vermietet_status','property_space','usagestatus');514515516517			});518 519		}520		commercialpropertyinfo('buro','usagestatus','commercialproperty');521		commercialpropertyinfo('gastgewerbe','usagestatus','commercialproperty');522		commercialpropertyinfo('halle_Produktion','usagestatus','commercialproperty');523		commercialpropertyinfo('hotel_pension','usagestatus','commercialproperty');524525526			function goBack(select,show,hide){527				document.getElementById(select).addEventListener('click',function(){528					document.getElementById(show).style.display = "flex";529					document.getElementById(hide).style.display = "none"; 530				}); 531			}  532			goBack('two_back','usagestatus','property_space');533			goBack('three_back','property_space','property_built');534			goBack('four_back','property_built','condition');535			goBack('five_back','condition','balcony'); 536			goBack('six_back','property_built','desired_price');537			goBack('seven_back','desired_price','property_located');538			goBack('eight_back','property_located','last_step');539			goBack('commercialproperty_four_back','stepOne','commercialproperty');540			goBack('usagestatus_four_back','commercialproperty','usagestatus');  541 542543			function  goForward(select,show,hide){544				document.getElementById(select).addEventListener('click',function(){545					document.getElementById(show).style.display = "flex";546					document.getElementById(hide).style.display = "none"; 547					 548				});  549			}  550			goBack('one_next','property_built','property_space');551			goBack('two_next','desired_price','property_built'); 552			goBack('three_next','property_located','desired_price');553			goBack('four_next','last_step','property_located');554			goBack('size_two_next','property_built','property_size');555556557558559560				var property_space = document.getElementById("range");561			var sliderOutput = document.getElementById("amount"); 562			property_space.oninput = function(){563			  sliderOutput.innerHTML = this.value;564			  LivingSpace = this.value;565			  console.log(LivingSpace);566			}567			var slider = document.getElementById("property_built_range");568			var output = document.getElementById("property_built_amount"); 
...personal.js
Source:personal.js  
1'use strict';2import React from 'react';3import ReactDOM from 'react-dom';4// import * as Common from './Common.js';5import {6	thisurl,7	serviceurl,8	ipurl,9	downDistance,10	setCookie,11	getCookie,12	delCookie,13	getURLPram,14	clearCookies,15	getCityIDByName,16	reminder,17	reminderSuccess,18	getLocalTime,19	checknull,20	MoneyConversion,21	MoneyValue,22	toDecimal,23	getMobilTime,24	plusZero,25	downloadurl26} from '../../js/common.js';27var per_name = "";28var Personal_mainBox = React.createClass({29  getInitialState: function() {30  	$.ajax({	  31		url : serviceurl+"site/getUserInfo",   	 //请æ±çUrl32		type : "get",                                           //æäº¤æ¹å¼33		dataType : "json",                                       //请æ±çè¿åç±»å è¿é为json	34		data : { },35		contentType : "application/json",        			     //å
容类å36		cache : false,  37		beforeSend:function(XMLHttpRequest){38			$("#login-loading-toast").css("display","block");39		},                                         //æ¯å¦å¼æ¥æäº¤40		success : function(data){41			$("#login-loading-toast").css("display","none");42			console.log(JSON.stringify(data))43			if( data.status == "success"){44					delCookie("mobile");45					setCookie("mobile", data.data.mobile);46					$("#personal-name").text(checknull(data.data.fullname));47					$("#avatar").attr("src",serviceurl+data.data.avatar.substr(1));48				}else if( data.status == "redirect"){49					location.href = "../login.html?backurl=personal/personal.html";50				}else{51					reminder("请ç¨ååè¯");52					return ;53				}54			},55		error: function (XMLHttpRequest, textStatus, errorThrown) {56			$("#login-loading-toast").css("display","none");57			reminder(XMLHttpRequest.responseJSON.message);58			return ;	59		}60	});61    return {data: []};62  },63  userClick: function(){64  	//个人信æ¯ä¿®æ¹65  	per_name = $("#personal-name").text();66  	if( per_name == "æªç»å½" ){67  		delCookie("gobackURL");68		setCookie("gobackURL", ipurl + "/personal.html", 30);69		location.href="../login.html";70  	}else{71  		delCookie("gobackURL");72		setCookie("gobackURL", ipurl + "/personal.html", 30);73		location.href="per_info.html";74  	}75  },76  doctorClick: function(){77  	//æçå»ç78  	var per_name = $("#personal-name").text();79  	if( per_name == "æªç»å½" ){80  		delCookie("gobackURL");81		setCookie("gobackURL", ipurl + "/personal.html", 30);82		location.href="../login.html";83  	}else{84  		delCookie("gobackURL");85		setCookie("gobackURL", ipurl + "/personal.html", 30);86		location.href="per_mydoc.html";87  	}88  },89  yuyueClick: function(){90  	//æçé¢çº¦91  	var per_name = $("#personal-name").text();92  	if( per_name == "æªç»å½" ){93  		delCookie("gobackURL");94		setCookie("gobackURL", ipurl + "/personal.html", 30);95		location.href="../login.html";96  	}else{97  		delCookie("gobackURL");98		setCookie("gobackURL", ipurl + "/personal.html", 30);99		location.href="per_booking.html";100  	}101  },102  orderClick: function(){103  	//æç订å104	var per_name = $("#personal-name").text();105  	if( per_name == "æªç»å½" ){106  		delCookie("gobackURL");107		setCookie("gobackURL", ipurl + "/personal.html", 30);108		location.href="../login.html";109  	}else{110  		delCookie("gobackURL");111		setCookie("gobackURL", ipurl + "/personal.html", 30);112		location.href="per_mypay.html";113  	}114  },115  familyClick: function(){116  	//å®¶åºè系人117	var per_name = $("#personal-name").text();118  	if( per_name == "æªç»å½"){119  		delCookie("gobackURL");120		setCookie("gobackURL", ipurl + "/personal.html", 30);121		location.href="../login.html";122  	}else{123  		delCookie("gobackURL");124		setCookie("gobackURL", ipurl + "/personal.html", 30);125		location.href="per_family.html";126  	}127  },128  caseClick: function(){129  	//å®¶åºç
ä¾ç®¡ç130	var per_name = $("#personal-name").text();131  	if( per_name == "æªç»å½" ){132  		delCookie("gobackURL");133		setCookie("gobackURL", ipurl + "/personal.html", 30);134		location.href="../login.html";135  	}else{136  		delCookie("gobackURL");137		setCookie("gobackURL", ipurl + "/personal.html", 30);138		location.href="per_case.html";139  	}140  },141  collectClick: function(){142  	//æçæ¶è143	var per_name = $("#personal-name").text();144  	if( per_name == "æªç»å½" ){145  		delCookie("gobackURL");146		setCookie("gobackURL", ipurl + "/personal.html", 30);147		location.href="../login.html";148  	}else{149  		delCookie("gobackURL");150		setCookie("gobackURL", ipurl + "/personal.html", 30);151		location.href="per_collect.html";152  	}153  },154  setClick: function(){155  	//设置156	var per_name = $("#personal-name").text();157  	if( per_name == "æªç»å½" ){158  		delCookie("gobackURL");159		setCookie("gobackURL", ipurl + "/personal.html", 30);160		location.href="../login.html";161  	}else{162  		delCookie("gobackURL");163		setCookie("gobackURL", ipurl + "/personal.html", 30);164		location.href="per_setup.html";165  	}166  },167  render: function() {168    return (169		<div>170			<div className="weui_cells weui_cells_access per_my_box pointer">171				<div className="weui_cell my_cell">172					<div className="weui_cell_hd per_avatar_box per-width8">173						<img src=""  className="img-circle " width="75px" height="75px" id="avatar" ref="avatar"/>174					</div>175					<div className="weui_cell_bd weui_cell_primary per_avatar_tit" onClick={this.userClick}>176						<div >177							<span className="weui_media_title " id="personal-name" ref="personal-name"></span> 178						</div>179						<div className="weui_media_desc res-doc-con-text per-margintop5">æç积åï¼0</div> 180					</div>181					<div className="weui_cell_ft"></div>182				</div>183			</div>184			<div className="weui_cells weui_cells_access tmargin1 personal_paddingBox">	185				<div className="weui_cell pointer" onClick={this.doctorClick}>186					<div className="weui_cell_hd">187						<img src="images/Group 4 Copy@2x.png"  className="margin-right15 displayblock per-imggroup"/>188					</div>189					<div className="weui_cell_bd weui_cell_primary"><span className="weui_media_title ">æçå»ç</span></div>190					<div className="weui_cell_ft"></div>191				</div>192				193				<div className="weui_cell pointer" onClick={this.yuyueClick}>194					<div className="weui_cell_hd">195						<img src="images/Group 9 Copy 2@2x.png"  className="margin-right15 displayblock per-imggroup"/>196					</div>197					<div className="weui_cell_bd weui_cell_primary"><span className="weui_media_title ">æçé¢çº¦</span></div>198					<div className="weui_cell_ft"></div>199				</div>200				201				<div className="weui_cell pointer" onClick={this.orderClick}>202					<div className="weui_cell_hd">203						<img src="images/Group 10 Copy@2x.png"  className="margin-right15 displayblock per-imggroup"/>204					</div>205					<div className="weui_cell_bd weui_cell_primary"><span className="weui_media_title ">æç订å</span></div>206					<div className="weui_cell_ft"></div>207				</div>208				209				<div className="weui_cell pointer" onClick={this.familyClick}>210					<div className="weui_cell_hd">211						<img src="images/Group 11 Copy@2x.png" className="margin-right15 displayblock per-imggroup"/>212					</div>213					<div className="weui_cell_bd weui_cell_primary"><span className="weui_media_title ">å®¶åºè系人</span></div>214					<div className="weui_cell_ft"></div>215				</div>216				217				<div className="weui_cell pointer displaynone" onClick={this.caseClick}>218					<div className="weui_cell_hd">219						<img src="images/Group 12 Copy@2x.png" className="margin-right15 displayblock per-imggroup"/>220					</div>221					<div className="weui_cell_bd weui_cell_primary"><span className="weui_media_title ">å®¶åºç
ä¾ç®¡ç</span></div>222					<div className="weui_cell_ft"></div>223				</div>224				225				<div className="weui_cell pointer displaynone" onClick={this.collectClick}>226					<div className="weui_cell_hd">227						<img src="images/Group 13 Copy@2x.png" className="margin-right15 displayblock per-imggroup"/>228					</div>229					<div className="weui_cell_bd weui_cell_primary"><span className="weui_media_title ">æçæ¶è</span></div>230					<div className="weui_cell_ft"></div>231				</div>232				233			</div>234			235			<div className="weui_cells weui_cells_access pointer tmargin1 personal_paddingBox" onClick={this.setClick}>236				<div className="weui_cell">237					<div className="weui_cell_hd">238						<img src="images/Group 14 Copy@2x.png" className="margin-right15 displayblock per-imggroup"/>239					</div>240					<div className="weui_cell_bd weui_cell_primary"><span className="weui_media_title ">设置</span></div>241					<div className="weui_cell_ft"></div>242				</div>243			</div>244			<div id="loading-toast" ref="loading-toast" className="weui_loading_toast displaynone">245			    <div className="weui_mask_transparent"></div>246			    <div className="weui_toast">247			        <div className="weui_loading">248			            <div className="weui_loading_leaf weui_loading_leaf_0"></div>249			            <div className="weui_loading_leaf weui_loading_leaf_1"></div>250			            <div className="weui_loading_leaf weui_loading_leaf_2"></div>251			            <div className="weui_loading_leaf weui_loading_leaf_3"></div>252			            <div className="weui_loading_leaf weui_loading_leaf_4"></div>253			            <div className="weui_loading_leaf weui_loading_leaf_5"></div>254			            <div className="weui_loading_leaf weui_loading_leaf_6"></div>255			            <div className="weui_loading_leaf weui_loading_leaf_7"></div>256			            <div className="weui_loading_leaf weui_loading_leaf_8"></div>257			            <div className="weui_loading_leaf weui_loading_leaf_9"></div>258			            <div className="weui_loading_leaf weui_loading_leaf_10"></div>259			            <div className="weui_loading_leaf weui_loading_leaf_11"></div>260			        </div>261			        <p className="weui_toast_content text-align" id="loading-toast-text">æ£å¨å è½½</p>262			    </div>263			</div>264			<div id="success-toast" className="displaynone">265			    <div className="weui_mask_transparent" id="success-toast-mask"></div>266			    <div className="weui_toast">267			        <i className="weui_icon_toast"></i>268			        <p className="weui_toast_content text-align" id="success-toast-text"></p>269			    </div>270			</div>271			<div id="fail-toast" className="displaynone">272			    <div className="weui_mask_transparent" id="fail-toast-mask"></div>273			    <div className="weui_toast_fail">274			        <p className="text-align" id="fail-toast-text"></p>275			    </div>276			</div>277		</div>278    );279  }280});281var Personal_tarBox = React.createClass({282  orderClick: function(){283  	//æç订å284	var per_name = $("#personal-name").text();285  	if( per_name == "æªç»å½" ){286  		delCookie("gobackURL");287		setCookie("gobackURL", ipurl + "/personal.html", 30);288		location.href="../login.html";289  	}else{290  		delCookie("gobackURL");291		setCookie("gobackURL", ipurl + "/personal.html", 30);292		location.href="per_mypay.html";293  	}294  },295  yuyueClick: function(){296  	//æçé¢çº¦297  	var per_name = $("#personal-name").text();298  	if( per_name == "" || per_name == "æªç»å½"){299  		delCookie("gobackURL");300		setCookie("gobackURL", ipurl + "/personal.html", 30);301		location.href="../login.html";302  	}else{303  		delCookie("gobackURL");304		setCookie("gobackURL", ipurl + "/personal.html", 30);305		location.href="per_booking.html";306  	}307  },308  setClick: function(){309  	//设置310  	var per_name = $("#personal-name").text();311  	if( per_name == "" || per_name == "æªç»å½"){312  		delCookie("gobackURL");313		setCookie("gobackURL", ipurl + "/personal.html", 30);314		location.href="../login.html";315  	}else{316  		delCookie("gobackURL");317		setCookie("gobackURL", ipurl + "/personal.html", 30);318		location.href="per_setup.html";319  	}320  },321  mainClick: function(){322  	//主页323  		delCookie("gobackURL");324		setCookie("gobackURL", ipurl + "/personal.html", 30);325		location.href="per_index.html";326  },327  messageClick: function(){328  	//æ¶æ¯ç¹å»329  	per_name = $("#personal-name").text();330  	if( per_name == "" || per_name == "æªç»å½"){331  		delCookie("gobackURL");332		setCookie("gobackURL", ipurl + "/personal.html", 30);333		location.href="../login.html";334  	}else{335		if(confirm("该åè½éè¦ä¸è½½appï¼æ¯å¦ä¸è½½ï¼")){336			//æ¶æ¯ç¹å»337			delCookie("gobackURL");338			setCookie("gobackURL", ipurl + "/personal.html", 30);339			location.href=downloadurl;340		}else{341			return;342		}343  	}344  },345  meClick: function(){346  	//æç¹å»äºä»¶347  	per_name = $("#personal-name").text();348	if( per_name == "" || per_name == "æªç»å½"){349  		delCookie("gobackURL");350		setCookie("gobackURL", ipurl + "/personal.html", 30);351		location.href="../login.html";352  	}else{353  		delCookie("gobackURL");354		setCookie("gobackURL", ipurl + "/personal.html", 30);355		location.href="personal.html";356  	}357  },358  render: function() {359    return (360		<div className="weui_tabbar">361			<div className="weui_tabbar_item per-foot-nav pointer" onClick={this.mainClick}>362				<div className="weui_tabbar_icon">363					<img src="images/ic_home_main.png" className="height-auto"/>364				</div>365				<p className="weui_tabbar_label">çèº</p>366			</div>367			<div  className="weui_tabbar_item per-foot-nav pointer" onClick={this.orderClick}>368				<div className="weui_tabbar_icon">369					<img src="images/ic_home_pay.png" className="height-auto"/>370				</div>371				<p className="weui_tabbar_label">æ¯ä»</p>372			</div>373			<div  className="weui_tabbar_item per-foot-nav pointer" onClick={this.messageClick}>374				<div className="weui_tabbar_icon">375					<img src="images/ic_home_notice.png" className="height-auto"/>376				</div>377				<p className="weui_tabbar_label">æ¶æ¯</p>378			</div>379			<div  className="weui_tabbar_item per-foot-nav pointer" onClick={this.meClick}>380				<div className="weui_tabbar_icon">381					<img src="images/ic_home_me_checked.png" className="height-auto"/>382				</div>383				<p className="weui_tabbar_label">æ</p>384			</div>385		</div>386    );387  }388});389ReactDOM.render(390  <Personal_mainBox />,391  document.getElementById('content')392);393ReactDOM.render(394  <Personal_tarBox />,395  document.getElementById('downTar')...Settings.js
Source:Settings.js  
...116    };117  },118  handleSubmitEditing: function() {119    this.props.addUser(this.state.newUserName);120    this.props.goBack();121  },122  render: function () {123    const {124      goBack,125    } = this.props;126    return (127      <SettingsWrapper goBack={goBack} backButtonText="Cancel">128        <AppText style={styles.headingText}>Hi! What's your name?</AppText>129        <TextInput130          autoCapitalize='words'131          autoFocus={true}132          returnKeyType='done'133          style={styles.input}134          value={this.state.newUserName}135          onChangeText={(text) => {136            this.setState({137              newUserName: text,138            });139          }}140          onSubmitEditing={this.handleSubmitEditing}141        />142        <Button143          style={styles.submitButton}144          text="Save!"145          onPress={this.handleSubmitEditing}146        />147      </SettingsWrapper>148    );149  },150});151const ChangeUserName = React.createClass({152  propTypes: {153    changeUserName: React.PropTypes.func.isRequired,154    goBack: React.PropTypes.func.isRequired,155    user: React.PropTypes.object.isRequired,156  },157  getInitialState: function() {158    return {159      userName: this.props.user.name,160    };161  },162  componentWillReceiveProps: function(newProps) {163    this.setState({164      userName: newProps.user.name,165    });166  },167  handleSubmitEditing: function() {168    this.props.changeUserName(this.state.userName);169    this.props.goBack();170  },171  render: function () {172    const {173      goBack,174    } = this.props;175    return (176      <SettingsWrapper goBack={goBack} backButtonText="Cancel">177        <AppText style={styles.headingText}>178          What's your new name?179        </AppText>180        <TextInput181          autoCapitalize='words'182          autoFocus={true}183          returnKeyType='done'...App.js
Source:App.js  
...56          headerTitleAlign: 'center',57          headerLeft: () => (58            // <TouchableOpacity59            //   onPress={() => {60            //     navigation.goBack()61            //   }}62            // >63            //   <Text>Go Back</Text>64            // </TouchableOpacity>65            <Button66              title="Go back"67              onPress={() => {68                navigation.goBack()69              }}70            />71          )72        })}73      />74      <Pharm.Screen name="Meds" component={PharmPage}75        options={{headerShown: false}}76      />77      <Pharm.Screen name="Stores" component={Stores}78        options={({ navigation, route }) => ({79          headerStyle: styles.header,80          headerTitle: "Stores",81          headerTitleAlign: 'center',82          headerLeft: () => (83            // <TouchableOpacity84            //   onPress={() => {85            //     navigation.goBack()86            //   }}87            // >88            //   <Text>Go Back</Text>89            // </TouchableOpacity>90            <Button91              title="Go back"92              onPress={() => {93                navigation.goBack()94              }}95            />96          )97        })}98      />99      <Pharm.Screen name="Log" component={Log}100        options={{headerShown: false}}101      />102      <Pharm.Screen name="Change" component={ChangeStores}103        options={({ navigation, route }) => ({104          headerStyle: styles.header,105          headerTitle: "Change Stores",106          headerTitleAlign: 'center',107          headerLeft: () => (108            // <TouchableOpacity109            //   onPress={() => {110            //     navigation.goBack()111            //   }}112            // >113            //   <Text>Go Back</Text>114            // </TouchableOpacity>115            <Button116              title="Go back"117              onPress={() => {118                navigation.goBack()119              }}120            />121          )122        })}123      />124    </Pharm.Navigator>125  )126}127function MyNurse() {128  return (129    <Nurse.Navigator>130      <Nurse.Screen name="Registration" component={Registration}131        options={({ navigation, route }) => ({132          headerStyle: styles.header,133          headerTitleAlign: 'center',134          headerLeft: () => (135            // <TouchableOpacity136            //   onPress={() => {137            //     navigation.goBack()138            //   }}139            // >140            //   <Text>Go Back</Text>141            // </TouchableOpacity>142            <Button143              title="Go back"144              onPress={() => {145                navigation.goBack()146              }}147            />148          )149        })}150      />151    </Nurse.Navigator>152  )153}154function MyDoctor() {155  return (156    <Doctor.Navigator>157      <Doctor.Screen name="PatientSearch" component={PatientSearch}158        options={({ navigation, route }) => ({159          headerStyle: styles.header,160          headerTitle: "Search",161          headerTitleAlign: 'center',162          headerLeft: () => (163            // <TouchableOpacity164            //   onPress={() => {165            //     navigation.goBack()166            //   }}167            // >168            //   <Text>Go Back</Text>169            // </TouchableOpacity>170            <Button171              title="Go back"172              onPress={() => {173                navigation.goBack()174              }}175            />176          )177        })}178      />179      <Doctor.Screen name="Meds" component={DoctorPage}180        options={({ navigation, route }) => ({181          headerStyle: styles.header,182          headerTitle: "New Complaint",183          headerTitleAlign: 'center',184          headerLeft: () => (185            // <TouchableOpacity186            //   onPress={() => {187            //     navigation.goBack()188            //   }}189            // >190            //   <Text>Go Back</Text>191            // </TouchableOpacity>192            <Button193              title="Go back"194              onPress={() => {195                navigation.goBack()196              }}197            />198          )199        })}200      />201      <Doctor.Screen name="History" component={History}202        options={({ navigation, route }) => ({203          headerStyle: styles.header,204          headerTitle: "History",205          headerTitleAlign: 'center',206          headerLeft: () => (207            // <TouchableOpacity208            //   onPress={() => {209            //     navigation.goBack()210            //   }}211            // >212            //   <Text>Go Back</Text>213            // </TouchableOpacity>214            <Button215              title="Go back"216              onPress={() => {217                navigation.goBack()218              }}219            />220          )221        })}222      />223      <Doctor.Screen name="Log" component={Log}224        options={{headerShown: false}}225      />226      <Doctor.Screen name="Stores" component={Stores}227        options={({ navigation, route }) => ({228          headerStyle: styles.header,229          headerTitle: "Stores",230          headerTitleAlign: 'center',231          headerLeft: () => (232            // <TouchableOpacity233            //   onPress={() => {234            //     navigation.goBack()235            //   }}236            // >237            //   <Text>Go Back</Text>238            // </TouchableOpacity>239            <Button240              title="Go back"241              onPress={() => {242                navigation.goBack()243              }}244            />245          )246        })}247      />248      <Doctor.Screen name="Change" component={ChangeStores}249        options={({ navigation, route }) => ({250          headerStyle: styles.header,251          headerTitle: "Change Stores",252          headerTitleAlign: 'center',253          headerLeft: () => (254            // <TouchableOpacity255            //   onPress={() => {256            //     navigation.goBack()257            //   }}258            // >259            //   <Text>Go Back</Text>260            // </TouchableOpacity>261            <Button262              title="Go back"263              onPress={() => {264                navigation.goBack()265              }}266            />267          )268        })}269      />270      <Doctor.Screen name="ComplaintPage" component={ComplaintPage}271        options={{headerShown: false}}272      />273      <Doctor.Screen name="Calendar" component={Calendar} 274        options={({ navigation, route }) => ({275          headerStyle: styles.header,276          headerTitle: "Calendar",277          headerTitleAlign: 'center',278          headerLeft: () => (279            // <TouchableOpacity280            //   onPress={() => {281            //     navigation.goBack()282            //   }}283            // >284            //   <Text>Go Back</Text>285            // </TouchableOpacity>286            <Button287              title="Go back"288              onPress={() => {289                navigation.goBack()290              }}291            />292          )293        })}294      />295    </Doctor.Navigator>296  )297}298export default class App extends React.Component {299  render() {300    return (301      <NavigationContainer>302        <MyLogin />303      </NavigationContainer>...index.js
Source:index.js  
1import React from 'react';2import {createStackNavigator} from '@react-navigation/stack';3import {IconButton, Subheading} from 'react-native-paper';4import BackButton from '../../../custom/BackButton';5const Stack = createStackNavigator();6import Forms from '../../../../screens/Dashboard/More/Forms';7import FormNewMember from '../../../../screens/Dashboard/More/Forms/FormNewMember';8import FormChildDedication from '../../../../screens/Dashboard/More/Forms/FormChildDedication';9import FormConnection from '../../../../screens/Dashboard/More/Forms/FormConnection';10import FormVolunteer from '../../../../screens/Dashboard/More/Forms/FormVolunteer';11import FormFeedback from '../../../../screens/Dashboard/More/Forms/FormFeedback';12import FormSurvey from '../../../../screens/Dashboard/More/Forms/FormSurvey';13import FormMembership from '../../../../screens/Dashboard/More/Forms/FormMembership';14const Form = () => {15  return (16    <Stack.Navigator initialRouteName="FormScreen">17      <Stack.Screen18        name="FormScreen"19        options={({route, navigation: {goBack}}) => ({20          headerLeft: () => <BackButton goBack={goBack} />,21          headerTitle: () => <Subheading>Forms</Subheading>,22        })}23        component={Forms}24      />25      <Stack.Screen26        name="FormNewMemberScreen"27        options={({route, navigation: {goBack}}) => ({28          headerLeft: () => <BackButton goBack={goBack} />,29          headerTitle: () => <Subheading>New Member Form</Subheading>,30        })}31        component={FormNewMember}32      />33      <Stack.Screen34        name="FormChildDedicationScreen"35        options={({route, navigation: {goBack}}) => ({36          headerLeft: () => <BackButton goBack={goBack} />,37          headerTitle: () => <Subheading>Child Dedication Form</Subheading>,38        })}39        component={FormChildDedication}40      />41      <Stack.Screen42        name="FormConnection"43        options={({route, navigation: {goBack}}) => ({44          headerLeft: () => <BackButton goBack={goBack} />,45          headerTitle: () => <Subheading>Connection Card</Subheading>,46        })}47        component={FormConnection}48      />49      <Stack.Screen50        name="FormVolunteer"51        options={({route, navigation: {goBack}}) => ({52          headerLeft: () => <BackButton goBack={goBack} />,53          headerTitle: () => <Subheading>Volunteer Sign-Up</Subheading>,54        })}55        component={FormVolunteer}56      />57      <Stack.Screen58        name="FormFeedback"59        options={({route, navigation: {goBack}}) => ({60          headerLeft: () => <BackButton goBack={goBack} />,61          headerTitle: () => <Subheading>Feedback</Subheading>,62        })}63        component={FormFeedback}64      />65      <Stack.Screen66        name="FormSurvey"67        options={({route, navigation: {goBack}}) => ({68          headerLeft: () => <BackButton goBack={goBack} />,69          headerTitle: () => <Subheading>Survey</Subheading>,70        })}71        component={FormSurvey}72      />73      <Stack.Screen74        name="FormMembership"75        options={({route, navigation: {goBack}}) => ({76          headerLeft: () => <BackButton goBack={goBack} />,77          headerTitle: () => <Subheading>Membership</Subheading>,78        })}79        component={FormMembership}80      />81    </Stack.Navigator>82  );83};...HomePubilcPage.js
Source:HomePubilcPage.js  
...33    const {state,goBack,navigate}=this.props.navigation34    //æ ¹æ®ä¼ å¼çä¸å渲æåºä¸åçç»ä»¶35    if(state.params.id===1){36        return <FaultReportPage37        goBack={()=>goBack()}38        navigate={navigate}39        />40    }else if(state.params.id===2){41        return <ServiceRequestPage42        goBack={()=>goBack()}43        navigate={navigate}44        />45    }else if(state.params.id===3){46        return <ConstructionApplicationPage47        goBack={()=>goBack()}48        navigate={navigate}49        />50    }else if(state.params.id===4){51        return <AssetsViewPage52        goBack={()=>goBack()}53        navigate={navigate}54        />55    }else if(state.params.id===5){56        return <ShiftWorkPage57        goBack={()=>goBack()}58        navigate={navigate}59        />60    }else if(state.params.id===6){61        return <PatrolCheckPage62        goBack={()=>goBack()}63        navigate={navigate}64        />65    }else if(state.params.id===7){66        return <KnowledgeBasePage67        goBack={()=>goBack()}68        navigate={navigate}69        />70    }else if(state.params.id===8){71        return <PUEViewPage72        goBack={()=>goBack()}73        navigate={navigate}74        />75    }else if(state.params.id===9){76        return <EnergyEfficiencyPage77        goBack={()=>goBack()}78        navigate={navigate}79        />80    }else if(state.params.id===10){81        return <WeeklyPage82        goBack={()=>goBack()}83        navigate={navigate}84        />85    }else if(state.params.id===11){86        return <MonthlyPage87        goBack={()=>goBack()}88        navigate={navigate}89        />90    }else if(state.params.id===12){91        return <AnnualReportPage92        goBack={()=>goBack()}93        navigate={navigate}94        />95    }else if(state.params.id===13){96        return <CapacityViewPage97        goBack={()=>goBack()}98        navigate={navigate}99        />100    }else if(state.params.id===14){101        return <MorePage102        goBack={()=>goBack()}103        navigate={navigate}104        />105    }106  }107}108const styles = StyleSheet.create({...remote.js
Source:remote.js  
1function remote() {2  var remote = {};3  var xmlHttp = null;4  // å建xmlHttp5  try {6    xmlHttp = new XMLHttpRequest();7  } catch (e) {8    try {9      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");10    } catch (e) {11      try {12        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");13      } catch (e) {14        return null;15      }16    }17  }18  if(xmlHttp)19  // remoteæ§è¡åæ§è¡20  remote.before = function(goback, params) {21  	if(goback) {22  			goback(params);23  	}24  };25// remoteæ§è¡å26  remote.after = function(goback, params) {27  	if(goback) {28  		goback(params);29  	}30  }31// remoteæ§è¡ä½32	remote.run = function(url, params, goback, methods) {33		remote.before();34      	xmlHttp.open(methods, url, true);35        xmlHttp.setRequestHeader("Content-Type", "application/json");36       // xmlHttp.setRequestHeader('X-Custom-Header', 'application/json');37        // xmlHttp.withCredentials = true;38        // var temp = {name:"wang",passoword:"password"};39        xmlHttp.send(params);40      	xmlHttp.onreadystatechange = function() {41      		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {42      			remote.after();43            // console.log("json: "+xmlHttp.responseText)44      			goback(xmlHttp.responseText);45      		}46      	};47	}48// 妿xmlåå¨åå§åremote49  if(xmlHttp) {50      remote.get = function(url, params, goback) {51      	remote.run(url,null, goback, 'GET');52      };53      remote.post = function(url, params, goback) {54      	remote.run(url, params, goback, 'POST');55      }56  }57  return remote;...BackButton.js
Source:BackButton.js  
1var React = require('react');2module.exports = React.createClass({3    goBack() {4        var goBack = this.props.goBack;5        if (!goBack || !goBack()) {6            app.goBack();7        }8    },9    render() {10        var haveBackButton = this.props.goBack!==false;11        if (!haveBackButton) {12            return (13                <div className="left">14                </div>15            )16        }17        if (app.params.material) {18            return (19                <div className="left">20                    <a...Using AI Code Generation
1const { openBrowser, goto, goBack, closeBrowser } = require('taiko');2(async () => {3    try {4        await openBrowser();5        await goto("google.com");6        await goto("yahoo.com");7        await goBack();8    } catch (e) {9        console.error(e);10    } finally {11        await closeBrowser();12    }13})();14const { openBrowser, goto, goForward, closeBrowser } = require('taiko');15(async () => {16    try {17        await openBrowser();18        await goto("google.com");19        await goto("yahoo.com");20        await goBack();21        await goForward();22    } catch (e) {23        console.error(e);24    } finally {25        await closeBrowser();26    }27})();28const { openBrowser, goto, reload, closeBrowser } = require('taiko');29(async () => {30    try {31        await openBrowser();32        await goto("google.com");33        await reload();34    } catch (e) {35        console.error(e);36    } finally {37        await closeBrowser();38    }39})();40const { openBrowser, goto, setCookie, closeBrowser } = require('taiko');41(async () => {42    try {43        await openBrowser();44        await goto("google.com");45        await setCookie({name: 'foo', value: 'bar', domain: 'google.com'});46    } catch (e) {47        console.error(e);48    } finally {49        await closeBrowser();50    }51})();52const { openBrowser, goto, deleteCookies, closeBrowser } = require('taiko');53(async () => {54    try {55        await openBrowser();56        await goto("google.com");57        await deleteCookies();58    } catch (e) {59        console.error(e);60    } finally {61        await closeBrowser();62    }63})();64const { openBrowser, goto, clear, closeBrowser } = require('taiko');65(async () => {66    try {67        await openBrowser();68        await goto("google.com");69        await clear();70    } catch (e)Using AI Code Generation
1const { goBack } = require('taiko');2goBack();3const { goForward } = require('taiko');4goForward();5const { reload } = require('taiko');6reload();7const { clickLink } = require('taiko');8clickLink('linkText');9const { clickButton } = require('taiko');10clickButton('buttonText');11const { click } = require('taiko');12click('text');13const { click } = require('taiko');14click('text', {waitForEvents: ['load', 'domcontentloaded', 'networkidle']});15const { click } = require('taiko');16click('text', {waitForEvents: ['load', 'domcontentloaded', 'networkidle'], timeout: 1000});17const { click } = require('taiko');18click('text', {waitForEvents: ['load', 'domcontentloaded', 'networkidle'], timeout: 1000, retryInterval: 100});19const { click } = require('taiko');20click('text', {waitForEvents: ['load', 'domcontentloaded', 'networkidle'], timeout: 1000, retryInterval: 100, navigationTimeout: 10000});21const { click } = require('taiko');22click('text', {waitForEvents: ['load', 'domcontentloaded', 'networkidle'], timeout: 1000, retryInterval: 100, navigationTimeout: 10000, observe: true});23const { click } = require('taiko');24click('text', {waitForEvents: ['loadUsing AI Code Generation
1const { openBrowser, goto, closeBrowser, goBack } = require('taiko');2(async () => {3    try {4        await openBrowser();5        await goBack();6    } catch (e) {7        console.error(e);8    } finally {9        await closeBrowser();10    }11})();Using AI Code Generation
1const { openBrowser, goto, closeBrowser, goBack } = require('taiko');2(async () => {3    try {4        await openBrowser();5        await goto("google.com");6        await goto("taiko.dev");7        await goBack();8    } catch (e) {9        console.error(e);10    } finally {11        await closeBrowser();12    }13})();14### goForward()15const { openBrowser, goto, closeBrowser, goForward } = require('taiko');16(async () => {17    try {18        await openBrowser();19        await goto("google.com");20        await goto("taiko.dev");21        await goBack();22        await goForward();23    } catch (e) {24        console.error(e);25    } finally {26        await closeBrowser();27    }28})();29### reload()30const { openBrowser, goto, closeBrowser, reload } = require('taiko');31(async () => {32    try {33        await openBrowser();34        await goto("google.com");35        await reload();36    } catch (e) {37        console.error(e);38    } finally {39        await closeBrowser();40    }41})();42### intercept(requestUrl, options)43const { openBrowser, goto, closeBrowser, intercept } = require('taiko');44(async () => {45    try {46        await openBrowser();47        await click("Get Repos");48        await text("gauge").exists();49    } catch (e) {50        console.error(e);51    } finally {52        await closeBrowser();53    }54})();55### intercept(requestUrl, responseHandler)Using AI Code Generation
1const { openBrowser, goto, closeBrowser, goBack } = require('taiko');2(async () => {3    try {4        await openBrowser();5        await goto("google.com");6        await goto("gauge.org");7        await goBack();8        await closeBrowser();9    } catch (e) {10        console.error(e);11    } finally {12    }13})();14const { openBrowser, goto, closeBrowser, goForward } = require('taiko');15(async () => {16    try {17        await openBrowser();18        await goto("google.com");19        await goto("gauge.org");20        await goBack();21        await goForward();22        await closeBrowser();23    } catch (e) {24        console.error(e);25    } finally {26    }27})();28const { openBrowser, goto, closeBrowser, reload } = require('taiko');29(async () => {30    try {31        await openBrowser();32        await goto("google.com");33        await reload();34        await closeBrowser();35    } catch (e) {36        console.error(e);37    } finally {38    }39})();40const { openBrowser, goto, closeBrowser, write, clear } = require('taiko');41(async () => {42    try {43        await openBrowser();44        await goto("google.com");45        await write("Gauge");46        await clear();47        await closeBrowser();48    } catch (e) {49        console.error(e);50    } finally {51    }52})();53const { openBrowser, goto, closeBrowser, press } = require('taiko');54(async () => {55    try {56        await openBrowser();57        await goto("google.com");58        await press("Enter");59        await closeBrowser();60    } catch (e) {61        console.error(e);62    } finally {63    }64})();65const { openBrowser, goto, closeBrowser, screenshot } = require('taiko');66(async () => {67    try {68        await openBrowser();69        await goto("google.com");70        await screenshot({ path: "google.png" });71        await closeBrowser();72    } catchUsing AI Code Generation
1await goBack();2await goForward();3await reload();4await closeTab();5await screenshot({ path: 'screenshot.png' });6await setViewPort({ width: 1280, height: 800 });7await emulateDevice('iPhone 6');8await evaluate(() => {9  return document.title;10});11await evaluateOnSelector('h1', (element) => {12  return element.innerText;13});14await evaluateOnSelectorAll('h1', (elements) => {15  return elements.map((element) => element.innerText);16});17await keyboard.press('Enter');18await keyboard.down('Shift');19await keyboard.up('Shift');20await mouse.move(100, 100);21await mouse.click(100, 100);22await mouse.down();23await mouse.up();24await mouse.wheel(100, 100, 10);25await tap('Google');Using AI Code Generation
1const { openBrowser, goto, link, goBack, closeBrowser } = require('taiko');2(async () => {3    try {4        await openBrowser();5        await goto("google.com");6        await link('Gmail').exists();7        await link('Gmail').click();8        await link('Sign in').exists();9        await link('Sign in').click();10        await link('Create an account').exists();11        await link('Create an account').click();12        await link('Privacy').exists();13        await link('Privacy').click();14        await goBack();15        await link('Terms').exists();16        await link('Terms').click();17        await goBack();18        await link('Help').exists();19        await link('Help').click();20        await goBack();21    } catch (e) {22        console.error(e);23    } finally {24        await closeBrowser();25    }26})();Using AI Code Generation
1step("Go back to previous page", async () => {2  await goBack();3});4step("Go forward to next page", async () => {5  await goForward();6});7step("Reload the current page", async () => {8  await reload();9});10step("Open a new tab", async () => {11  await openTab();12});13step("Close the current tab", async () => {14  await closeTab();15});16step("Switch to tab with title <title>", async (title) => {17  await switchTo(title);18});19step("Switch to tab with URL <url>", async (url) => {20  await switchTo(url);21});22step("Switch to tab with index <index>", async (index) => {23  await switchTo(parseInt(index));24});25step("Switch to tab with title containing <title>", async (title) => {26  await switchTo(title, { partialMatch: true });27});28step("Switch to tab with URL containing <url>", async (url) => {29  await switchTo(url, { partialMatch: true });30});31step("Switch to tab with title <title> and URL <url>", async (title, url) => {32  await switchTo(title, { partialMatch: true, url: url });33});34step("Switch to tab with title <title> and URL containing <url>", async (title, url) => {35  await switchTo(title, { partialMatch: true, url: url, urlPartialMatch: true });36});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!!
