Best JavaScript code snippet using playwright-internal
userRecordExample.js
Source:userRecordExample.js  
1module.exports = {2	'_id': '5672c54648ec119d075ef3f2',3	'recordEntry': {4		'_id': '58a40c66ca16361b7cac2091',5		'name': 'dogofoodinc',6		'company': '567263551c96a0d10b98ef26',7		'__v': 0,8		'properties': [{9				'key': 'employee.info',10				'type': 'section',11				'i18n': {12					'de': 'Persönliche Informationen',13					'en': 'Personal Informationen'14				},15				'opts': {16					'readOnly': false17				},18				'properties': [{19						'key': 'employee.info.personalName',20						'type': 'group',21						'i18n': {22							'de': 'Name',23							'en': 'Name'24						},25						'properties': [{26								'key': 'employee.info.salutation',27								'type': 'text',28								'validations': {29									'presence': true30								},31								'i18n': {32									'de': 'Anrede',33									'en': 'Salutation'34								},35								'opts': {36									'readOnly': false37								}38							},39							{40								'key': 'employee.info.title',41								'type': 'text',42								'i18n': {43									'de': 'Titel',44									'en': 'Title'45								},46								'opts': {47									'readOnly': false48								}49							},50							{51								'key': 'employee.info.firstName',52								'type': 'text',53								'mappedTo': 'firstName',54								'validations': {55									'presence': true56								},57								'i18n': {58									'de': 'Vorname',59									'en': 'Firstname'60								},61								'opts': {62									'readOnly': false63								},64								'value': 'Alex'65							},66							{67								'key': 'employee.info.lastName',68								'type': 'text',69								'mappedTo': 'lastName',70								'validations': {71									'presence': true72								},73								'i18n': {74									'de': 'Nachname',75									'en': 'Lastname'76								},77								'opts': {78									'readOnly': false79								},80								'value': 'Trampisch'81							}82						],83						'opts': {84							'readOnly': false85						}86					},87					{88						'key': 'employee.info.personalAdress',89						'type': 'group',90						'i18n': {91							'de': 'Adresse',92							'en': 'Address',93							'info_de': 'Lorem Ipsum Adresse dolores',94							'info_en': 'Lorem Ipsum Address dolores in English'95						},96						'properties': [{97								'key': 'employee.info.street',98								'type': 'text',99								'i18n': {100									'de': 'Strasse',101									'en': 'Street'102								},103								'opts': {104									'readOnly': false105								}106							},107							{108								'key': 'employee.info.street2',109								'type': 'text',110								'opts': {111									'readOnly': false112								}113							},114							{115								'key': 'employee.info.city',116								'type': 'text',117								'i18n': {118									'de': 'Stadt',119									'en': 'City'120								},121								'opts': {122									'readOnly': false123								}124							},125							{126								'key': 'employee.info.postalCode',127								'type': 'text',128								'i18n': {129									'de': 'Postleitzahl',130									'en': 'Zip Code'131								},132								'opts': {133									'readOnly': false134								}135							},136							{137								'key': 'employee.info.country',138								'type': 'select',139								'service': 'countries',140								'i18n': {141									'de': 'Land',142									'en': 'Country'143								},144								'opts': {145									'readOnly': false146								}147							}148						],149						'opts': {150							'readOnly': false151						}152					},153					{154						'key': 'employee.info.personalContact',155						'type': 'group',156						'i18n': {157							'de': 'Kontakt',158							'en': 'Contact'159						},160						'properties': [{161								'key': 'employee.info.workEmail',162								'type': 'email',163								'validations': {164									'format': {}165								},166								'i18n': {167									'de': 'Email Arbeit',168									'en': 'Email Work'169								},170								'opts': {171									'readOnly': false172								}173							},174							{175								'key': 'employee.info.privateEmail',176								'type': 'email',177								'validations': {178									'format': {}179								},180								'i18n': {181									'de': 'Email Privat',182									'en': 'Email Private'183								},184								'opts': {185									'readOnly': false186								}187							},188							{189								'key': 'employee.info.workPhone',190								'type': 'phone',191								'i18n': {192									'de': 'Telefon Arbeit',193									'en': 'Phone Work'194								},195								'opts': {196									'readOnly': false197								}198							},199							{200								'key': 'employee.info.workMobile',201								'type': 'phone',202								'i18n': {203									'de': 'Mobil Arbeit',204									'en': 'Mobile Work'205								},206								'opts': {207									'readOnly': false208								}209							},210							{211								'key': 'employee.info.emergencyContacts',212								'type': 'comment',213								'i18n': {214									'de': 'Notfallnummern',215									'en': 'Emergency Contacts',216									'info_de': 'Name der Notfallnummer und Bezug (Bsp. Ehepartner)',217									'info_en': 'Name der Notfallnummer und Bezug (Bsp. Ehepartner)'218								},219								'opts': {220									'readOnly': false221								}222							}223						],224						'opts': {225							'readOnly': false226						}227					},228					{229						'key': 'employee.info.personalOther',230						'type': 'group',231						'i18n': {232							'de': 'Weiteres',233							'en': 'Other'234						},235						'properties': [{236								'key': 'employee.info.nationality1',237								'type': 'select',238								'service': 'countries',239								'attachments': true,240								'i18n': {241									'de': 'Nationalität',242									'en': 'Nationality'243								},244								'opts': {245									'readOnly': false246								}247							},248							{249								'key': 'employee.info.nationality2',250								'type': 'select',251								'service': 'countries',252								'attachments': true,253								'i18n': {254									'de': 'Nationalität (2)',255									'en': 'Nationality (2)'256								},257								'opts': {258									'readOnly': false259								}260							},261							{262								'key': 'employee.info.homeTown',263								'type': 'text',264								'i18n': {265									'de': 'Heimatort',266									'en': 'Home Town',267									'info_de': 'nur bei CH notwendig',268									'info_en': 'Switzerland only'269								},270								'opts': {271									'readOnly': false272								}273							},274							{275								'key': 'employee.info.confession',276								'type': 'text',277								'i18n': {278									'de': 'Konfession',279									'en': 'Confession'280								},281								'opts': {282									'readOnly': false283								}284							},285							{286								'key': 'employee.info.maritialStatus',287								'type': 'text',288								'attachments': true,289								'i18n': {290									'de': 'Ehestand',291									'en': 'Maritial Status'292								},293								'opts': {294									'readOnly': false295								}296							},297							{298								'key': 'employee.info.numberOfChildren',299								'type': 'text',300								'attachments': true,301								'comment': {302									'key': 'numberOfChildren.details',303									'i18n': {304										'de': 'Details',305										'en': 'Details',306										'info_de': 'Name, Geschlecht und Geburtsdatum der Kinder',307										'info_en': 'Name, Gender and Date of Birth of Children'308									}309								},310								'i18n': {311									'de': 'Anzahl Kinder',312									'en': 'Number of Children',313									'info_de': 'Name, Geschlecht und Geburtsdatum der Kinder',314									'info_en': 'Name, Gender and Date of Birth of Children'315								},316								'opts': {317									'readOnly': false318								}319							},320							{321								'key': 'employee.info.socialSecurityNumber',322								'type': 'text',323								'attachments': true,324								'i18n': {325									'de': 'Sozialversicherungs- nummer',326									'en': 'Social Security Number'327								},328								'opts': {329									'readOnly': false330								}331							}332						],333						'opts': {334							'readOnly': false335						}336					}337				],338				'readOnly': false339			},340			{341				'key': 'contract',342				'type': 'section',343				'i18n': {344					'de': 'Arbeitsvertragliche Informationen',345					'en': 'Working Contract Informationen'346				},347				'opts': {348					'readOnly': false349				},350				'properties': [{351						'key': 'employee.contract.contractContract',352						'type': 'group',353						'i18n': {354							'de': 'Vertrag/Status',355							'en': 'Contract/Status'356						},357						'properties': [{358								'key': 'employee.contract.status',359								'mappedTo': 'state',360								'type': 'select',361								'service': 'userStatus',362								'i18n': {363									'de': 'Status',364									'en': 'Status'365								},366								'opts': {367									'readOnly': false368								},369								'value': 2370							},371							{372								'key': 'employee.contract.employee.number',373								'type': 'text',374								'mappedTo': 'employeeId',375								'i18n': {376									'de': 'Mitarbeiter Nummer',377									'en': 'Employee Id'378								},379								'opts': {380									'readOnly': false381								},382								'value': ''383							},384							{385								'key': 'employee.contract.startEnd',386								'type': 'date',387								'i18n': {388									'de': 'Eintrittsdatum',389									'en': 'Date of Entry'390								},391								'opts': {392									'readOnly': false393								}394							},395							{396								'key': 'employee.contract.startEndSCG',397								'type': 'date',398								'i18n': {399									'de': 'Eintrittsdatum SCG',400									'en': 'Date of Entry SCG'401								},402								'opts': {403									'readOnly': false404								}405							},406							{407								'key': 'employee.contract.probationEnd',408								'type': 'date',409								'i18n': {410									'de': 'Ende Probezeit',411									'en': 'End Probation'412								},413								'opts': {414									'readOnly': false415								}416							},417							{418								'key': 'employee.contract.dateOfExit',419								'type': 'date',420								'i18n': {421									'de': 'Austrittsdatum',422									'en': 'Exit Date'423								},424								'comment': {425									'key': 'dateOfExit.reason',426									'i18n': {427										'de': 'Grund',428										'en': 'Reason'429									}430								},431								'opts': {432									'readOnly': false433								}434							}435						],436						'opts': {437							'readOnly': false438						}439					},440					{441						'key': 'employee.contract.contractMembership',442						'type': 'group',443						'i18n': {444							'de': 'Organisation',445							'en': 'Organization'446						},447						'properties': [{448								'key': 'employee.contract.companyMembership',449								'type': 'list',450								'i18n': {451									'de': 'Firma',452									'en': 'Company'453								},454								'properties': [{455										'key': 'employee.contract.companyMembership.name',456										'type': 'text',457										'i18n': {458											'de': 'Name',459											'en': 'Name'460										},461										'opts': {462											'readOnly': false463										}464									},465									{466										'key': 'employee.contract.companyMembership.start',467										'type': 'date',468										'i18n': {469											'de': 'Start',470											'en': 'Start'471										},472										'opts': {473											'readOnly': false474										}475									},476									{477										'key': 'employee.contract.companyMembership.end',478										'type': 'date',479										'i18n': {480											'de': 'Ende',481											'en': 'End'482										},483										'opts': {484											'readOnly': false485										}486									}487								],488								'opts': {489									'readOnly': false490								},491								'values': {}492							},493							{494								'key': 'employee.contract.locationMembership',495								'type': 'list',496								'i18n': {497									'de': 'Standort',498									'en': 'Location'499								},500								'properties': [{501										'key': 'employee.contract.locationMembership.name',502										'type': 'text',503										'i18n': {504											'de': 'Name',505											'en': 'Name'506										},507										'opts': {508											'readOnly': false509										}510									},511									{512										'key': 'employee.contract.locationMembership.start',513										'type': 'date',514										'i18n': {515											'de': 'Start',516											'en': 'Start'517										},518										'opts': {519											'readOnly': false520										}521									},522									{523										'key': 'employee.contract.locationMembership.end',524										'type': 'date',525										'i18n': {526											'de': 'Ende',527											'en': 'End'528										},529										'opts': {530											'readOnly': false531										}532									}533								],534								'opts': {535									'readOnly': false536								},537								'values': {}538							},539							{540								'key': 'employee.contract.departmentMembership',541								'type': 'list',542								'i18n': {543									'de': 'Abteilung',544									'en': 'Department'545								},546								'properties': [{547										'key': 'employee.contract.departmentMembership.name',548										'type': 'text',549										'i18n': {550											'de': 'Name',551											'en': 'Name'552										},553										'opts': {554											'readOnly': false555										}556									},557									{558										'key': 'employee.contract.departmentMembership.start',559										'type': 'date',560										'i18n': {561											'de': 'Start',562											'en': 'Start'563										},564										'opts': {565											'readOnly': false566										}567									},568									{569										'key': 'employee.contract.departmentMembership.end',570										'type': 'date',571										'i18n': {572											'de': 'Ende',573											'en': 'End'574										},575										'opts': {576											'readOnly': false577										}578									}579								],580								'opts': {581									'readOnly': false582								},583								'values': {}584							}585						],586						'opts': {587							'readOnly': false588						}589					},590					{591						'key': 'employee.contract.contractJob',592						'type': 'group',593						'i18n': {594							'de': 'Eingliederung',595							'en': 'Details'596						},597						'properties': [{598								'key': 'employee.contract.role',599								'type': 'list',600								'i18n': {601									'de': 'Function',602									'en': 'Role'603								},604								'properties': [{605										'key': 'employee.contract.role.name',606										'type': 'text',607										'i18n': {608											'de': 'Name',609											'en': 'Name'610										},611										'opts': {612											'readOnly': false613										}614									},615									{616										'key': 'employee.contract.role.name',617										'type': 'text',618										'i18n': {619											'de': 'Vorgesetzter',620											'en': 'Manager'621										},622										'opts': {623											'readOnly': false624										}625									},626									{627										'key': 'employee.contract.role.start',628										'type': 'date',629										'i18n': {630											'de': 'Start',631											'en': 'Start'632										},633										'opts': {634											'readOnly': false635										}636									}637								],638								'opts': {639									'readOnly': false640								},641								'values': {}642							},643							{644								'type': 'text',645								'i18n': {646									'de': 'Arbeitstage (TODO)',647									'en': 'Workingdays (TODO)'648								},649								'key': 'employee.contract.undefined',650								'opts': {651									'readOnly': false652								}653							},654							{655								'key': 'employee.contract.employmentType',656								'type': 'staticlist',657								'i18n': {658									'de': 'Anstellungsart',659									'en': 'Type of Employment'660								},661								'data': [662									'Befristet',663									'Unebefristet'664								],665								'opts': {666									'readOnly': false667								},668								'values': {}669							},670							{671								'key': 'employee.contract.contractType',672								'type': 'staticlist',673								'i18n': {674									'de': 'Vertragstype',675									'en': 'Contract Type'676								},677								'data': [678									'Vollzeit',679									'Teilzeit',680									'Aushilfe'681								],682								'opts': {683									'readOnly': false684								},685								'values': {}686							},687							{688								'key': 'employee.contract.workingHoursModel',689								'type': 'staticlist',690								'i18n': {691									'de': 'Arbeitszeitmodel',692									'en': 'Working Hours Model'693								},694								'data': [695									'1',696									'2',697									'3'698								],699								'opts': {700									'readOnly': false701								},702								'values': {}703							},704							{705								'key': 'employee.contract.approvalType',706								'type': 'text',707								'i18n': {708									'de': 'Typ Bewilligung',709									'en': 'Approval Type'710								},711								'attachments': true,712								'opts': {713									'readOnly': false714								}715							},716							{717								'key': 'employee.contract.approvalProcess',718								'type': 'text',719								'i18n': {720									'de': 'Ablauf Bewilligung',721									'en': 'Approval Process'722								},723								'opts': {724									'readOnly': false725								}726							},727							{728								'key': 'employee.contract.qstRequired',729								'type': 'ifTrue',730								'i18n': {731									'de': 'QST Pflichtig',732									'en': 'QST Required'733								},734								'properties': [{735									'key': 'employee.contract.qst.tarif',736									'type': 'text',737									'i18n': {738										'de': 'Tarif',739										'en': 'Tarif'740									},741									'opts': {742										'readOnly': false743									}744								}],745								'opts': {746									'readOnly': false747								}748							}749						],750						'opts': {751							'readOnly': false752						}753					}754				],755				'readOnly': false756			},757			{758				'key': 'remuneration',759				'type': 'section',760				'i18n': {761					'de': 'Gehalt & Benefits',762					'en': 'Remuneration & Benefits'763				},764				'opts': {765					'readOnly': false766				},767				'properties': [{768						'key': 'employee.remuneration.salary',769						'type': 'list',770						'i18n': {771							'de': 'Gehalt/Lohn',772							'en': 'Salary/Wages'773						},774						'properties': [{775								'key': 'employee.remuneration.salary.start',776								'type': 'date',777								'i18n': {778									'de': 'Start',779									'en': 'Start'780								},781								'opts': {782									'readOnly': false783								},784								'value': '19.05.2017'785							},786							{787								'key': 'employee.remuneration.salary.end',788								'type': 'date',789								'i18n': {790									'de': 'Ende',791									'en': 'End'792								},793								'opts': {794									'readOnly': false795								},796								'value': '123'797							},798							{799								'key': 'employee.remuneration.salary.gross',800								'type': 'numeric',801								'i18n': {802									'de': 'Bruttogehalt',803									'en': 'Gross Salary'804								},805								'opts': {806									'readOnly': false807								},808								'value': 4500809							},810							{811								'key': 'employee.remuneration.salary.type',812								'type': 'staticlist',813								'i18n': {814									'de': 'Gehaltstyp',815									'en': 'Salary type'816								},817								'data': [818									'Pro Monat',819									'Stundenlohn',820									'Anderes(Blogger/Ãbersetzer)'821								],822								'opts': {823									'readOnly': false824								},825								'values': {}826							}827						],828						'opts': {829							'readOnly': false830						},831						'values': {832							'0': [{833									'index': 0,834									'sort': 0,835									'value': '19.05.2017',836									'key': 'employee.remuneration.salary.start',837									'_id': '5927cd280f202adc20e1c09c',838									'documents': []839								},840								{841									'index': 0,842									'sort': 0,843									'value': '',844									'key': 'employee.remuneration.salary.end',845									'_id': '5927cd280f202adc20e1c09d',846									'documents': []847								},848								{849									'index': 0,850									'sort': 0,851									'value': 4500,852									'key': 'employee.remuneration.salary.gross',853									'_id': '5927cd280f202adc20e1c09e',854									'documents': []855								},856								{857									'index': 0,858									'sort': 0,859									'value': 'Pro Monat',860									'key': 'employee.remuneration.salary.type',861									'_id': '5927cd280f202adc20e1c09f',862									'documents': []863								}864							]865						}866					},867					{868						'key': 'employee.remuneration.bonus',869						'type': 'list',870						'i18n': {871							'de': 'Bonus',872							'en': 'Bonus'873						},874						'properties': [{875								'key': 'employee.remuneration.bonus',876								'type': 'date',877								'i18n': {878									'de': 'Datum',879									'en': 'Date'880								},881								'opts': {882									'readOnly': false883								}884							},885							{886								'key': 'employee.remuneration.bonus.amount',887								'type': 'numeric',888								'i18n': {889									'de': 'Betrag',890									'en': 'Amount'891								},892								'opts': {893									'readOnly': false894								}895							},896							{897								'key': 'employee.remuneration.bonus.text',898								'type': 'text',899								'i18n': {900									'de': 'Text',901									'en': 'Text'902								},903								'opts': {904									'readOnly': false905								}906							}907						],908						'opts': {909							'readOnly': false910						},911						'values': {}912					},913					{914						'key': 'employee.remuneration.benefits',915						'type': 'list',916						'i18n': {917							'de': 'Zusatzbenefits/Variable Vergütung',918							'en': 'Benefits / Variable Payment'919						},920						'properties': [{921								'key': 'employee.remuneration.benefits.start',922								'type': 'date',923								'i18n': {924									'de': 'Start',925									'en': 'Start'926								},927								'opts': {928									'readOnly': false929								}930							},931							{932								'key': 'employee.remuneration.benefits.end',933								'type': 'date',934								'i18n': {935									'de': 'Ende',936									'en': 'End'937								},938								'opts': {939									'readOnly': false940								}941							},942							{943								'key': 'employee.remuneration.benefits.type',944								'type': 'text',945								'i18n': {946									'de': 'Art',947									'en': 'Type'948								},949								'opts': {950									'readOnly': false951								}952							},953							{954								'key': 'employee.remuneration.benefits.amount',955								'type': 'currency',956								'i18n': {957									'de': 'Betrag',958									'en': 'Amount'959								},960								'opts': {961									'readOnly': false962								}963							},964							{965								'key': 'employee.remuneration.benefits.text',966								'type': 'text',967								'i18n': {968									'de': 'Text',969									'en': 'Text'970								},971								'opts': {972									'readOnly': false973								}974							}975						],976						'opts': {977							'readOnly': false978						},979						'values': {}980					}981				],982				'readOnly': false983			},984			{985				'key': 'education',986				'type': 'section',987				'i18n': {988					'de': 'Aus- und Weiterbildung',989					'en': 'Education,Training & Expertise '990				},991				'opts': {992					'readOnly': false993				},994				'properties': [{995						'key': 'employee.education.education',996						'type': 'list',997						'i18n': {998							'de': 'Aus- und Weiterbildung',999							'en': 'Education and Training'1000						},1001						'properties': [{1002								'key': 'employee.education.education.start',1003								'type': 'date',1004								'i18n': {1005									'de': 'Start',1006									'en': 'Start'1007								},1008								'opts': {1009									'readOnly': false1010								}1011							},1012							{1013								'key': 'employee.education.education.end',1014								'type': 'date',1015								'i18n': {1016									'de': 'Ende',1017									'en': 'End'1018								},1019								'opts': {1020									'readOnly': false1021								}1022							},1023							{1024								'key': 'employee.education.education.title',1025								'type': 'text',1026								'i18n': {1027									'de': 'Name',1028									'en': 'Name'1029								},1030								'attachments': true,1031								'opts': {1032									'readOnly': false1033								}1034							}1035						],1036						'opts': {1037							'readOnly': false1038						},1039						'values': {}1040					},1041					{1042						'key': 'employee.education.degree',1043						'type': 'text',1044						'i18n': {1045							'de': 'AbschluÃ',1046							'en': 'Degree'1047						},1048						'opts': {1049							'readOnly': false1050						}1051					},1052					{1053						'key': 'employee.education.planed',1054						'type': 'comment',1055						'i18n': {1056							'de': 'Geplante oder aktuelle Weiterbildungen',1057							'en': 'Planned or current Training'1058						},1059						'opts': {1060							'readOnly': false1061						}1062					},1063					{1064						'key': 'employee.education.expertise',1065						'type': 'comment',1066						'i18n': {1067							'de': 'Fachkompetenzen',1068							'en': 'Professional expertise'1069						},1070						'opts': {1071							'readOnly': false1072						}1073					},1074					{1075						'key': 'employee.education.languages',1076						'type': 'list',1077						'i18n': {1078							'de': 'Sprachen',1079							'en': 'Languages'1080						},1081						'properties': [{1082								'key': 'employee.education.languages.lang',1083								'type': 'text',1084								'i18n': {1085									'de': 'Sprache',1086									'en': 'Language'1087								},1088								'attachments': true,1089								'opts': {1090									'readOnly': false1091								}1092							},1093							{1094								'key': 'employee.education.languages.oral',1095								'type': 'number',1096								'i18n': {1097									'de': 'Level Mündlich',1098									'en': 'Oral Proficiency'1099								},1100								'opts': {1101									'readOnly': false1102								}1103							},1104							{1105								'key': 'employee.education.languages.written',1106								'type': 'number',1107								'i18n': {1108									'de': 'Level Schriftlich',1109									'en': 'Written Proficiency'1110								},1111								'opts': {1112									'readOnly': false1113								}1114							}1115						],1116						'opts': {1117							'readOnly': false1118						},1119						'values': {}1120					}1121				],1122				'readOnly': false1123			},1124			{1125				'key': 'development',1126				'type': 'section',1127				'i18n': {1128					'de': 'Mitarbeiterentwicklung',1129					'en': 'Employee Development'1130				},1131				'opts': {1132					'readOnly': false1133				},1134				'properties': [{1135						'key': 'employee.development.reviews',1136						'type': 'list',1137						'i18n': {1138							'de': 'Mitarbeitergespräche',1139							'en': 'Reviews'1140						},1141						'properties': [{1142								'key': 'employee.development.reviews.date',1143								'type': 'date',1144								'i18n': {1145									'de': 'Datum',1146									'en': 'Date'1147								},1148								'opts': {1149									'readOnly': false1150								}1151							},1152							{1153								'key': 'employee.development.reviews.text',1154								'type': 'comment',1155								'i18n': {1156									'de': 'Name',1157									'en': 'Name'1158								},1159								'attachments': true,1160								'opts': {1161									'readOnly': false1162								}1163							}1164						],1165						'opts': {1166							'readOnly': false1167						},1168						'values': {}1169					},1170					{1171						'key': 'employee.development.targets',1172						'type': 'list',1173						'i18n': {1174							'de': 'Zielvereinbarungen',1175							'en': 'Targets'1176						},1177						'properties': [{1178								'key': 'employee.development.targets.date',1179								'type': 'date',1180								'i18n': {1181									'de': 'Datum',1182									'en': 'Date'1183								},1184								'opts': {1185									'readOnly': false1186								}1187							},1188							{1189								'key': 'employee.development.targets.text',1190								'type': 'comment',1191								'i18n': {1192									'de': 'Ziele',1193									'en': 'Targets'1194								},1195								'attachments': true,1196								'opts': {1197									'readOnly': false1198								}1199							},1200							{1201								'key': 'employee.development.targets.done',1202								'type': 'boolean',1203								'i18n': {1204									'de': 'Erledigt',1205									'en': 'Done'1206								},1207								'opts': {1208									'readOnly': false1209								}1210							}1211						],1212						'opts': {1213							'readOnly': false1214						},1215						'values': {}1216					}1217				],1218				'readOnly': false1219			},1220			{1221				'key': 'notes',1222				'type': 'section',1223				'i18n': {1224					'de': 'Notizen',1225					'en': 'Notes'1226				},1227				'opts': {1228					'readOnly': false1229				},1230				'properties': [{1231					'key': 'notes.text',1232					'type': 'multitext',1233					'i18n': {1234						'de': 'Notizen',1235						'en': 'Notes'1236					},1237					'attachments': true,1238					'opts': {1239						'readOnly': false1240					}1241				}],1242				'readOnly': false1243			}1244		],1245		'custom': false,1246		'active': true,1247		'record': '5927cd000f202adc20e1c09b'1248	},..._browser-globals.js
Source:_browser-globals.js  
1// DON'T EDIT THIS FILE WHICH WAS GENERATED BY './scripts/generate-browser-globals.js'.2"use strict"3module.exports = {4    AbortController: "readonly",5    AbortSignal: "readonly",6    AnalyserNode: "readonly",7    Animation: "readonly",8    AnimationEffectReadOnly: "readonly",9    AnimationEffectTiming: "readonly",10    AnimationEffectTimingReadOnly: "readonly",11    AnimationEvent: "readonly",12    AnimationPlaybackEvent: "readonly",13    AnimationTimeline: "readonly",14    ApplicationCache: "readonly",15    ApplicationCacheErrorEvent: "readonly",16    Attr: "readonly",17    Audio: "readonly",18    AudioBuffer: "readonly",19    AudioBufferSourceNode: "readonly",20    AudioContext: "readonly",21    AudioDestinationNode: "readonly",22    AudioListener: "readonly",23    AudioNode: "readonly",24    AudioParam: "readonly",25    AudioProcessingEvent: "readonly",26    AudioScheduledSourceNode: "readonly",27    "AudioWorkletGlobalScope ": "readonly",28    AudioWorkletNode: "readonly",29    AudioWorkletProcessor: "readonly",30    BarProp: "readonly",31    BaseAudioContext: "readonly",32    BatteryManager: "readonly",33    BeforeUnloadEvent: "readonly",34    BiquadFilterNode: "readonly",35    Blob: "readonly",36    BlobEvent: "readonly",37    BroadcastChannel: "readonly",38    BudgetService: "readonly",39    ByteLengthQueuingStrategy: "readonly",40    CSS: "readonly",41    CSSConditionRule: "readonly",42    CSSFontFaceRule: "readonly",43    CSSGroupingRule: "readonly",44    CSSImportRule: "readonly",45    CSSKeyframeRule: "readonly",46    CSSKeyframesRule: "readonly",47    CSSMediaRule: "readonly",48    CSSNamespaceRule: "readonly",49    CSSPageRule: "readonly",50    CSSRule: "readonly",51    CSSRuleList: "readonly",52    CSSStyleDeclaration: "readonly",53    CSSStyleRule: "readonly",54    CSSStyleSheet: "readonly",55    CSSSupportsRule: "readonly",56    Cache: "readonly",57    CacheStorage: "readonly",58    CanvasCaptureMediaStreamTrack: "readonly",59    CanvasGradient: "readonly",60    CanvasPattern: "readonly",61    CanvasRenderingContext2D: "readonly",62    ChannelMergerNode: "readonly",63    ChannelSplitterNode: "readonly",64    CharacterData: "readonly",65    ClipboardEvent: "readonly",66    CloseEvent: "readonly",67    Comment: "readonly",68    CompositionEvent: "readonly",69    ConstantSourceNode: "readonly",70    ConvolverNode: "readonly",71    CountQueuingStrategy: "readonly",72    Credential: "readonly",73    CredentialsContainer: "readonly",74    Crypto: "readonly",75    CryptoKey: "readonly",76    CustomElementRegistry: "readonly",77    CustomEvent: "readonly",78    DOMError: "readonly",79    DOMException: "readonly",80    DOMImplementation: "readonly",81    DOMMatrix: "readonly",82    DOMMatrixReadOnly: "readonly",83    DOMParser: "readonly",84    DOMPoint: "readonly",85    DOMPointReadOnly: "readonly",86    DOMQuad: "readonly",87    DOMRect: "readonly",88    DOMRectReadOnly: "readonly",89    DOMStringList: "readonly",90    DOMStringMap: "readonly",91    DOMTokenList: "readonly",92    DataTransfer: "readonly",93    DataTransferItem: "readonly",94    DataTransferItemList: "readonly",95    DelayNode: "readonly",96    DeviceMotionEvent: "readonly",97    DeviceOrientationEvent: "readonly",98    Document: "readonly",99    DocumentFragment: "readonly",100    DocumentType: "readonly",101    DragEvent: "readonly",102    DynamicsCompressorNode: "readonly",103    Element: "readonly",104    ErrorEvent: "readonly",105    Event: "readonly",106    EventSource: "readonly",107    EventTarget: "readonly",108    File: "readonly",109    FileList: "readonly",110    FileReader: "readonly",111    FocusEvent: "readonly",112    FontFace: "readonly",113    FontFaceSetLoadEvent: "readonly",114    FormData: "readonly",115    GainNode: "readonly",116    Gamepad: "readonly",117    GamepadButton: "readonly",118    GamepadEvent: "readonly",119    HTMLAllCollection: "readonly",120    HTMLAnchorElement: "readonly",121    HTMLAreaElement: "readonly",122    HTMLAudioElement: "readonly",123    HTMLBRElement: "readonly",124    HTMLBaseElement: "readonly",125    HTMLBodyElement: "readonly",126    HTMLButtonElement: "readonly",127    HTMLCanvasElement: "readonly",128    HTMLCollection: "readonly",129    HTMLContentElement: "readonly",130    HTMLDListElement: "readonly",131    HTMLDataElement: "readonly",132    HTMLDataListElement: "readonly",133    HTMLDetailsElement: "readonly",134    HTMLDialogElement: "readonly",135    HTMLDirectoryElement: "readonly",136    HTMLDivElement: "readonly",137    HTMLDocument: "readonly",138    HTMLElement: "readonly",139    HTMLEmbedElement: "readonly",140    HTMLFieldSetElement: "readonly",141    HTMLFontElement: "readonly",142    HTMLFormControlsCollection: "readonly",143    HTMLFormElement: "readonly",144    HTMLFrameElement: "readonly",145    HTMLFrameSetElement: "readonly",146    HTMLHRElement: "readonly",147    HTMLHeadElement: "readonly",148    HTMLHeadingElement: "readonly",149    HTMLHtmlElement: "readonly",150    HTMLIFrameElement: "readonly",151    HTMLImageElement: "readonly",152    HTMLInputElement: "readonly",153    HTMLLIElement: "readonly",154    HTMLLabelElement: "readonly",155    HTMLLegendElement: "readonly",156    HTMLLinkElement: "readonly",157    HTMLMapElement: "readonly",158    HTMLMarqueeElement: "readonly",159    HTMLMediaElement: "readonly",160    HTMLMenuElement: "readonly",161    HTMLMetaElement: "readonly",162    HTMLMeterElement: "readonly",163    HTMLModElement: "readonly",164    HTMLOListElement: "readonly",165    HTMLObjectElement: "readonly",166    HTMLOptGroupElement: "readonly",167    HTMLOptionElement: "readonly",168    HTMLOptionsCollection: "readonly",169    HTMLOutputElement: "readonly",170    HTMLParagraphElement: "readonly",171    HTMLParamElement: "readonly",172    HTMLPictureElement: "readonly",173    HTMLPreElement: "readonly",174    HTMLProgressElement: "readonly",175    HTMLQuoteElement: "readonly",176    HTMLScriptElement: "readonly",177    HTMLSelectElement: "readonly",178    HTMLShadowElement: "readonly",179    HTMLSlotElement: "readonly",180    HTMLSourceElement: "readonly",181    HTMLSpanElement: "readonly",182    HTMLStyleElement: "readonly",183    HTMLTableCaptionElement: "readonly",184    HTMLTableCellElement: "readonly",185    HTMLTableColElement: "readonly",186    HTMLTableElement: "readonly",187    HTMLTableRowElement: "readonly",188    HTMLTableSectionElement: "readonly",189    HTMLTemplateElement: "readonly",190    HTMLTextAreaElement: "readonly",191    HTMLTimeElement: "readonly",192    HTMLTitleElement: "readonly",193    HTMLTrackElement: "readonly",194    HTMLUListElement: "readonly",195    HTMLUnknownElement: "readonly",196    HTMLVideoElement: "readonly",197    HashChangeEvent: "readonly",198    Headers: "readonly",199    History: "readonly",200    IDBCursor: "readonly",201    IDBCursorWithValue: "readonly",202    IDBDatabase: "readonly",203    IDBFactory: "readonly",204    IDBIndex: "readonly",205    IDBKeyRange: "readonly",206    IDBObjectStore: "readonly",207    IDBOpenDBRequest: "readonly",208    IDBRequest: "readonly",209    IDBTransaction: "readonly",210    IDBVersionChangeEvent: "readonly",211    IIRFilterNode: "readonly",212    IdleDeadline: "readonly",213    Image: "readonly",214    ImageBitmap: "readonly",215    ImageBitmapRenderingContext: "readonly",216    ImageCapture: "readonly",217    ImageData: "readonly",218    InputEvent: "readonly",219    IntersectionObserver: "readonly",220    IntersectionObserverEntry: "readonly",221    Intl: "readonly",222    KeyboardEvent: "readonly",223    KeyframeEffect: "readonly",224    KeyframeEffectReadOnly: "readonly",225    Location: "readonly",226    MIDIAccess: "readonly",227    MIDIConnectionEvent: "readonly",228    MIDIInput: "readonly",229    MIDIInputMap: "readonly",230    MIDIMessageEvent: "readonly",231    MIDIOutput: "readonly",232    MIDIOutputMap: "readonly",233    MIDIPort: "readonly",234    MediaDeviceInfo: "readonly",235    MediaDevices: "readonly",236    MediaElementAudioSourceNode: "readonly",237    MediaEncryptedEvent: "readonly",238    MediaError: "readonly",239    MediaKeyMessageEvent: "readonly",240    MediaKeySession: "readonly",241    MediaKeyStatusMap: "readonly",242    MediaKeySystemAccess: "readonly",243    MediaList: "readonly",244    MediaQueryList: "readonly",245    MediaQueryListEvent: "readonly",246    MediaRecorder: "readonly",247    MediaSettingsRange: "readonly",248    MediaSource: "readonly",249    MediaStream: "readonly",250    MediaStreamAudioDestinationNode: "readonly",251    MediaStreamAudioSourceNode: "readonly",252    MediaStreamEvent: "readonly",253    MediaStreamTrack: "readonly",254    MediaStreamTrackEvent: "readonly",255    MessageChannel: "readonly",256    MessageEvent: "readonly",257    MessagePort: "readonly",258    MimeType: "readonly",259    MimeTypeArray: "readonly",260    MouseEvent: "readonly",261    MutationEvent: "readonly",262    MutationObserver: "readonly",263    MutationRecord: "readonly",264    NamedNodeMap: "readonly",265    NavigationPreloadManager: "readonly",266    Navigator: "readonly",267    NetworkInformation: "readonly",268    Node: "readonly",269    NodeFilter: "readonly",270    NodeIterator: "readonly",271    NodeList: "readonly",272    Notification: "readonly",273    OfflineAudioCompletionEvent: "readonly",274    OfflineAudioContext: "readonly",275    OffscreenCanvas: "writable",276    Option: "readonly",277    OscillatorNode: "readonly",278    PageTransitionEvent: "readonly",279    PannerNode: "readonly",280    Path2D: "readonly",281    PaymentAddress: "readonly",282    PaymentRequest: "readonly",283    PaymentRequestUpdateEvent: "readonly",284    PaymentResponse: "readonly",285    Performance: "readonly",286    PerformanceEntry: "readonly",287    PerformanceLongTaskTiming: "readonly",288    PerformanceMark: "readonly",289    PerformanceMeasure: "readonly",290    PerformanceNavigation: "readonly",291    PerformanceNavigationTiming: "readonly",292    PerformanceObserver: "readonly",293    PerformanceObserverEntryList: "readonly",294    PerformancePaintTiming: "readonly",295    PerformanceResourceTiming: "readonly",296    PerformanceTiming: "readonly",297    PeriodicWave: "readonly",298    PermissionStatus: "readonly",299    Permissions: "readonly",300    PhotoCapabilities: "readonly",301    Plugin: "readonly",302    PluginArray: "readonly",303    PointerEvent: "readonly",304    PopStateEvent: "readonly",305    Presentation: "readonly",306    PresentationAvailability: "readonly",307    PresentationConnection: "readonly",308    PresentationConnectionAvailableEvent: "readonly",309    PresentationConnectionCloseEvent: "readonly",310    PresentationConnectionList: "readonly",311    PresentationReceiver: "readonly",312    PresentationRequest: "readonly",313    ProcessingInstruction: "readonly",314    ProgressEvent: "readonly",315    PromiseRejectionEvent: "readonly",316    PushManager: "readonly",317    PushSubscription: "readonly",318    PushSubscriptionOptions: "readonly",319    RTCCertificate: "readonly",320    RTCDataChannel: "readonly",321    RTCDataChannelEvent: "readonly",322    RTCDtlsTransport: "readonly",323    RTCIceCandidate: "readonly",324    RTCIceGatherer: "readonly",325    RTCIceTransport: "readonly",326    RTCPeerConnection: "readonly",327    RTCPeerConnectionIceEvent: "readonly",328    RTCRtpContributingSource: "readonly",329    RTCRtpReceiver: "readonly",330    RTCRtpSender: "readonly",331    RTCSctpTransport: "readonly",332    RTCSessionDescription: "readonly",333    RTCStatsReport: "readonly",334    RTCTrackEvent: "readonly",335    RadioNodeList: "readonly",336    Range: "readonly",337    ReadableStream: "readonly",338    RemotePlayback: "readonly",339    Request: "readonly",340    ResizeObserver: "readonly",341    ResizeObserverEntry: "readonly",342    Response: "readonly",343    SVGAElement: "readonly",344    SVGAngle: "readonly",345    SVGAnimateElement: "readonly",346    SVGAnimateMotionElement: "readonly",347    SVGAnimateTransformElement: "readonly",348    SVGAnimatedAngle: "readonly",349    SVGAnimatedBoolean: "readonly",350    SVGAnimatedEnumeration: "readonly",351    SVGAnimatedInteger: "readonly",352    SVGAnimatedLength: "readonly",353    SVGAnimatedLengthList: "readonly",354    SVGAnimatedNumber: "readonly",355    SVGAnimatedNumberList: "readonly",356    SVGAnimatedPreserveAspectRatio: "readonly",357    SVGAnimatedRect: "readonly",358    SVGAnimatedString: "readonly",359    SVGAnimatedTransformList: "readonly",360    SVGAnimationElement: "readonly",361    SVGCircleElement: "readonly",362    SVGClipPathElement: "readonly",363    SVGComponentTransferFunctionElement: "readonly",364    SVGDefsElement: "readonly",365    SVGDescElement: "readonly",366    SVGDiscardElement: "readonly",367    SVGElement: "readonly",368    SVGEllipseElement: "readonly",369    SVGFEBlendElement: "readonly",370    SVGFEColorMatrixElement: "readonly",371    SVGFEComponentTransferElement: "readonly",372    SVGFECompositeElement: "readonly",373    SVGFEConvolveMatrixElement: "readonly",374    SVGFEDiffuseLightingElement: "readonly",375    SVGFEDisplacementMapElement: "readonly",376    SVGFEDistantLightElement: "readonly",377    SVGFEDropShadowElement: "readonly",378    SVGFEFloodElement: "readonly",379    SVGFEFuncAElement: "readonly",380    SVGFEFuncBElement: "readonly",381    SVGFEFuncGElement: "readonly",382    SVGFEFuncRElement: "readonly",383    SVGFEGaussianBlurElement: "readonly",384    SVGFEImageElement: "readonly",385    SVGFEMergeElement: "readonly",386    SVGFEMergeNodeElement: "readonly",387    SVGFEMorphologyElement: "readonly",388    SVGFEOffsetElement: "readonly",389    SVGFEPointLightElement: "readonly",390    SVGFESpecularLightingElement: "readonly",391    SVGFESpotLightElement: "readonly",392    SVGFETileElement: "readonly",393    SVGFETurbulenceElement: "readonly",394    SVGFilterElement: "readonly",395    SVGForeignObjectElement: "readonly",396    SVGGElement: "readonly",397    SVGGeometryElement: "readonly",398    SVGGradientElement: "readonly",399    SVGGraphicsElement: "readonly",400    SVGImageElement: "readonly",401    SVGLength: "readonly",402    SVGLengthList: "readonly",403    SVGLineElement: "readonly",404    SVGLinearGradientElement: "readonly",405    SVGMPathElement: "readonly",406    SVGMarkerElement: "readonly",407    SVGMaskElement: "readonly",408    SVGMatrix: "readonly",409    SVGMetadataElement: "readonly",410    SVGNumber: "readonly",411    SVGNumberList: "readonly",412    SVGPathElement: "readonly",413    SVGPatternElement: "readonly",414    SVGPoint: "readonly",415    SVGPointList: "readonly",416    SVGPolygonElement: "readonly",417    SVGPolylineElement: "readonly",418    SVGPreserveAspectRatio: "readonly",419    SVGRadialGradientElement: "readonly",420    SVGRect: "readonly",421    SVGRectElement: "readonly",422    SVGSVGElement: "readonly",423    SVGScriptElement: "readonly",424    SVGSetElement: "readonly",425    SVGStopElement: "readonly",426    SVGStringList: "readonly",427    SVGStyleElement: "readonly",428    SVGSwitchElement: "readonly",429    SVGSymbolElement: "readonly",430    SVGTSpanElement: "readonly",431    SVGTextContentElement: "readonly",432    SVGTextElement: "readonly",433    SVGTextPathElement: "readonly",434    SVGTextPositioningElement: "readonly",435    SVGTitleElement: "readonly",436    SVGTransform: "readonly",437    SVGTransformList: "readonly",438    SVGUnitTypes: "readonly",439    SVGUseElement: "readonly",440    SVGViewElement: "readonly",441    Screen: "readonly",442    ScreenOrientation: "readonly",443    ScriptProcessorNode: "readonly",444    SecurityPolicyViolationEvent: "readonly",445    Selection: "readonly",446    ServiceWorker: "readonly",447    ServiceWorkerContainer: "readonly",448    ServiceWorkerRegistration: "readonly",449    ShadowRoot: "readonly",450    SharedWorker: "readonly",451    SourceBuffer: "readonly",452    SourceBufferList: "readonly",453    SpeechSynthesisEvent: "readonly",454    SpeechSynthesisUtterance: "readonly",455    StaticRange: "readonly",456    StereoPannerNode: "readonly",457    Storage: "readonly",458    StorageEvent: "readonly",459    StorageManager: "readonly",460    StyleSheet: "readonly",461    StyleSheetList: "readonly",462    SubtleCrypto: "readonly",463    TaskAttributionTiming: "readonly",464    Text: "readonly",465    TextDecoder: "readonly",466    TextEncoder: "readonly",467    TextEvent: "readonly",468    TextMetrics: "readonly",469    TextTrack: "readonly",470    TextTrackCue: "readonly",471    TextTrackCueList: "readonly",472    TextTrackList: "readonly",473    TimeRanges: "readonly",474    Touch: "readonly",475    TouchEvent: "readonly",476    TouchList: "readonly",477    TrackEvent: "readonly",478    TransitionEvent: "readonly",479    TreeWalker: "readonly",480    UIEvent: "readonly",481    URL: "readonly",482    URLSearchParams: "readonly",483    VTTCue: "readonly",484    ValidityState: "readonly",485    VisualViewport: "readonly",486    WaveShaperNode: "readonly",487    WebAssembly: "readonly",488    WebGL2RenderingContext: "readonly",489    WebGLActiveInfo: "readonly",490    WebGLBuffer: "readonly",491    WebGLContextEvent: "readonly",492    WebGLFramebuffer: "readonly",493    WebGLProgram: "readonly",494    WebGLQuery: "readonly",495    WebGLRenderbuffer: "readonly",496    WebGLRenderingContext: "readonly",497    WebGLSampler: "readonly",498    WebGLShader: "readonly",499    WebGLShaderPrecisionFormat: "readonly",500    WebGLSync: "readonly",501    WebGLTexture: "readonly",502    WebGLTransformFeedback: "readonly",503    WebGLUniformLocation: "readonly",504    WebGLVertexArrayObject: "readonly",505    WebSocket: "readonly",506    WheelEvent: "readonly",507    Window: "readonly",508    Worker: "readonly",509    WritableStream: "readonly",510    XMLDocument: "readonly",511    XMLHttpRequest: "readonly",512    XMLHttpRequestEventTarget: "readonly",513    XMLHttpRequestUpload: "readonly",514    XMLSerializer: "readonly",515    XPathEvaluator: "readonly",516    XPathExpression: "readonly",517    XPathResult: "readonly",518    XSLTProcessor: "readonly",519    atob: "readonly",520    btoa: "readonly",521    cancelAnimationFrame: "readonly",522    document: "readonly",523    fetch: "readonly",524    indexedDB: "readonly",525    localStorage: "readonly",526    location: "writable",527    matchMedia: "readonly",528    navigator: "readonly",529    requestAnimationFrame: "readonly",530    sessionStorage: "readonly",531    window: "readonly",...tabs.spec.js
Source:tabs.spec.js  
1import reducer, {2  selectNamespace,3  createTab,4  closeTab,5  moveTab,6  nextTab,7  prevTab,8  selectTab,9  SELECT_NAMESPACE,10  SELECT_TAB,11  MOVE_TAB,12  NEXT_TAB,13  PREV_TAB,14  CREATE_TAB,15  CLOSE_TAB16} from 'modules/tabs';17describe('tabs module', () => {18  describe('#selectNamespace', () => {19    it('returns the SELECT_NAMESPACE action', () => {20      expect(selectNamespace('t', 'db.coll', true, 'db.test', 'db.view', {})).to.deep.equal({21        type: SELECT_NAMESPACE,22        id: 't',23        namespace: 'db.coll',24        isReadonly: true,25        sourceName: 'db.test',26        editViewName: 'db.view',27        sourceReadonly: undefined,28        sourceViewOn: undefined,29        context: {}30      });31    });32  });33  describe('#createTab', () => {34    it('returns the CREATE_TAB action', () => {35      expect(36        createTab('id', 'db.coll', true, 'db.test', 'db.view', {})37      ).to.deep.equal({38        id: 'id',39        type: CREATE_TAB,40        namespace: 'db.coll',41        isReadonly: true,42        sourceName: 'db.test',43        editViewName: 'db.view',44        sourceReadonly: undefined,45        sourceViewOn: undefined,46        context: {}47      });48    });49  });50  describe('#selectTab', () => {51    it('returns the SELECT_TAB action', () => {52      expect(selectTab(1)).to.deep.equal({53        type: SELECT_TAB,54        index: 155      });56    });57  });58  describe('#moveTab', () => {59    it('returns the MOVE action', () => {60      expect(moveTab(1, 7)).to.deep.equal({61        type: MOVE_TAB,62        fromIndex: 1,63        toIndex: 764      });65    });66  });67  describe('#nextTab', () => {68    it('returns the NEXT_TAB action', () => {69      expect(nextTab()).to.deep.equal({70        type: NEXT_TAB71      });72    });73  });74  describe('#prevTab', () => {75    it('returns the PREV_TAB action', () => {76      expect(prevTab()).to.deep.equal({77        type: PREV_TAB78      });79    });80  });81  describe('#closeTab', () => {82    it('returns the CLOSE_TAB action', () => {83      expect(closeTab(1)).to.deep.equal({84        type: CLOSE_TAB,85        index: 186      });87    });88  });89  describe('#reducer', () => {90    context('when the action is not found', () => {91      it('returns the default state', () => {92        expect(reducer(undefined, { type: 'test' })).to.deep.equal([]);93      });94    });95    context('when the action is namespace selected', () => {96      context.skip('when no tabs exist', () => {97        let state;98        const namespace = 'db.coll';99        before(() => {100          state = reducer(undefined, selectNamespace(namespace, true));101        });102        it('creates a new tab with the namespace', () => {103          expect(state[0].namespace).to.equal(namespace);104        });105        it('sets the tab to active', () => {106          expect(state[0].isActive).to.equal(true);107        });108        it('sets the tab readonly value', () => {109          expect(state[0].isReadonly).to.equal(true);110        });111        it('does not add additional tabs', () => {112          expect(state.length).to.equal(1);113        });114      });115      context.skip('when one tab exists', () => {116        let state;117        const namespace = 'db.coll';118        const existingState = [119          { namespace: 'db.coll1', isActive: true, isReadonly: false }120        ];121        before(() => {122          state = reducer(existingState, selectNamespace(namespace, true));123        });124        it('sets the new namespace on the tab', () => {125          expect(state[0].namespace).to.equal(namespace);126        });127        it('keeps the tab as active', () => {128          expect(state[0].isActive).to.equal(true);129        });130        it('sets the tab readonly value', () => {131          expect(state[0].isReadonly).to.equal(true);132        });133        it('does not add additional tabs', () => {134          expect(state.length).to.equal(1);135        });136      });137      context.skip('when multiple tabs exist', () => {138        let state;139        const namespace = 'db.coll';140        const existingState = [141          { namespace: 'db.coll1', isActive: false, isReadonly: false },142          { namespace: 'db.coll2', isActive: true, isReadonly: false },143          { namespace: 'db.coll3', isActive: false, isReadonly: false }144        ];145        before(() => {146          state = reducer(existingState, selectNamespace(namespace, true));147        });148        it('sets the new namespace on the tab', () => {149          expect(state[1].namespace).to.equal(namespace);150        });151        it('keeps the tab as active', () => {152          expect(state[1].isActive).to.equal(true);153        });154        it('sets the tab readonly value', () => {155          expect(state[1].isReadonly).to.equal(true);156        });157        it('does not add additional tabs', () => {158          expect(state.length).to.equal(3);159        });160      });161    });162    context('when the action is create tab', () => {163      context.skip('when no tabs exist', () => {164        let state;165        const namespace = 'db.coll';166        const store = {};167        before(() => {168          state = reducer(undefined, createTab(namespace, true, store));169        });170        it('creates a new tab with the namespace', () => {171          expect(state[0].namespace).to.equal(namespace);172        });173        it('sets the tab to active', () => {174          expect(state[0].isActive).to.equal(true);175        });176        it('sets the tab readonly value', () => {177          expect(state[0].isReadonly).to.equal(true);178        });179        it('sets the store on the tab', () => {180          expect(state[0].store).to.equal(store);181        });182        it('adds additional tabs', () => {183          expect(state.length).to.equal(1);184        });185      });186      context.skip('when one tab exists', () => {187        let state;188        const namespace = 'db.coll';189        const existingState = [190          { namespace: 'db.coll1', isActive: true, isReadonly: false }191        ];192        before(() => {193          state = reducer(existingState, createTab(namespace, true));194        });195        it('sets the new namespace on the new tab', () => {196          expect(state[1].namespace).to.equal(namespace);197        });198        it('sets the new tab as active', () => {199          expect(state[1].isActive).to.equal(true);200        });201        it('sets the other tab as inactive', () => {202          expect(state[0].isActive).to.equal(false);203        });204        it('sets the tab readonly value', () => {205          expect(state[1].isReadonly).to.equal(true);206        });207        it('adds additional tabs', () => {208          expect(state.length).to.equal(2);209        });210      });211      context.skip('when multiple tabs exist', () => {212        let state;213        const namespace = 'db.coll';214        const existingState = [215          { namespace: 'db.coll1', isActive: true, isReadonly: false },216          { namespace: 'db.coll2', isActive: false, isReadonly: false }217        ];218        before(() => {219          state = reducer(existingState, createTab(namespace, true));220        });221        it('sets the new namespace on the new tab', () => {222          expect(state[2].namespace).to.equal(namespace);223        });224        it('sets the new tab as active', () => {225          expect(state[2].isActive).to.equal(true);226        });227        it('sets the tab readonly value', () => {228          expect(state[2].isReadonly).to.equal(true);229        });230        it('adds additional tabs', () => {231          expect(state.length).to.equal(3);232        });233      });234    });235    context('when the action is select tab', () => {236      context('when one tab exists', () => {237        let state;238        const existingState = [239          { namespace: 'db.coll1', isActive: true, isReadonly: false }240        ];241        before(() => {242          state = reducer(existingState, selectTab(0));243        });244        it('does not change the active state', () => {245          expect(state[0].isActive).to.equal(true);246        });247        it('does not add additional tabs', () => {248          expect(state.length).to.equal(1);249        });250      });251      context('when multiple tabs exist', () => {252        let state;253        const existingState = [254          { namespace: 'db.coll1', isActive: true, isReadonly: false },255          { namespace: 'db.coll1', isActive: false, isReadonly: false },256          { namespace: 'db.coll1', isActive: false, isReadonly: false }257        ];258        before(() => {259          state = reducer(existingState, selectTab(1));260        });261        it('it activates the selected tab', () => {262          expect(state[1].isActive).to.equal(true);263        });264        it('deactivates the other tabs', () => {265          expect(state[0].isActive).to.equal(false);266          expect(state[2].isActive).to.equal(false);267        });268        it('does not add additional tabs', () => {269          expect(state.length).to.equal(3);270        });271      });272    });273    context('when the action is move tab', () => {274      context('when moving forward', () => {275        let state;276        const existingState = [277          { namespace: 'db.coll1', isActive: true, isReadonly: false },278          { namespace: 'db.coll2', isActive: false, isReadonly: false },279          { namespace: 'db.coll3', isActive: false, isReadonly: false }280        ];281        before(() => {282          state = reducer(existingState, moveTab(0, 2));283        });284        it('it reorders the tabs', () => {285          expect(state[0].namespace).to.equal('db.coll2');286          expect(state[1].namespace).to.equal('db.coll3');287          expect(state[2].namespace).to.equal('db.coll1');288        });289      });290      context('when moving backwards', () => {291        let state;292        const existingState = [293          { namespace: 'db.coll1', isActive: true, isReadonly: false },294          { namespace: 'db.coll2', isActive: false, isReadonly: false },295          { namespace: 'db.coll3', isActive: false, isReadonly: false }296        ];297        before(() => {298          state = reducer(existingState, moveTab(2, 1));299        });300        it('reorders the tabs', () => {301          expect(state[0].namespace).to.equal('db.coll1');302          expect(state[1].namespace).to.equal('db.coll3');303          expect(state[2].namespace).to.equal('db.coll2');304        });305      });306    });307    context('when the action is prev tab', () => {308      context('when the tab is not the first tab', () => {309        let state;310        const existingState = [311          { namespace: 'db.coll1', isActive: false, isReadonly: false },312          { namespace: 'db.coll2', isActive: true, isReadonly: false },313          { namespace: 'db.coll3', isActive: false, isReadonly: false }314        ];315        before(() => {316          state = reducer(existingState, prevTab());317        });318        it('activates the prev tab', () => {319          expect(state[0].isActive).to.equal(true);320        });321        it('deactivates the old tab', () => {322          expect(state[1].isActive).to.equal(false);323        });324      });325      context('when the tab is the first tab', () => {326        let state;327        const existingState = [328          { namespace: 'db.coll1', isActive: true, isReadonly: false },329          { namespace: 'db.coll2', isActive: false, isReadonly: false },330          { namespace: 'db.coll3', isActive: false, isReadonly: false }331        ];332        before(() => {333          state = reducer(existingState, prevTab());334        });335        it('activates the last tab', () => {336          expect(state[2].isActive).to.equal(true);337        });338        it('deactivates the old tab', () => {339          expect(state[0].isActive).to.equal(false);340        });341      });342    });343    context('when the action is next tab', () => {344      context('when the tab is not the last tab', () => {345        let state;346        const existingState = [347          { namespace: 'db.coll1', isActive: true, isReadonly: false },348          { namespace: 'db.coll2', isActive: false, isReadonly: false },349          { namespace: 'db.coll3', isActive: false, isReadonly: false }350        ];351        before(() => {352          state = reducer(existingState, nextTab());353        });354        it('activates the next tab', () => {355          expect(state[1].isActive).to.equal(true);356        });357        it('deactivates the old tab', () => {358          expect(state[0].isActive).to.equal(false);359        });360      });361      context('when the tab is the last tab', () => {362        let state;363        const existingState = [364          { namespace: 'db.coll1', isActive: false, isReadonly: false },365          { namespace: 'db.coll2', isActive: false, isReadonly: false },366          { namespace: 'db.coll3', isActive: true, isReadonly: false }367        ];368        before(() => {369          state = reducer(existingState, nextTab());370        });371        it('activates the first tab', () => {372          expect(state[0].isActive).to.equal(true);373        });374        it('deactivates the old tab', () => {375          expect(state[2].isActive).to.equal(false);376        });377      });378    });379    context('when the action is close tab', () => {380      context('when one tab exists', () => {381        let state;382        const existingState = [383          { namespace: 'db.coll1', isActive: true, isReadonly: false }384        ];385        before(() => {386          state = reducer(existingState, closeTab(0));387        });388        it('removes the tab', () => {389          expect(state.length).to.equal(0);390        });391      });392      context('when multiple tabs exist', () => {393        context('when the tab being removed is active', () => {394          context('when there is a tab after it', () => {395            let state;396            const existingState = [397              { namespace: 'db.coll1', isActive: true, isReadonly: false },398              { namespace: 'db.coll2', isActive: false, isReadonly: false },399              { namespace: 'db.coll3', isActive: false, isReadonly: false }400            ];401            before(() => {402              state = reducer(existingState, closeTab(0));403            });404            it('removes the tab', () => {405              expect(state.length).to.equal(2);406            });407            it('makes the next tab active', () => {408              expect(state[0].isActive).to.equal(true);409              expect(state[0].namespace).to.equal('db.coll2');410            });411          });412          context('when there is no tab after it', () => {413            let state;414            const existingState = [415              { namespace: 'db.coll1', isActive: false, isReadonly: false },416              { namespace: 'db.coll2', isActive: false, isReadonly: false },417              { namespace: 'db.coll3', isActive: true, isReadonly: false }418            ];419            before(() => {420              state = reducer(existingState, closeTab(2));421            });422            it('removes the tab', () => {423              expect(state.length).to.equal(2);424            });425            it('makes the previous tab active', () => {426              expect(state[1].isActive).to.equal(true);427              expect(state[1].namespace).to.equal('db.coll2');428            });429          });430        });431        context('when the tab being removed is not active', () => {432          let state;433          const existingState = [434            { namespace: 'db.coll1', isActive: false, isReadonly: false },435            { namespace: 'db.coll2', isActive: false, isReadonly: false },436            { namespace: 'db.coll3', isActive: true, isReadonly: false }437          ];438          before(() => {439            state = reducer(existingState, closeTab(1));440          });441          it('removes the tab', () => {442            expect(state.length).to.equal(2);443          });444          it('does not change active state', () => {445            expect(state[1].isActive).to.equal(true);446          });447        });448      });449    });450  });451  describe('#preCreateTab', () => {452    context('when there are no filtered roles', () => {453    });454  });...ncels-analyse-expert.js
Source:ncels-analyse-expert.js  
1function exportProtocol(id) {2    window.open('/DrugAnalitic/ExportProtocol?id=' + id);3}4function chekcInProtocol(control) {5    $(control).change(function () {6        var controlId = $(this).attr('id');7        var fieldValue = $(this).prop('checked');8        var row = $(this).closest('tr');9        var tbody = $(row).closest('tbody').attr('id');10        var entityId=null;11        if (row != null) {12            entityId = row.attr('id');13        }14        $.ajax({15            type: "POST",16            url: "/DrugAnalitic/CheckInProtocol",17            data: { 'entityId': entityId, 'fieldValue': fieldValue },18            dataType: 'json',19            cache: false,20            success: function (data) {21                var exist = false;22                $(".protocol-row").each(function () {23                    if ($(this).attr('rowId') === entityId) {24                        exist = true;25                        if (!fieldValue) {26                            $('#' + $(this).attr('Id')).hide();27                        } else {28                            $('#' + $(this).attr('Id')).show();29                        }30                        return;31                    }32                });33                if (exist) {34                    return;35                }36                var rowId = entityId + "rowId";37                var nameRu = entityId + "_NameRu1";38                var temperature = entityId + "_Temperature1";39                var humidity = entityId + "_Humidity1";40                var designation = entityId + "_Designation1";41                var demand = entityId + "_Demand1";42                var actualResult = entityId + "_ActualResult1";43                var tbodyName = tbody + "1";44                var cols = '<tr rowId="' + entityId + '" class="protocol-row"  id="' + rowId + '">';45                cols += '<td><input type="text" readonly="readonly" id="' + nameRu + '"  class="form-control" value="' + $("#" + entityId + "_NameRu").val() + '"/></td>';46                cols += '<td><input type="text" readonly="readonly" id="' + temperature + '"  class="form-control" value="' + $("#" + entityId + "_Temperature").val() + '"/></td>';47                cols += '<td><input type="text" readonly="readonly" id="' + humidity + '"  class="form-control" value="' + $("#" + entityId + "_Humidity").val() + '"/></td>';48                cols += '<td><input type="text" readonly="readonly" id="' + demand + '"  class="form-control growed" value="' + $("#" + entityId + "_Demand").val() + '"/></td>';49                cols += '<td><input type="text" readonly="readonly" id="' + actualResult + '"  class="form-control growed" value="' + $("#" + entityId + "_ActualResult").val() + '"/></td>';50                cols += '</tr>';51                $('#' + tbodyName).append(cols);52            },53            error: function (data) {54                alert("1Error" + data);55            }56        });57    });58}59function cloneAnaliseDosage(dosageId) {60    var success = function () {61        $.ajax({62            type: "POST",63            url: "/DrugAnalitic/CloneAnaliseDosage",64            data: { 'dosageId': dosageId },65            dataType: 'json',66            cache: false,67            success: function (data) {68            },69            error: function (data) {70                alert("1Error" + data);71            }72        });73    }74    var cancel = function () {75    };76    showConfirmation("ÐодÑвеÑждение", "ÐÑ ÑвеÑÐµÐ½Ñ ÑÑо Ñ
оÑиÑе пÑимениÑÑ Ð´Ð°Ð½Ð½Ð¾Ðµ заклÑÑение и Ð´Ð»Ñ Ð´ÑÑгиÑ
 заÑвок?", success, cancel);77}78function removeAnalyseInidcator(modelId) {79    $.ajax({80        type: "POST",81        url: "/DrugAnalitic/DeleteIndicator",82        data: { 'id': modelId },83        dataType: 'json',84        cache: false,85        success: function (data) {86        },87        error: function (data) {88            alert("1Error" + data);89        }90    });91}92function showAnalyseDialog(id, stageId, readonly) {93    var temperatureTemp = "#" + stageId + "_Temperature";94    var humidityTemp = "#" + stageId + "_Humidity";95    var designationTemp = "#" + stageId + "_Designation";96    var demandTemp = "#" + stageId + "_Demand";97    var actualResultTemp = "#" + stageId + "_ActualResult";98    var analyseIndicator = "#" + "AnalyseIndicatorList" + stageId;99    var isMatches = "#" + "Booleans" + stageId;100    var exampleModal = "#" + stageId + "exampleModal";101    $(exampleModal).attr('currentId', id);102    $(temperatureTemp).prop("readonly", readonly);103    $(humidityTemp).prop("readonly", readonly);104    $(designationTemp).prop("readonly", readonly);105    $(demandTemp).prop("readonly", readonly);106    $(actualResultTemp).prop("readonly", readonly);107  108    var submit = "#" + stageId + "_submit";109    if (readonly) {110        $(analyseIndicator).attr('disabled', 'disabled');111        $(isMatches).attr('disabled', 'disabled');112        $(submit).hide();113    } else {114        $(analyseIndicator).removeAttr('disabled');115        $(isMatches).removeAttr('disabled');116        $(submit).show();117    }118    $.ajax({119        type: "POST",120        url: "/DrugAnalitic/GetIndicator",121        data: { 'id': id },122        dataType: 'json',123        cache: false,124        success: function (data) {125            $(temperatureTemp).val(data.Temperature);126            $(humidityTemp).val(data.Humidity);127            $(designationTemp).val(data.Designation);128            $(demandTemp).val(data.Demand);129            $(actualResultTemp).val(data.ActualResult);130            $(analyseIndicator).val(data.AnalyseIndicator);131            $(isMatches).val(data.IsMatches);132            $(exampleModal).modal();133        },134        error: function (data) {135            alert("1Error" + data);136        }137    }); 138}139function submitAnalyseIndicator(stageId,tbody) {140    var temperatureTemp = "#" + stageId + "_Temperature";141    var humidityTemp = "#" + stageId + "_Humidity";142    var designationTemp = "#" + stageId + "_Designation";143    var demandTemp = "#" + stageId + "_Demand";144    var actualResultTemp = "#" + stageId + "_ActualResult";145    var exampleModal = "#" + stageId + "exampleModal";146    var id = $(exampleModal).attr('currentId');147    var analyseIndicator = "#" + "AnalyseIndicatorList" + stageId;148    var isMatches = "#" + "Booleans" + stageId;149    $.ajax({150        type: "POST",151        url: "/DrugAnalitic/SaveOrUpdateIndicator",152        data: {'stageId':stageId, 'id': id, 'temperature': $(temperatureTemp).val(), 'humidity': $(humidityTemp).val(), 'designation': $(designationTemp).val(), 'demand': $(demandTemp).val(), 'actualResult': $(actualResultTemp).val(), 'analyseIndicator': $(analyseIndicator).val(), 'isMatches': $(isMatches).val() },153        dataType: 'json',154        cache: false,155        success: function (data) {156            $(exampleModal).attr('currentId', data.modelId);157            var nameRu = data.modelId + "_NameRu";158            var temperature = data.modelId + "_Temperature";159            var humidity = data.modelId + "_Humidity";160            var designation = data.modelId + "_Designation";161            var demand = data.modelId + "_Demand";162            var actualResult = data.modelId + "_ActualResult";163            var inProtocol = data.modelId + "_InProtocol";164            var isMatchesStr = data.modelId + "_IsMatchesStr";165            debugger;166            if (data.isNew) {167                var cols = '<tr id="' + data.modelId + '">';168                cols += '<td>'+ data.PositionNumber + '</td>';169                cols += '<td><input type="text" readonly="readonly" id="' + nameRu + '"  class="form-control" value="' + data.AnalyseIndicatorName + '"/></td>';170                cols += '<td><input type="text" readonly="readonly" id="' + temperature + '"  class="form-control" value="' + $(temperatureTemp).val() + '"/></td>';171                cols += '<td><input type="text" readonly="readonly" id="' + humidity + '"  class="form-control" value="' + $(humidityTemp).val() + '"/></td>';172                cols += '<td><input type="text" readonly="readonly" id="' + designation + '"  class="form-control" value="' + $(designationTemp).val() + '"/></td>';173                cols += '<td><input type="text" readonly="readonly" id="' + demand + '"  class="form-control" value="' + $(demandTemp).val() + '"/></td>';174                cols += '<td><input type="text" readonly="readonly" id="' + actualResult + '"  class="form-control" value="' + $(actualResultTemp).val() + '"/></td>';175                cols += '<td><input type="text" readonly="readonly" id="' + isMatchesStr + '"  class="form-control" value="' + data.IsMatchesStr + '"/></td>';176                cols += '<td><input class="form-control" data-val="true" data-val-required="The InProtocol field is required." id="' + data.modelId + '_InProtocol" name="ExpDrugAnaliseIndicators[0].InProtocol" type="checkbox" value="true"></td>';177                cols +=178                    '<td><div class="btn-group" style="float: right; margin-right: 10px; color: white; text-align: left"><button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">ÐпеÑаÑии <span class="caret"></span></button>' +179                    '<ul class="dropdown-menu btnmenu"><li class="btn-info">' +180                    '<a href="#" class="link-object" onclick="showAnalyseDialog(' +181                    data.modelId +182                    ',' +183                    stageId +184                    ',true)" style="color: white; padding: 5px"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> ÐÑоÑмоÑÑ</a></li>' +185                    '<li class="btn-warning edit-li"><a href="#" class="editExpRow" onclick="showAnalyseDialog(' + data.modelId + ',' + stageId +186                    ',false)" class="link-object" style="color: white; padding: 5px"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span> РедакÑиÑоваÑÑ</a> </li>' +187                    '<li class="btn-danger edit-li"><a href="#" class="deleteExpRow" style="color: white; padding: 5px"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> УдалиÑÑ</a></li></ul></div></td>';188                cols += '</tr>';189                $('#' + tbody).append(cols);190                var rowId1 = data.modelId + "rowId";191                var nameRu1 = data.modelId + "_NameRu1";192                var temperature1 = data.modelId + "_Temperature1";193                var humidity1 = data.modelId + "_Humidity1";194                var designation1 = data.modelId + "_Designation1";195                var demand1 = data.modelId + "_Demand1";196                var actualResult1 = data.modelId + "_ActualResult1";197                var tbodyName1 = tbody + "1";198                var cols1 = '<tr rowId="' + data.modelId + '" class="protocol-row"  id="' + rowId1 + '">';199                cols1 += '<td><input type="text" readonly="readonly" id="' + nameRu1 + '"  class="form-control" value="' + data.AnalyseIndicatorName + '"/></td>';200                cols1 += '<td><input type="text" readonly="readonly" id="' + temperature1 + '"  class="form-control" value="' + $(temperatureTemp).val() + '"/></td>';201                cols1 += '<td><input type="text" readonly="readonly" id="' + humidity1 + '"  class="form-control" value="' + $(humidityTemp).val() + '"/></td>';202                cols1 += '<td><input type="text" readonly="readonly" id="' + demand1 + '"  class="form-control growed" value="' + $(demandTemp).val() + '"/></td>';203                cols1 += '<td><input type="text" readonly="readonly" id="' + actualResult1 + '"  class="form-control growed" value="' + $(actualResultTemp).val() + '"/></td>';204                cols1 += '</tr>';205                $('#' + tbodyName1).append(cols1);206            } else {207                $("#" + nameRu).val(data.AnalyseIndicatorName);208                $("#" + temperature).val($(temperatureTemp).val());209                $("#" + humidity).val($(humidityTemp).val());210                $("#" + designation).val($(designationTemp).val());211                $("#" + demand).val($(demandTemp).val());212                $("#" + actualResult).val($(actualResultTemp).val());213                $("#" + isMatchesStr).val(data.IsMatchesStr);214            }215            $(exampleModal).modal('hide');216            217        },218        error: function (data) {219            alert("1Error" + data);220        }221    });...editRule.js
Source:editRule.js  
1/*! 2* WeX5 v3 (http://www.justep.com) 3* Copyright 2015 Justep, Inc.4* Licensed under Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) 5*/ 6define(function(require) {7	var $ = require("jquery");8	//var justep = require('$UI/system/lib/justep');9	//var XML = require("$UI/system/lib/base/xml");10	var xuiService = require("$UI/system/components/designerCommon/js/xuiService");11	121314	var Model = function() {15		/*16ruleXID17readonly_XID18readonly_expr_XID1920col_fString_XID21col_fString_required_XID22col_fString_required_expr_XID23col_fString_required_message_XID2425col_fInteger_constraint_XID26col_fInteger_constraint_expr_XID27col_fInteger_constraint_message_XID2829col_fInteger_readonly_XID30col_fInteger_readonly_expr_XID3132col_fInteger_calculate_XID33col_fInteger_calculate_expr_XID34		 */35		this.xids = {};36		this.callParent();37	};3839//	Model.prototype.def2xml = function() {40//		var self = this, data = this.comp('data'), rule = '<rule '+(this.xids['ruleXID']?('xid="'+this.xids['ruleXID']+'"'):'')+'>';41//		var dataReadonly = this.comp('dataReadonly').val();42//		if (dataReadonly) {// dataçåªè¯»è§å43//			rule += ('<readonly '+(this.xids['readonly_XID']?('xid="'+this.xids['readonly_XID']+'"'):'')+'><expr '+(this.xids['readonly_expr_XID']?('xid="'+this.xids['readonly_expr_XID']+'"'):'')+'><![CDATA[' + dataReadonly + ']]></expr></readonly>');44//		}45//		data46//				.each(function(param) {47//					var colXml = '', hasDef = false, colName = data.getValue('name', param.row);48//					colXml += '<col '+(self.xids['col_'+colName+'_XID']?('xid="'+self.xids['col_'+colName+'_XID']+'"'):'')+' name="' + colName + '">';49//					if (data.getValue('readonly', param.row)) {50//						colXml += ('<readonly '+(self.xids['col_'+colName+'_readonly_XID']?('xid="'+self.xids['col_'+colName+'_readonly_XID']+'"'):'')+'><expr '+(self.xids['col_'+colName+'_readonly_expr_XID']?('xid="'+self.xids['col_'+colName+'_readonly_expr_XID']+'"'):'')+'><![CDATA[' + data.getValue('readonly', param.row) + ']]></expr></readonly>');51//						hasDef = true;52//					}53//					if (data.getValue('calculate', param.row)) {54//						colXml += ('<calculate '+(self.xids['col_'+colName+'_calculate_XID']?('xid="'+self.xids['col_'+colName+'_calculate_XID']+'"'):'')+'><expr '+(self.xids['col_'+colName+'_calculate_expr_XID']?('xid="'+self.xids['col_'+colName+'_calculate_expr_XID']+'"'):'')+'><![CDATA[' + data.getValue('calculate', param.row) + ']]></expr></calculate>');55//						hasDef = true;56//					}57//					if (data.getValue('required', param.row)) {58//						colXml += ('<required '+(self.xids['col_'+colName+'_required_XID']?('xid="'+self.xids['col_'+colName+'_required_XID']+'"'):'')+'><expr '+(self.xids['col_'+colName+'_required_expr_XID']?('xid="'+self.xids['col_'+colName+'_required_expr_XID']+'"'):'')+'><![CDATA['59//								+ data.getValue('required', param.row) + ']]></expr><message '+(self.xids['col_'+colName+'_required_message_XID']?('xid="'+self.xids['col_'+colName+'_required_message_XID']+'"'):'')+'><![CDATA['60//								+ (data.getValue('requiredMessage', param.row) ? data.getValue('requiredMessage', param.row) : '') + ']]></message></required>');61//						hasDef = true;62//					}63//					if (data.getValue('constraint', param.row)) {64//						colXml += ('<constraint '+(self.xids['col_'+colName+'_constraint_XID']?('xid="'+self.xids['col_'+colName+'_constraint_XID']+'"'):'')+'><expr '+(self.xids['col_'+colName+'_constraint_expr_XID']?('xid="'+self.xids['col_'+colName+'_constraint_expr_XID']+'"'):'')+'><![CDATA['65//								+ data.getValue('constraint', param.row) + ']]></expr><message '+(self.xids['col_'+colName+'_constraint_message_XID']?('xid="'+self.xids['col_'+colName+'_constraint_message_XID']+'"'):'')+'><![CDATA['66//								+ (data.getValue('constraintMessage', param.row) ? data.getValue('constraintMessage', param.row) : '') + ']]></message></constraint>');67//						hasDef = true;68//					}69//					colXml += '</col>';70//					if (hasDef)71//						rule += colXml;72//				});73//		return rule + '</rule>';74//	};7576	/**77	 * è·åè¿åå¼ï¼ç¹å»ç¡®å®åè°ç¨çæ¹æ³,å¿
é¡»æ¯ä¸ä¸ªjsonæ ¼å¼çæ°æ® .78	 */79	Model.prototype.getReturnValue = function() {80		var v = this.comp('dataReadonly').val();81		this.xmlModel.setValue("readonly>expr",v);82		return {83			def : this.xmlModel.asXml()//this.def2xml()84		};85	};8687	Model.prototype.init = function() {88		var self = this;89		var initData = xuiService.getPageParams();// è·åä¼ å
¥çåæ°90		var cols = initData.cols;91		self.cols2data(cols);92		93		var binding = {94		"readonly":"readonly>expr",95		"calculate":"calculate>expr",96		"required":"required>expr",97		"requiredMessage":"required>message",98		"constraint":"constraint>expr",99		"constraintMessage":"constraint>message"};//dataåä¸èç¹ä¹é´çæ å°100		101		var config = {xmlData:initData.xml, //xmlå符串102				rootPath:"rule", //æ ¹èç¹è·¯å¾103				rowIdPath:"@name", //è¡idè·¯å¾ 104				rowNodePath:"col", //è¡èç¹è·¯å¾105				data:this.comp("data"), //data对象106				binding:binding};107		this.xmlModel = xuiService.createXmlModel(config);//å建xml模å108 109		this.comp('dataReadonly').val(this.xmlModel.getValue("readonly>expr"));110		111	//	var ruleDef = self.xml2def(initData.xml);// åå§å屿§å¼112		113	};114115	Model.prototype.cols2data = function(cols, ruleDef) {116//		this.comp('dataReadonly').val(ruleDef['readonly'].expr);117		if ($.isArray(cols)) {118			var defaultValues = [];119			for ( var i = 0; i < cols.length; i++) {120				var o = {121					name : cols[i]['alias'],122					type : cols[i]['data-type'],123					displayName : cols[i]['label']124				};125//				var colRuleDef = ruleDef.col[o.name];126//				if (colRuleDef) {127//					o.readonly = colRuleDef.readonly.expr;128//					o.calculate = colRuleDef.calculate.expr;129//					o.required = colRuleDef.required.expr;130//					o.requiredMessage = colRuleDef.required.message;131//					o.constraint = colRuleDef.constraint.expr;132//					o.constraintMessage = colRuleDef.constraint.message;133//				}134				defaultValues.push(o);135			}136137			var data = this.comp('data');138			data.newData({139				defaultValues : defaultValues140			});141			data.first();142		}143	};144145//	Model.prototype.xml2def = function(xmlStr) {146//		if (xmlStr) {147//			var ruleDef = {148//				readonly : {},149//				col : {}150//			};151//			/*152//			ruleXID153//			readonly_XID154//			readonly_expr_XID155//156//			col_fString_XID157//			col_fString_required_XID158//			col_fString_required_expr_XID159//			col_fString_required_message_XID160//161//			col_fInteger_constraint_XID162//			col_fInteger_constraint_expr_XID163//			col_fInteger_constraint_message_XID164//165//			col_fInteger_readonly_XID166//			col_fInteger_readonly_expr_XID167//168//			col_fInteger_calculate_XID169//			col_fInteger_calculate_expr_XID170//					this.xids = {};171//					 */172//			var $data = $(XML.fromString(xmlStr).documentElement), $rule = $data.children('rule'), self = this;173//			this.xids['ruleXID'] = $rule.attr('xid');174//			var $ruleReadonly = $rule.children('readonly');175//			this.xids['readonly_XID'] = $ruleReadonly.attr('xid');176//			var $ruleReadonlyExpr = $ruleReadonly.children('expr');177//			this.xids['readonly_expr_XID'] = $ruleReadonlyExpr.attr('xid');178//			ruleDef['readonly'].expr = $.trim($ruleReadonlyExpr.text());179//			$rule.children('col').each(function() {180//				var $col = $(this), def = {};181//				if ($col.attr('name')) {182//					var colName = $col.attr('name');183//					self.xids['col_'+colName+'_XID'] = $col.attr('xid');184//					185//					var $colReadonly = $col.children('readonly');186//					self.xids['col_'+colName+'_readonly_XID'] = $colReadonly.attr('xid');187//					var $colReadonlyExpr = $colReadonly.children('expr');188//					self.xids['col_'+colName+'_readonly_expr_XID'] = $colReadonlyExpr.attr('xid');189//					def['readonly'] = {190//						expr : $.trim($colReadonlyExpr.text())191//					};192//193//					var $colcalculate = $col.children('calculate');194//					self.xids['col_'+colName+'_calculate_XID'] = $colcalculate.attr('xid');195//					var $colcalculateExpr = $colcalculate.children('expr');196//					self.xids['col_'+colName+'_calculate_expr_XID'] = $colcalculateExpr.attr('xid');197//					def['calculate'] = {198//						expr : $.trim($colcalculateExpr.text())199//					};200//201//					var $colrequired = $col.children('required');202//					self.xids['col_'+colName+'_required_XID'] = $colrequired.attr('xid');203//					var $colrequiredExpr = $colrequired.children('expr');204//					self.xids['col_'+colName+'_required_expr_XID'] = $colrequiredExpr.attr('xid');205//					var $colrequiredMessage = $colrequired.children('message');206//					self.xids['col_'+colName+'_required_message_XID'] = $colrequiredMessage.attr('xid');207//					def['required'] = {208//						expr : $.trim($colrequiredExpr.text()),209//						message : $.trim($colrequiredMessage.text())210//					};211//212//					var $colconstraint = $col.children('constraint');213//					self.xids['col_'+colName+'_constraint_XID'] = $colconstraint.attr('xid');214//					var $colconstraintExpr = $colconstraint.children('expr');215//					self.xids['col_'+colName+'_constraint_expr_XID'] = $colconstraintExpr.attr('xid');216//					var $colconstraintMessage = $colconstraint.children('message');217//					self.xids['col_'+colName+'_constraint_message_XID'] = $colconstraintMessage.attr('xid');218//					def['constraint'] = {219//						expr : $.trim($colconstraintExpr.text()),220//						message : $.trim($colconstraintMessage.text())221//					};222//					ruleDef.col[$col.attr('name')] = def;223//				}224//			});225//			return ruleDef;226//		}227//	};228229	Model.prototype.modelLoad = function(event) {230		this.init();231	};232	233	/**234	 * æå¼è¡¨è¾¾å¼ç¼è¾å¨.235     */236		Model.prototype.openExpressionEditor = function(currentProp){237			var comp = this.comp("data");238			xuiService.openEditor("jSExpressionEditor", {value : comp.getValue(currentProp),propValue : comp.getValue(currentProp),propName:"dataColRule"}, function(result) {239				comp.setValue(currentProp, result.value);240			});241		};242		243		Model.prototype.readonlyExprClick = function(event) {244			this.openExpressionEditor("readonly");245		};246	247		Model.prototype.calculateExprClick = function(event){248			this.openExpressionEditor("calculate");249		};250	251		Model.prototype.requiredExprClick = function(event){252			this.openExpressionEditor("required");253		};254	255		Model.prototype.constraintExprClick = function(event){256			this.openExpressionEditor("constraint");257		};258	259		Model.prototype.dataReadonlyExprClick = function(event){260			var comp = this.comp("dataReadonly");261			xuiService.openEditor("jSExpressionEditor", {value : comp.val(),propValue : comp.val(),propName:"dataRule"}, function(result) {262				comp.val(result.value);263			});264		};265266267	return Model;
...collection-header.spec.js
Source:collection-header.spec.js  
1import React from 'react';2import { mount } from 'enzyme';3import CollectionHeader from 'components/collection-header';4import styles from './collection-header.less';5describe('CollectionHeader [Component]', () => {6  const statsPlugin = () => { return (<div/>); };7  context('when the collection is not readonly', () => {8    let component;9    const statsStore = {};10    const selectOrCreateTabSpy = sinon.spy();11    const sourceReadonly = false;12    beforeEach(() => {13      component = mount(14        <CollectionHeader15          isReadonly={false}16          globalAppRegistry={{}}17          statsPlugin={statsPlugin}18          statsStore={statsStore}19          namespace="db.coll"20          selectOrCreateTab={selectOrCreateTabSpy}21          sourceReadonly={sourceReadonly} />22      );23    });24    afterEach(() => {25      component = null;26    });27    it('renders the correct root classname', () => {28      expect(component.find(`.${styles['collection-header']}`)).to.be.present();29    });30    it('renders the db name', () => {31      expect(component.find(`.${styles['collection-header-title-db']}`)).to.have.text('db');32    });33    it('renders the collection name', () => {34      expect(component.find(`.${styles['collection-header-title-collection']}`)).to.have.text('coll');35    });36  });37  context('when the collection is readonly', () => {38    let component;39    const statsStore = {};40    const selectOrCreateTabSpy = sinon.spy();41    const sourceReadonly = false;42    beforeEach(() => {43      component = mount(44        <CollectionHeader45          isReadonly46          globalAppRegistry={{}}47          sourceName="orig.coll"48          statsPlugin={statsPlugin}49          statsStore={statsStore}50          namespace="db.coll"51          selectOrCreateTab={selectOrCreateTabSpy}52          sourceReadonly={sourceReadonly} />53      );54    });55    afterEach(() => {56      component = null;57    });58    it('renders the correct root classname', () => {59      expect(component.find(`.${styles['collection-header']}`)).to.be.present();60    });61    it('renders the db name', () => {62      expect(component.find(`.${styles['collection-header-title-db']}`)).63        to.have.text('db');64    });65    it('renders the collection name', () => {66      expect(component.find(`.${styles['collection-header-title-collection']}`)).67        to.have.text('coll');68    });69    it('renders the source collection', () => {70      expect(component.find(`.${styles['collection-header-title-readonly-on']}`)).71        to.have.text('(view on: orig.coll)');72    });73    it('renders the readonly icon', () => {74      expect(component.find('.fa-eye')).to.be.present();75    });76  });77  context('when the collection is readonly but not a view', () => {78    let component;79    const statsStore = {};80    const selectOrCreateTabSpy = sinon.spy();81    const sourceName = null;82    const sourceReadonly = false;83    beforeEach(() => {84      component = mount(85        <CollectionHeader86          isReadonly87          sourceName={sourceName}88          statsPlugin={statsPlugin}89          statsStore={statsStore}90          namespace="db.coll"91          selectOrCreateTab={selectOrCreateTabSpy}92          sourceReadonly={sourceReadonly} />93      );94    });95    afterEach(() => {96      component = null;97    });98    it('does not the source collection', () => {99      expect(component.find(`.${styles['collection-header-title-readonly-on']}`)).100        to.be.empty;101    });102    it('renders the readonly icon', () => {103      expect(component.find('.fa-eye')).to.be.present();104    });105  });106  context('when the db name is clicked', () => {107    it('emits the open event to the app registry', () => {108      const statsStore = {};109      const selectOrCreateTabSpy = sinon.spy();110      const sourceReadonly = false;111      let emmittedEventName;112      let emmittedDbName;113      const component = mount(114        <CollectionHeader115          isReadonly={false}116          globalAppRegistry={{117            emit: (eventName, dbName) => {118              emmittedEventName = eventName;119              emmittedDbName = dbName;120            }121          }}122          sourceName="orig.coll"123          statsPlugin={statsPlugin}124          statsStore={statsStore}125          namespace="db.coll"126          selectOrCreateTab={selectOrCreateTabSpy}127          sourceReadonly={sourceReadonly} />128      );129      expect(component.find(`.${styles['collection-header-title-db']}`)).to.be.present();130      component.find(`.${styles['collection-header-title-db']}`).simulate('click');131      expect(emmittedEventName).to.equal('select-database');132      expect(emmittedDbName).to.equal('db');133    });134  });...readonly.js
Source:readonly.js  
1if (this.importScripts) {2    importScripts('../../../fast/js/resources/js-test-pre.js');3    importScripts('shared.js');4}5description("Test IndexedDB readonly properties");6function setReadonlyProperty(property, value)7{8    oldValue = eval(property);9    debug("trying to set readonly property " + property);10    evalAndLog(property + " = " + value);11    newValue = eval(property);12    if (oldValue == newValue) {13        testPassed(property + " is still " + oldValue);14    } else {15        testFailed(property + " value was changed");16    }17}18function test()19{20    removeVendorPrefixes();21    name = "foo";22    request = evalAndLog("indexedDB.open(name)");23    request.onsuccess = openSuccess;24    request.onerror = unexpectedErrorCallback;25}26function openSuccess()27{28    setReadonlyProperty("request.result", "Infinity");29    setReadonlyProperty("request.errorCode", "666");30    setReadonlyProperty("request.source", "this");31    setReadonlyProperty("request.transaction", "this");32    setReadonlyProperty("request.readyState", "666");33    db = evalAndLog("db = event.target.result");34    setReadonlyProperty("db.name", "'bar'");35    request = evalAndLog("request = db.setVersion('1')");36    request.onsuccess = createAndPopulateObjectStore;37    request.onerror = unexpectedErrorCallback;38}39function createAndPopulateObjectStore()40{41    transaction = evalAndLog("transaction = event.target.result;");42    setReadonlyProperty("transaction.mode", "666");43    setReadonlyProperty("transaction.db", "this");44    deleteAllObjectStores(db);45    objectStore = evalAndLog("objectStore = db.createObjectStore('foo');");46    setReadonlyProperty("objectStore.name", "'bar'");47    setReadonlyProperty("objectStore.keyPath", "'bar'");48/* fails, split into separate test49    setReadonlyProperty("objectStore.indexNames", "['bar']");50*/51/* fails, split into separate test52    setReadonlyProperty("objectStore.transaction", "this");53*/54    result = evalAndLog("result = objectStore.add({}, 'first');");55    result.onerror = unexpectedErrorCallback;56    result.onsuccess = addSuccess;57}58function addSuccess()59{60    result = evalAndLog("result = objectStore.openCursor();");61    result.onerror = unexpectedErrorCallback;62    result.onsuccess = checkCursor;63}64function checkCursor()65{66    cursor = evalAndLog("cursor = event.target.result;");67    if (cursor) {68        setReadonlyProperty("cursor.source", "this");69        setReadonlyProperty("cursor.direction", "666");70        setReadonlyProperty("cursor.key", "Infinity");71        setReadonlyProperty("cursor.primaryKey", "Infinity");72    } else {73        testFailed("cursor is null");74    }75    index = evalAndLog("index = objectStore.createIndex('first', 'first');");76    setReadonlyProperty("index.name", "'bar'");77    setReadonlyProperty("index.objectStore", "this");78    setReadonlyProperty("index.keyPath", "'bar'");79    setReadonlyProperty("index.unique", "true");80    keyRange = IDBKeyRange.only("first");81    setReadonlyProperty("keyRange.lower", "Infinity");82    setReadonlyProperty("keyRange.upper", "Infinity");83    setReadonlyProperty("keyRange.lowerOpen", "true");84    setReadonlyProperty("keyRange.upperOpen", "true");85    finishJSTest();86}...auto-import-eslint-config.js
Source:auto-import-eslint-config.js  
1module.exports = {2    globals: {3        // lifecycle4        onActivated: 'readonly',5        onBeforeMount: 'readonly',6        onBeforeUnmount: 'readonly',7        onBeforeUpdate: 'readonly',8        onDeactivated: 'readonly',9        onErrorCaptured: 'readonly',10        onMounted: 'readonly',11        onServerPrefetch: 'readonly',12        onUnmounted: 'readonly',13        onUpdated: 'readonly',14        // reactivity15        computed: 'readonly',16        customRef: 'readonly',17        isReadonly: 'readonly',18        isRef: 'readonly',19        markRaw: 'readonly',20        reactive: 'readonly',21        readonly: 'readonly',22        ref: 'readonly',23        shallowReactive: 'readonly',24        shallowReadonly: 'readonly',25        shallowRef: 'readonly',26        toRaw: 'readonly',27        toRef: 'readonly',28        toRefs: 'readonly',29        triggerRef: 'readonly',30        unref: 'readonly',31        watch: 'readonly',32        watchEffect: 'readonly',33        // component34        defineComponent: 'readonly',35        defineAsyncComponent: 'readonly',36        getCurrentInstance: 'readonly',37        h: 'readonly',38        inject: 'readonly',39        nextTick: 'readonly',40        provide: 'readonly',41        useCssModule: 'readonly',42        // other43        defineProps: 'readonly',44        defineEmits: 'readonly',45        defineExpose: 'readonly',46        withDefaults: 'readonly',47        // vue-router48        useRoute: 'readonly',49        useRouter: 'readonly'50    }...Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3  const browser = await chromium.launch({ headless: false });4  const context = await browser.newContext();5  const page = await context.newPage();6  await page.screenshot({ path: 'google.png', fullPage: true });7  await browser.close();8})();9const { chromium } = require('playwright');10(async () => {11  const browser = await chromium.launch({ headless: false });12  const context = await browser.newContext();13  const page = await context.newPage();14  await page.screenshot({ path: 'google.png', fullPage: true });15  await browser.close();16})();17const { chromium } = require('playwright');18const browser = await chromium.launch({ headless: false });19const context = await browser.newContext();20const page = await context.newPage();21await page.screenshot({ path: 'google.png', fullPage: true });22await browser.close();23const browser = await chromium.launch({ headless: false });24const context = await browser.newContext();25const page = await context.newPage();Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3  const browser = await chromium.launch();4  const context = await browser.newContext();5  const page = await context.newPage();6  const value = await page.context().evaluate(() => {7    return window.playwright.readonly;8  });9  console.log(value);10  await browser.close();11})();12const {chromium} = require('playwright');13(async () => {14  const browser = await chromium.launch();15  const context = await browser.newContext();16  const page = await context.newPage();17  const value = await page.context().evaluate(() => {18    return window.playwright.readonly;19  });20  console.log(value);21  await browser.close();22})();23const {chromium} = require('playwright');24(async () => {25  const browser = await chromium.launch();26  const context = await browser.newContext();27  const page = await context.newPage();28  const value = await page.context().evaluate(() => {29    return window.playwright.readonly;30  });31  console.log(value);32  await browser.close();33})();34const {chromium} = require('playwright');35(async () => {36  const browser = await chromium.launch();37  const context = await browser.newContext();38  const page = await context.newPage();39  const value = await page.context().evaluate(() => {40    return window.playwright.readonly;41  });42  console.log(value);43  await browser.close();44})();45const {chromium} = require('playwright');46(async () => {47  const browser = await chromium.launch();48  const context = await browser.newContext();49  const page = await context.newPage();50  const value = await page.context().evaluate(() => {51    return window.playwright.readonly;52  });53  console.log(value);Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3  const browser = await chromium.launch();4  const context = await browser.newContext();5  const page = await context.newPage();6  const title = await page.evaluate(() => document.title);7  console.log(title);8  await browser.close();9})();Using AI Code Generation
1const { chromium, webkit, firefox } = require('playwright');2(async () => {3  const browser = await chromium.launch();4  const context = await browser.newContext();5  const page = await context.newPage();6  await page.screenshot({ path: 'example.png' });7  await browser.close();8})();9const { chromium, webkit, firefox } = require('playwright');10(async () => {11  const browser = await chromium.launch();12  const context = await browser.newContext();13  const page = await context.newPage();14  await page.screenshot({ path: 'example.png' });15  await browser.close();16})();17const { chromium, webkit, firefox } = require('playwright');18(async () => {19  const browser = await chromium.launch();20  const context = await browser.newContext();21  const page = await context.newPage();22  await page.screenshot({ path: 'example.png' });23  await browser.close();24})();25const { chromium, webkit, firefox } = require('playwright');26(async () => {27  const browser = await chromium.launch();28  const context = await browser.newContext();29  const page = await context.newPage();30  await page.screenshot({ path: 'example.png' });31  await browser.close();32})();33const { chromium, webkit, firefox } = require('playwright');34(async () => {35  const browser = await chromium.launch();36  const context = await browser.newContext();37  const page = await context.newPage();38  await page.screenshot({ path: 'example.png' });39  await browser.close();40})();41const { chromium, webkit, firefox } = require('playwright');42(async () => {43  const browser = await chromium.launch();Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3  const browser = await chromium.launch({ headless: false });4  const context = await browser.newContext({ ignoreHTTPSErrors: true });5  const page = await context.newPage();6  await page.screenshot({ path: `example.png` });7  await browser.close();8})();9const { chromium } = require('playwright');10(async () => {11  const browser = await chromium.launch({ headless: false });12  const context = await browser.newContext({ ignoreHTTPSErrors: true });13  const page = await context.newPage();14  await page.screenshot({ path: `example.png` });15  await browser.close();16})();17const { chromium } = require('playwright');18(async () => {19  const browser = await chromium.launch({ headless: false });20  const context = await browser.newContext({ ignoreHTTPSErrors: true });21  const page = await context.newPage();22  await page.screenshot({ path: `example.png` });23  await browser.close();24})();25const { chromium } = require('playwright');26(async () => {27  const browser = await chromium.launch({ headless: false });28  const context = await browser.newContext({ ignoreHTTPSErrors: true });29  const page = await context.newPage();30  await page.screenshot({ path: `example.png` });31  await browser.close();32})();33const { chromium } = require('playwright');34(async () => {35  const browser = await chromium.launch({ headless: false });36  const context = await browser.newContext({ ignoreHTTPSErrors: true });37  const page = await context.newPage();38  await page.screenshot({ path: `example.png` });39  await browser.close();40})();Using AI Code Generation
1const playwright = require('playwright-internal');2(async () => {3    const browser = await playwright.chromium.launch({headless: false});4    const context = await browser.newContext();5    const page = await context.newPage();6    await page.fill('input[name="q"]', 'Playwright');7    await page.click('input[value="Google Search"]');8    await page.waitForLoadState('networkidle');9    await page.screenshot({ path: 'screenshot.png' });10    await browser.close();11})();12const playwright = require('playwright');13(async () => {14    const browser = await playwright.chromium.launch({headless: false});15    const context = await browser.newContext();16    const page = await context.newPage();17    await page.fill('input[name="q"]', 'Playwright');18    await page.click('input[value="Google Search"]');19    await page.waitForLoadState('networkidle');20    await page.screenshot({ path: 'screenshot.png' });21    await browser.close();22})();23const playwright = require('playwright-internal');24(async () => {25    const browser = await playwright.chromium.launch({headless: false});26    const context = await browser.newContext();27    const page = await context.newPage();28    await page.fill('input[name="q"]', 'Playwright');29    await page.click('input[value="Google Search"]');30    await page.waitForLoadState('networkidle');31    await page.screenshot({ path: 'screenshot.png' });32    await browser.close();33})();34const playwright = require('playwright');35(async () => {36    const browser = await playwright.chromium.launch({headless: false});37    const context = await browser.newContext();38    const page = await context.newPage();39    await page.fill('input[name="q"]', 'Playwright');40    await page.click('input[value="Google Search"]');41    await page.waitForLoadState('networkidle');42    await page.screenshot({ path: 'screenshot.png' });Using AI Code Generation
1const playwright = require('playwright');2(async () => {3  const browser = await playwright.chromium.launch();4  const page = await browser.newPage();5  await page.screenshot({ path: 'example.png' });6  await browser.close();7})();Using AI Code Generation
1const internal = require('@playwright/test').internal;2const { chromium } = require('playwright');3(async () => {4  const browser = await chromium.launch();5  const context = await browser.newContext();6  const page = await context.newPage();7  const readonlyPage = internal.readonly(page);8  await readonlyPage.screenshot({ path: 'readonly.png' });9  await browser.close();10})();Using AI Code Generation
1const { chromium } = require('playwright');2const { setReadOnly, getReadOnly } = require('playwright/lib/server/chromium/crBrowser');3(async () => {4  const browser = await chromium.launch();5  const context = await browser.newContext();6  const page = await context.newPage();7  await setReadOnly(page, true);8  const readonly = await getReadOnly(page);9  console.log("readonly", readonly);10  await page.screenshot({ path: `example.png` });11  await browser.close();12})();LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!
