Best JavaScript code snippet using testcafe
tools_app.js
Source:tools_app.js  
...271            ],272        });273    }274    videoDetail = () => {275        this.closeWindow();276    }277    showModifyVideo = video => {278        const {title, describe} = video;279        this.setState({280            showModifyVideoWindow: true,281            argsGroup: [282                {label: "è§é¢æ é¢", key: "title", val: title},283                {label: "æè¿°", key: "describe", val: describe, type: "multiline"},284            ],285            instance: video,286        });287    }288    modifyVideo = (value) => {289        const that = this;290        const {instance} = this.state;291        Object.assign(instance, value)292        Req({293            method: "POST",294            url: "/backend/aip/video",295            data: instance296        }).then(() => {297            that.renderVideoList();298        });299        this.closeWindow();300    }301    showDeleteVideo = video => {302        const {id, title} = video;303        this.setState({304            showDeleteVideoWindow: true,305            argsGroup: [],306            msg: "ç¡®è®¤ä¸æ¶è§é¢ " + title,307            instance: id,308        })309    }310    deleteVideo = () => {311        const that = this;312        const {instance} = this.state;313        Req({314            method: "DELETE",315            url: "/backend/aip/video?id=" + instance,316        }).then(() => {317            that.renderVideoList();318        });319        this.closeWindow();320    }321    render = () => {322        const {323            showScanWindow = false,324            showNewVideoWindow = false,325            showVideoDetailWindow = false,326            showModifyVideoWindow = false,327            showDeleteVideoWindow = false,328            argsGroup = [],329            viewContentHTML = "",330            pageComponentHTML = "",331            msg = ""332        } = this.state;333        return (...liff-starter - Copy.js
Source:liff-starter - Copy.js  
...17        });18    });19    // closeWindow call20    document.getElementById('closewindowbutton').addEventListener('click', function () {21        liff.closeWindow();22    });23    // sendMessages call24    document.getElementById('sendmessagebutton').addEventListener('click', function () {25        liff.sendMessages([{26            type: 'text',27            text: "ยิà¸à¹à¸à¸ª1"28        29        }]).then(function () {30            liff.closeWindow();31        }).catch(function (error) {32            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);33        });34    });35    // sendMessages call36    document.getElementById('sendmessagebutton2').addEventListener('click', function () {37        liff.sendMessages([{38            type: 'text',39            text: "ยิà¸à¹à¸à¸ª2"40        41        }]).then(function () {42            liff.closeWindow();43        }).catch(function (error) {44            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);45        });46    });47    // sendMessages call48    document.getElementById('sendmessagebutton3').addEventListener('click', function () {49        liff.sendMessages([{50            type: 'text',51            text: "ยิà¸à¹à¸à¸ª3"52        53        }]).then(function () {54            liff.closeWindow();55        }).catch(function (error) {56            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);57        });58    });59    // sendMessages call60    document.getElementById('sendmessagebutton4').addEventListener('click', function () {61        liff.sendMessages([{62            type: 'text',63            text: "ยิà¸à¸à¸¥à¸¸à¹à¸¡1"64        65        }]).then(function () {66            liff.closeWindow();67        }).catch(function (error) {68            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);69        });70    });71    // sendMessages call72    document.getElementById('sendmessagebutton5').addEventListener('click', function () {73        liff.sendMessages([{74            type: 'text',75            text: "ยิà¸à¸à¸¥à¸¸à¹à¸¡2"76        77        }]).then(function () {78            liff.closeWindow();79        }).catch(function (error) {80            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);81        });82    });83    // sendMessages call84    document.getElementById('sendmessagebutton6').addEventListener('click', function () {85        liff.sendMessages([{86            type: 'text',87            text: "ยิà¸à¸à¸¥à¸¸à¹à¸¡3"88        89        }]).then(function () {90            liff.closeWindow();91        }).catch(function (error) {92            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);93        });94    });95    // sendMessages call96    document.getElementById('sendmessagebutton7').addEventListener('click', function () {97        liff.sendMessages([{98            type: 'text',99            text: "/à¹à¸¡à¹à¹à¸à¸à¸à¸µà¹1"100        101        }]).then(function () {102            liff.closeWindow();103        }).catch(function (error) {104            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);105        });106    });107    // sendMessages call108    document.getElementById('sendmessagebutton8').addEventListener('click', function () {109        liff.sendMessages([{110            type: 'text',111            text: "/à¹à¸¡à¹à¹à¸à¸à¸à¸µà¹2"112        113        }]).then(function () {114            liff.closeWindow();115        }).catch(function (error) {116            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);117        });118    });119    // sendMessages call120    document.getElementById('sendmessagebutton9').addEventListener('click', function () {121        liff.sendMessages([{122            type: 'text',123            text: "/à¹à¸¡à¹à¹à¸à¸à¸à¸µà¹3"124        125        }]).then(function () {126            liff.closeWindow();127        }).catch(function (error) {128            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);129        });130    });131    // sendMessages call132    document.getElementById('sendmessagebutton10').addEventListener('click', function () {133        liff.sendMessages([{134            type: 'text',135            text: "ยิà¸à¹à¸à¸·à¹à¸à¸"136        137        }]).then(function () {138            liff.closeWindow();139        }).catch(function (error) {140            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);141        });142    });143    // sendMessages call144    document.getElementById('sendmessagebutton11').addEventListener('click', function () {145        liff.sendMessages([{146            type: 'text',147            text: "à¸à¸£à¸°à¸à¸²à¸¨à¹à¸à¸·à¹à¸à¸"148        149        }]).then(function () {150            liff.closeWindow();151        }).catch(function (error) {152            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);153        });154    });155    // sendMessages call156    document.getElementById('sendmessagebutton12').addEventListener('click', function () {157        liff.sendMessages([{158            type: 'text',159            text: "à¸à¸£à¸°à¸à¸²à¸¨à¸à¸²à¸¢à¸3"160        161        }]).then(function () {162            liff.closeWindow();163        }).catch(function (error) {164            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);165        });166    });167    // sendMessages call168    document.getElementById('sendmessagebutton13').addEventListener('click', function () {169        liff.sendMessages([{170            type: 'text',171            text: "à¸à¸²à¸¢à¸ªà¸´à¸à¸à¹à¸²"172        173        }]).then(function () {174            liff.closeWindow();175        }).catch(function (error) {176            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);177        });178    });179    // sendMessages call180    document.getElementById('sendmessagebutton14').addEventListener('click', function () {181        liff.sendMessages([{182            type: 'text',183            text: "à¸à¸£à¸°à¸à¸²à¸¨à¸à¸¥à¸¸à¹à¸¡2"184        185        }]).then(function () {186            liff.closeWindow();187        }).catch(function (error) {188            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);189        });190    });191    // sendMessages call192    document.getElementById('sendmessagebutton15').addEventListener('click', function () {193        liff.sendMessages([{194            type: 'text',195            text: "à¸à¸£à¸°à¸à¸²à¸¨à¸à¸¥à¸¸à¹à¸¡3"196        197        }]).then(function () {198            liff.closeWindow();199        }).catch(function (error) {200            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);201        });202    });203    // sendMessages call204    document.getElementById('sendmessagebutton16').addEventListener('click', function () {205        liff.sendMessages([{206            type: 'text',207            text: "/à¹à¸¡à¹à¹à¸à¸à¸ªà¹à¸¥à¸à¸µà¹1"208        209        }]).then(function () {210            liff.closeWindow();211        }).catch(function (error) {212            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);213        });214    });215    // sendMessages call216    document.getElementById('sendmessagebutton17').addEventListener('click', function () {217        liff.sendMessages([{218            type: 'text',219            text: "/à¹à¸¡à¹à¹à¸à¸à¸ªà¹à¸¥à¸à¸µà¹2"220        221        }]).then(function () {222            liff.closeWindow();223        }).catch(function (error) {224            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);225        });226    });227    // sendMessages call228    document.getElementById('sendmessagebutton18').addEventListener('click', function () {229        liff.sendMessages([{230            type: 'text',231            text: "/à¹à¸¡à¹à¹à¸à¸à¸ªà¹à¸¥à¸à¸µà¹3"232        233        }]).then(function () {234            liff.closeWindow();235        }).catch(function (error) {236            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);237        });238    });239    // sendMessages call240    document.getElementById('sendmessagebutton19').addEventListener('click', function () {241        liff.sendMessages([{242            type: 'text',243            text: "ยิà¸à¸£à¸¹à¸1"244        245        }]).then(function () {246            liff.closeWindow();247        }).catch(function (error) {248            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);249        });250    });251    // sendMessages call252    document.getElementById('sendmessagebutton20').addEventListener('click', function () {253        liff.sendMessages([{254            type: 'text',255            text: "ยิà¸à¸£à¸¹à¸2"256        257        }]).then(function () {258            liff.closeWindow();259        }).catch(function (error) {260            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);261        });262    });263    // sendMessages call264    document.getElementById('sendmessagebutton21').addEventListener('click', function () {265        liff.sendMessages([{266            type: 'text',267            text: "ยิà¸à¸£à¸¹à¸3"268        269        }]).then(function () {270            liff.closeWindow();271        }).catch(function (error) {272            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);273        });274    });275    // sendMessages call276    document.getElementById('sendmessagebutton22').addEventListener('click', function () {277        liff.sendMessages([{278            type: 'text',279            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡1"280        281        }]).then(function () {282            liff.closeWindow();283        }).catch(function (error) {284            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);285        });286    });287    // sendMessages call288    document.getElementById('sendmessagebutton23').addEventListener('click', function () {289        liff.sendMessages([{290            type: 'text',291            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡2"292        293        }]).then(function () {294            liff.closeWindow();295        }).catch(function (error) {296            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);297        });298    });299     // sendMessages call300    document.getElementById('sendmessagebutton24').addEventListener('click', function () {301        liff.sendMessages([{302            type: 'text',303            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡3"304        305        }]).then(function () {306            liff.closeWindow();307        }).catch(function (error) {308            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);309        });310    });311    // sendMessages call312    document.getElementById('sendmessagebutton25').addEventListener('click', function () {313        liff.sendMessages([{314            type: 'text',315            text: "/à¹à¸¡à¹à¹à¸à¸à¸£à¸¹à¸1"316        317        }]).then(function () {318            liff.closeWindow();319        }).catch(function (error) {320            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);321        });322    });323    // sendMessages call324    document.getElementById('sendmessagebutton26').addEventListener('click', function () {325        liff.sendMessages([{326            type: 'text',327            text: "/à¹à¸¡à¹à¹à¸à¸à¸£à¸¹à¸2"328        329        }]).then(function () {330            liff.closeWindow();331        }).catch(function (error) {332            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);333        });334    });335    // sendMessages call336    document.getElementById('sendmessagebutton27').addEventListener('click', function () {337        liff.sendMessages([{338            type: 'text',339            text: "/à¹à¸¡à¹à¹à¸à¸à¸£à¸¹à¸3"340        341        }]).then(function () {342            liff.closeWindow();343        }).catch(function (error) {344            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);345        });346    });347     // sendMessages call348    document.getElementById('sendmessagebutton28').addEventListener('click', function () {349        liff.sendMessages([{350            type: 'text',351            text: "ยิà¸01"352        353        }]).then(function () {354            liff.closeWindow();355        }).catch(function (error) {356            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);357        });358    });359    // sendMessages call360    document.getElementById('sendmessagebutton29').addEventListener('click', function () {361        liff.sendMessages([{362            type: 'text',363            text: "ยิà¸02"364        365        }]).then(function () {366            liff.closeWindow();367        }).catch(function (error) {368            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);369        });370    });371    // sendMessages call372    document.getElementById('sendmessagebutton30').addEventListener('click', function () {373        liff.sendMessages([{374            type: 'text',375            text: "ยิà¸03"376        377        }]).then(function () {378            liff.closeWindow();379        }).catch(function (error) {380            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);381        });382    });383    // sendMessages call384    document.getElementById('sendmessagebutton31').addEventListener('click', function () {385        liff.sendMessages([{386            type: 'text',387            text: "สูà¹à¸à¸¥à¸¸à¹à¸¡01"388        389        }]).then(function () {390            liff.closeWindow();391        }).catch(function (error) {392            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);393        });394    });395    // sendMessages call396    document.getElementById('sendmessagebutton32').addEventListener('click', function () {397        liff.sendMessages([{398            type: 'text',399            text: "สูà¹à¸à¸¥à¸¸à¹à¸¡02"400        401        }]).then(function () {402            liff.closeWindow();403        }).catch(function (error) {404            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);405        });406    });407    // sendMessages call408    document.getElementById('sendmessagebutton33').addEventListener('click', function () {409        liff.sendMessages([{410            type: 'text',411            text: "สูà¹à¸à¸¥à¸¸à¹à¸¡03"412        413        }]).then(function () {414            liff.closeWindow();415        }).catch(function (error) {416            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);417        });418    });419    // sendMessages call420    document.getElementById('sendmessagebutton34').addEventListener('click', function () {421        liff.sendMessages([{422            type: 'text',423            text: "/à¹à¸¡à¹à¹à¸à¸à¹à¸«à¸¡à¹1"424        425        }]).then(function () {426            liff.closeWindow();427        }).catch(function (error) {428            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);429        });430    });431    // sendMessages call432    document.getElementById('sendmessagebutton35').addEventListener('click', function () {433        liff.sendMessages([{434            type: 'text',435            text: "/à¹à¸¡à¹à¹à¸à¸à¹à¸«à¸¡à¹2"436        437        }]).then(function () {438            liff.closeWindow();439        }).catch(function (error) {440            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);441        });442    });443    // sendMessages call444    document.getElementById('sendmessagebutton36').addEventListener('click', function () {445        liff.sendMessages([{446            type: 'text',447            text: "/à¹à¸¡à¹à¹à¸à¸à¹à¸«à¸¡à¹3"448        449        }]).then(function () {450            liff.closeWindow();451        }).catch(function (error) {452            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);453        });454    });455    // sendMessages call456    document.getElementById('sendmessagebutton37').addEventListener('click', function () {457        liff.sendMessages([{458            type: 'text',459            text: "ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥1"460        461        }]).then(function () {462            liff.closeWindow();463        }).catch(function (error) {464            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);465        });466    });467    // sendMessages call468    document.getElementById('sendmessagebutton38').addEventListener('click', function () {469        liff.sendMessages([{470            type: 'text',471            text: "ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥2"472        473        }]).then(function () {474            liff.closeWindow();475        }).catch(function (error) {476            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);477        });478    });479    // sendMessages call480    document.getElementById('sendmessagebutton39').addEventListener('click', function () {481        liff.sendMessages([{482            type: 'text',483            text: "ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥3"484        485        }]).then(function () {486            liff.closeWindow();487        }).catch(function (error) {488            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);489        });490    });491    // sendMessages call492    document.getElementById('sendmessagebutton40').addEventListener('click', function () {493        liff.sendMessages([{494            type: 'text',495            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¹à¸¥1"496        497        }]).then(function () {498            liff.closeWindow();499        }).catch(function (error) {500            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);501        });502    });503    // sendMessages call504    document.getElementById('sendmessagebutton41').addEventListener('click', function () {505        liff.sendMessages([{506            type: 'text',507            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¹à¸¥2"508        509        }]).then(function () {510            liff.closeWindow();511        }).catch(function (error) {512            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);513        });514    });515    // sendMessages call516    document.getElementById('sendmessagebutton42').addEventListener('click', function () {517        liff.sendMessages([{518            type: 'text',519            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¹à¸¥3"520        521        }]).then(function () {522            liff.closeWindow();523        }).catch(function (error) {524            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);525        });526    });527    // sendMessages call528    document.getElementById('sendmessagebutton43').addEventListener('click', function () {529        liff.sendMessages([{530            type: 'text',531            text: "/ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥1"532        533        }]).then(function () {534            liff.closeWindow();535        }).catch(function (error) {536            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);537        });538    });539     // sendMessages call540    document.getElementById('sendmessagebutton44').addEventListener('click', function () {541        liff.sendMessages([{542            type: 'text',543            text: "/ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥2"544        545        }]).then(function () {546            liff.closeWindow();547        }).catch(function (error) {548            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);549        });550    });551    // sendMessages call552    document.getElementById('sendmessagebutton45').addEventListener('click', function () {553        liff.sendMessages([{554            type: 'text',555            text: "/ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥3"556        557        }]).then(function () {558            liff.closeWindow();559        }).catch(function (error) {560            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);561        });562    });563    // get access token564    document.getElementById('getaccesstoken').addEventListener('click', function () {565        const accessToken = liff.getAccessToken();566        document.getElementById('accesstokenfield').textContent = accessToken;567        toggleAccessToken();568    });569    // get profile call570    document.getElementById('getprofilebutton').addEventListener('click', function () {571        liff.getProfile().then(function (profile) {572            document.getElementById('useridprofilefield').textContent = profile.userId;...liff-starter.js
Source:liff-starter.js  
...17        });18    });19    // closeWindow call20    document.getElementById('closewindowbutton').addEventListener('click', function () {21        liff.closeWindow();22    });23    // sendMessages call24    document.getElementById('sendmessagebutton').addEventListener('click', function () {25        liff.sendMessages([{26            type: 'text',27            text: "ยิà¸à¹à¸à¸ª1"28        29        }]).then(function () {30            liff.closeWindow();31        }).catch(function (error) {32            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);33        });34    });35    // sendMessages call36    document.getElementById('sendmessagebutton2').addEventListener('click', function () {37        liff.sendMessages([{38            type: 'text',39            text: "ยิà¸à¹à¸à¸ª2"40        41        }]).then(function () {42            liff.closeWindow();43        }).catch(function (error) {44            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);45        });46    });47    // sendMessages call48    document.getElementById('sendmessagebutton3').addEventListener('click', function () {49        liff.sendMessages([{50            type: 'text',51            text: "ยิà¸à¹à¸à¸ª3"52        53        }]).then(function () {54            liff.closeWindow();55        }).catch(function (error) {56            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);57        });58    });59    // sendMessages call60    document.getElementById('sendmessagebutton4').addEventListener('click', function () {61        liff.sendMessages([{62            type: 'text',63            text: "ยิà¸à¸à¸¥à¸¸à¹à¸¡1"64        65        }]).then(function () {66            liff.closeWindow();67        }).catch(function (error) {68            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);69        });70    });71    // sendMessages call72    document.getElementById('sendmessagebutton5').addEventListener('click', function () {73        liff.sendMessages([{74            type: 'text',75            text: "ยิà¸à¸à¸¥à¸¸à¹à¸¡2"76        77        }]).then(function () {78            liff.closeWindow();79        }).catch(function (error) {80            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);81        });82    });83    // sendMessages call84    document.getElementById('sendmessagebutton6').addEventListener('click', function () {85        liff.sendMessages([{86            type: 'text',87            text: "ยิà¸à¸à¸¥à¸¸à¹à¸¡3"88        89        }]).then(function () {90            liff.closeWindow();91        }).catch(function (error) {92            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);93        });94    });95    // sendMessages call96    document.getElementById('sendmessagebutton7').addEventListener('click', function () {97        liff.sendMessages([{98            type: 'text',99            text: "/à¹à¸¡à¹à¹à¸à¸à¸à¸µà¹1"100        101        }]).then(function () {102            liff.closeWindow();103        }).catch(function (error) {104            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);105        });106    });107    // sendMessages call108    document.getElementById('sendmessagebutton8').addEventListener('click', function () {109        liff.sendMessages([{110            type: 'text',111            text: "/à¹à¸¡à¹à¹à¸à¸à¸à¸µà¹2"112        113        }]).then(function () {114            liff.closeWindow();115        }).catch(function (error) {116            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);117        });118    });119    // sendMessages call120    document.getElementById('sendmessagebutton9').addEventListener('click', function () {121        liff.sendMessages([{122            type: 'text',123            text: "/à¹à¸¡à¹à¹à¸à¸à¸à¸µà¹3"124        125        }]).then(function () {126            liff.closeWindow();127        }).catch(function (error) {128            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);129        });130    });131    // sendMessages call132    document.getElementById('sendmessagebutton10').addEventListener('click', function () {133        liff.sendMessages([{134            type: 'text',135            text: "ยิà¸à¹à¸à¸·à¹à¸à¸"136        137        }]).then(function () {138            liff.closeWindow();139        }).catch(function (error) {140            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);141        });142    });143    // sendMessages call144    document.getElementById('sendmessagebutton11').addEventListener('click', function () {145        liff.sendMessages([{146            type: 'text',147            text: "à¸à¸£à¸°à¸à¸²à¸¨à¹à¸à¸·à¹à¸à¸"148        149        }]).then(function () {150            liff.closeWindow();151        }).catch(function (error) {152            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);153        });154    });155    // sendMessages call156    document.getElementById('sendmessagebutton12').addEventListener('click', function () {157        liff.sendMessages([{158            type: 'text',159            text: "à¸à¸£à¸°à¸à¸²à¸¨à¸à¸²à¸¢à¸3"160        161        }]).then(function () {162            liff.closeWindow();163        }).catch(function (error) {164            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);165        });166    });167    // sendMessages call168    document.getElementById('sendmessagebutton13').addEventListener('click', function () {169        liff.sendMessages([{170            type: 'text',171            text: "à¸à¸²à¸¢à¸ªà¸´à¸à¸à¹à¸²"172        173        }]).then(function () {174            liff.closeWindow();175        }).catch(function (error) {176            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);177        });178    });179    // sendMessages call180    document.getElementById('sendmessagebutton14').addEventListener('click', function () {181        liff.sendMessages([{182            type: 'text',183            text: "à¸à¸£à¸°à¸à¸²à¸¨à¸à¸¥à¸¸à¹à¸¡2"184        185        }]).then(function () {186            liff.closeWindow();187        }).catch(function (error) {188            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);189        });190    });191    // sendMessages call192    document.getElementById('sendmessagebutton15').addEventListener('click', function () {193        liff.sendMessages([{194            type: 'text',195            text: "à¸à¸£à¸°à¸à¸²à¸¨à¸à¸¥à¸¸à¹à¸¡3"196        197        }]).then(function () {198            liff.closeWindow();199        }).catch(function (error) {200            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);201        });202    });203    // sendMessages call204    document.getElementById('sendmessagebutton16').addEventListener('click', function () {205        liff.sendMessages([{206            type: 'text',207            text: "/à¹à¸¡à¹à¹à¸à¸à¸ªà¹à¸¥à¸à¸µà¹1"208        209        }]).then(function () {210            liff.closeWindow();211        }).catch(function (error) {212            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);213        });214    });215    // sendMessages call216    document.getElementById('sendmessagebutton17').addEventListener('click', function () {217        liff.sendMessages([{218            type: 'text',219            text: "/à¹à¸¡à¹à¹à¸à¸à¸ªà¹à¸¥à¸à¸µà¹2"220        221        }]).then(function () {222            liff.closeWindow();223        }).catch(function (error) {224            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);225        });226    });227    // sendMessages call228    document.getElementById('sendmessagebutton18').addEventListener('click', function () {229        liff.sendMessages([{230            type: 'text',231            text: "/à¹à¸¡à¹à¹à¸à¸à¸ªà¹à¸¥à¸à¸µà¹3"232        233        }]).then(function () {234            liff.closeWindow();235        }).catch(function (error) {236            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);237        });238    });239    // sendMessages call240    document.getElementById('sendmessagebutton19').addEventListener('click', function () {241        liff.sendMessages([{242            type: 'text',243            text: "ยิà¸à¸£à¸¹à¸1"244        245        }]).then(function () {246            liff.closeWindow();247        }).catch(function (error) {248            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);249        });250    });251    // sendMessages call252    document.getElementById('sendmessagebutton20').addEventListener('click', function () {253        liff.sendMessages([{254            type: 'text',255            text: "ยิà¸à¸£à¸¹à¸2"256        257        }]).then(function () {258            liff.closeWindow();259        }).catch(function (error) {260            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);261        });262    });263    // sendMessages call264    document.getElementById('sendmessagebutton21').addEventListener('click', function () {265        liff.sendMessages([{266            type: 'text',267            text: "ยิà¸à¸£à¸¹à¸3"268        269        }]).then(function () {270            liff.closeWindow();271        }).catch(function (error) {272            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);273        });274    });275    // sendMessages call276    document.getElementById('sendmessagebutton22').addEventListener('click', function () {277        liff.sendMessages([{278            type: 'text',279            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡1"280        281        }]).then(function () {282            liff.closeWindow();283        }).catch(function (error) {284            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);285        });286    });287    // sendMessages call288    document.getElementById('sendmessagebutton23').addEventListener('click', function () {289        liff.sendMessages([{290            type: 'text',291            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡2"292        293        }]).then(function () {294            liff.closeWindow();295        }).catch(function (error) {296            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);297        });298    });299     // sendMessages call300    document.getElementById('sendmessagebutton24').addEventListener('click', function () {301        liff.sendMessages([{302            type: 'text',303            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡3"304        305        }]).then(function () {306            liff.closeWindow();307        }).catch(function (error) {308            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);309        });310    });311    // sendMessages call312    document.getElementById('sendmessagebutton25').addEventListener('click', function () {313        liff.sendMessages([{314            type: 'text',315            text: "/à¹à¸¡à¹à¹à¸à¸à¸£à¸¹à¸1"316        317        }]).then(function () {318            liff.closeWindow();319        }).catch(function (error) {320            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);321        });322    });323    // sendMessages call324    document.getElementById('sendmessagebutton26').addEventListener('click', function () {325        liff.sendMessages([{326            type: 'text',327            text: "/à¹à¸¡à¹à¹à¸à¸à¸£à¸¹à¸2"328        329        }]).then(function () {330            liff.closeWindow();331        }).catch(function (error) {332            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);333        });334    });335    // sendMessages call336    document.getElementById('sendmessagebutton27').addEventListener('click', function () {337        liff.sendMessages([{338            type: 'text',339            text: "/à¹à¸¡à¹à¹à¸à¸à¸£à¸¹à¸3"340        341        }]).then(function () {342            liff.closeWindow();343        }).catch(function (error) {344            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);345        });346    });347     // sendMessages call348    document.getElementById('sendmessagebutton28').addEventListener('click', function () {349        liff.sendMessages([{350            type: 'text',351            text: "ยิà¸01"352        353        }]).then(function () {354            liff.closeWindow();355        }).catch(function (error) {356            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);357        });358    });359    // sendMessages call360    document.getElementById('sendmessagebutton29').addEventListener('click', function () {361        liff.sendMessages([{362            type: 'text',363            text: "ยิà¸02"364        365        }]).then(function () {366            liff.closeWindow();367        }).catch(function (error) {368            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);369        });370    });371    // sendMessages call372    document.getElementById('sendmessagebutton30').addEventListener('click', function () {373        liff.sendMessages([{374            type: 'text',375            text: "ยิà¸03"376        377        }]).then(function () {378            liff.closeWindow();379        }).catch(function (error) {380            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);381        });382    });383    // sendMessages call384    document.getElementById('sendmessagebutton31').addEventListener('click', function () {385        liff.sendMessages([{386            type: 'text',387            text: "สูà¹à¸à¸¥à¸¸à¹à¸¡01"388        389        }]).then(function () {390            liff.closeWindow();391        }).catch(function (error) {392            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);393        });394    });395    // sendMessages call396    document.getElementById('sendmessagebutton32').addEventListener('click', function () {397        liff.sendMessages([{398            type: 'text',399            text: "สูà¹à¸à¸¥à¸¸à¹à¸¡02"400        401        }]).then(function () {402            liff.closeWindow();403        }).catch(function (error) {404            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);405        });406    });407    // sendMessages call408    document.getElementById('sendmessagebutton33').addEventListener('click', function () {409        liff.sendMessages([{410            type: 'text',411            text: "สูà¹à¸à¸¥à¸¸à¹à¸¡03"412        413        }]).then(function () {414            liff.closeWindow();415        }).catch(function (error) {416            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);417        });418    });419    // sendMessages call420    document.getElementById('sendmessagebutton34').addEventListener('click', function () {421        liff.sendMessages([{422            type: 'text',423            text: "/à¹à¸¡à¹à¹à¸à¸à¹à¸«à¸¡à¹1"424        425        }]).then(function () {426            liff.closeWindow();427        }).catch(function (error) {428            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);429        });430    });431    // sendMessages call432    document.getElementById('sendmessagebutton35').addEventListener('click', function () {433        liff.sendMessages([{434            type: 'text',435            text: "/à¹à¸¡à¹à¹à¸à¸à¹à¸«à¸¡à¹2"436        437        }]).then(function () {438            liff.closeWindow();439        }).catch(function (error) {440            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);441        });442    });443    // sendMessages call444    document.getElementById('sendmessagebutton36').addEventListener('click', function () {445        liff.sendMessages([{446            type: 'text',447            text: "/à¹à¸¡à¹à¹à¸à¸à¹à¸«à¸¡à¹3"448        449        }]).then(function () {450            liff.closeWindow();451        }).catch(function (error) {452            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);453        });454    });455    // sendMessages call456    document.getElementById('sendmessagebutton37').addEventListener('click', function () {457        liff.sendMessages([{458            type: 'text',459            text: "ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥1"460        461        }]).then(function () {462            liff.closeWindow();463        }).catch(function (error) {464            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);465        });466    });467    // sendMessages call468    document.getElementById('sendmessagebutton38').addEventListener('click', function () {469        liff.sendMessages([{470            type: 'text',471            text: "ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥2"472        473        }]).then(function () {474            liff.closeWindow();475        }).catch(function (error) {476            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);477        });478    });479    // sendMessages call480    document.getElementById('sendmessagebutton39').addEventListener('click', function () {481        liff.sendMessages([{482            type: 'text',483            text: "ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥3"484        485        }]).then(function () {486            liff.closeWindow();487        }).catch(function (error) {488            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);489        });490    });491    // sendMessages call492    document.getElementById('sendmessagebutton40').addEventListener('click', function () {493        liff.sendMessages([{494            type: 'text',495            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¹à¸¥1"496        497        }]).then(function () {498            liff.closeWindow();499        }).catch(function (error) {500            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);501        });502    });503    // sendMessages call504    document.getElementById('sendmessagebutton41').addEventListener('click', function () {505        liff.sendMessages([{506            type: 'text',507            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¹à¸¥2"508        509        }]).then(function () {510            liff.closeWindow();511        }).catch(function (error) {512            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);513        });514    });515    // sendMessages call516    document.getElementById('sendmessagebutton42').addEventListener('click', function () {517        liff.sendMessages([{518            type: 'text',519            text: "ยิà¸à¸£à¸¹à¸à¸à¸¥à¸¸à¹à¸¡à¸ªà¹à¸¥3"520        521        }]).then(function () {522            liff.closeWindow();523        }).catch(function (error) {524            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);525        });526    });527    // sendMessages call528    document.getElementById('sendmessagebutton43').addEventListener('click', function () {529        liff.sendMessages([{530            type: 'text',531            text: "/ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥1"532        533        }]).then(function () {534            liff.closeWindow();535        }).catch(function (error) {536            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);537        });538    });539     // sendMessages call540    document.getElementById('sendmessagebutton44').addEventListener('click', function () {541        liff.sendMessages([{542            type: 'text',543            text: "/ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥2"544        545        }]).then(function () {546            liff.closeWindow();547        }).catch(function (error) {548            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);549        });550    });551    // sendMessages call552    document.getElementById('sendmessagebutton45').addEventListener('click', function () {553        liff.sendMessages([{554            type: 'text',555            text: "/ยิà¸à¸£à¸¹à¸à¸ªà¹à¸¥3"556        557        }]).then(function () {558            liff.closeWindow();559        }).catch(function (error) {560            window.alert("à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¹à¸à¹: " + error);561        });562    });563    // get access token564    document.getElementById('getaccesstoken').addEventListener('click', function () {565        const accessToken = liff.getAccessToken();566        document.getElementById('accesstokenfield').textContent = accessToken;567        toggleAccessToken();568    });569    // get profile call570    document.getElementById('getprofilebutton').addEventListener('click', function () {571        liff.getProfile().then(function (profile) {572            document.getElementById('useridprofilefield').textContent = profile.userId;...WindowsArea.js
Source:WindowsArea.js  
1import React, { useState, useContext } from "react";2//Components3import Fenetre from "../Fenetres/Fenetre";4import ContentPdt from "../Fenetres/ContentPdt";5import ContentTrash from "../Fenetres/ContentTrash";6import ContentCv from "../Fenetres/ContentCv";7import ContentProjets from "../Fenetres/ContentProjets";8import ContentInternet from "../Fenetres/ContentInternet"9import ContentImages from "../Fenetres/ContentImages";10import ContentPopup from "../Fenetres/ContentPopup";11import ContentNotepad from "../Fenetres/ContentNotepad";12import Form from "../Fenetres/Form";13import postetravail from "../../assets/5131-tOo-Postedetravail.png";14import logointernet from "../../assets/internetlogo.png";15import notepadlogo from "../../assets/Notepad_Vista_10.png"16import Piano from "./../Fenetres/Piano"17//Assets18import Icone from "../Icones/Icone";19import trashlogo from "../../assets/ModernXP-76-Trash-Full-icon.png";20import ContentFormations from "../Fenetres/ContentFormations";21import ContentCompetences from "../Fenetres/ContentCompetences";22//Context23import LangContext from "../Context/LangContext"24function WindowsArea(props) {25  const [fullScreenPdt, setFullscreenPdt] = useState(false);26  const [fullScreenPopup, setFullscreenPopup] = useState(false);27  const [fullScreenInternet, setFullScreenInternet] = useState(false);28  const [fullScreenContact, setFullScreenContact] = useState(false);29  const [fullScreenTrash, setFullScreenTrash] = useState(false);30  const [fullScreenCv, setfullScreenCv] = useState(false);31  const [fullScreenProjets, setfullScreenProjets] = useState(false);32  const [fullScreenImages, setFullscreenImages] = useState(false);33  const [fullScreenFormations, setFullscreenFormations] = useState(false);34  const [fullScreenCompetences, setFullscreenCompetences] = useState(false);35  const [fullScreenPiano, setFullscreenPiano] = useState(false);36  const [fullScreenNotepad, setFullscreenNotepad] = useState(false);37  const [pianowidth, setPianoWidth] = useState('490')38  const [scale, setScale] = useState(1)39  const lang = useContext(LangContext);40  const enTrue = lang.language === "English"41  //Augmenter l'échelle quand le cv est fullscreen42  function setthatScale() {43    fullScreenCv ? setScale(1) : setScale(1.8);44  }45  //Fullscreen state pour chaque fenetre46  function makefullScreen(win) {47    if (win === "Poste de travail" || win === "Computer") setFullscreenPdt(!fullScreenPdt);48    else if (win === "Popup") setFullscreenPopup(!fullScreenPopup);49    else if (win === "Internet Explorer") setFullScreenInternet(!fullScreenInternet);50    else if (win === "Me contacter" || win === "Contact Me") setFullScreenContact(!fullScreenContact);51    else if (win === "Mes Projets" || win === "My Projects") setfullScreenProjets(!fullScreenProjets);52    else if (win === "Corbeille" || win === "Trash") setFullScreenTrash(!fullScreenTrash);53    else if (win === "Mes Images" || win === "My Pictures") setFullscreenImages(!fullScreenImages);54    else if (win === "Mes Formations" || win === "My Education") setFullscreenFormations(!fullScreenFormations);55    else if (win === "Mes Compétences" || win === "My Skills") setFullscreenCompetences(!fullScreenCompetences);56    else if (win === "Bloc-notes" || win === "Notepad") setFullscreenNotepad(!fullScreenNotepad);57    else if (win === "Piano") { setFullscreenPiano(!fullScreenPiano); setPianoWidth(800) }58    else if ((win === "Mon Cv.pdf" || win === "Resume.pdf") && fullScreenCv === false) { setfullScreenCv(true); setthatScale() };59    if ((win === "Mon Cv.pdf" || win === "Resume.pdf") && fullScreenCv) { setfullScreenCv(false); setthatScale() }60  }61  //fermer le menu deroulant ou la fenetre langue quand le bureau est cliqué62  function closeAll() {63    props.closemenu();64    props.closelang()65  }66  return (67    <div className="windows_all" onClick={() => closeAll()}>68      {props.windowsArray.map((window, index) => {69        if (window === "Poste de travail" && props.posteTravail === true)70          return (71            <Fenetre72              putOnTop={props.putOnTop}73              key={window}74              closeWindow={props.closeWindow}75              hideWindow={props.hideWindow}76              width={"65vw"}77              height={"50vh"}78              text={enTrue ? "Computer" : "Poste de travail"}79              logo={postetravail}80              content={<ContentPdt />}81              array={props.windowsArray}82              moveItem={props.moveItem}83              makefullScreen={makefullScreen}84              fullScreen={fullScreenPdt}85            />86          );87        else if (window === "Piano" && props.piano === true)88          return (89            <Fenetre90              putOnTop={props.putOnTop}91              key={window}92              content={<Piano pianowidth />}93              width={"500px"}94              height={"150px"}95              closeWindow={props.closeWindow}96              text={"Piano"}97              logo={98                "https://www.pngrepo.com/png/38467/512/piano-top-view.png"99              }100              hideWindow={props.hideWindow}101              array={props.windowsArray}102              moveItem={props.moveItem}103              makefullScreen={makefullScreen}104              fullScreen={fullScreenPiano}105            />106          );107        else if (window === "Bloc-notes" && props.notepad === true)108          return (109            <Fenetre110              putOnTop={props.putOnTop}111              key={window}112              content={<ContentNotepad />}113              width={"500px"}114              height={"350px"}115              closeWindow={props.closeWindow}116              text={enTrue ? "Notepad" : "Bloc-notes"}117              logo={118                notepadlogo119              }120              hideWindow={props.hideWindow}121              array={props.windowsArray}122              moveItem={props.moveItem}123              makefullScreen={makefullScreen}124              fullScreen={fullScreenNotepad}125            />126          );127        else if (window === "Popup" && props.popup === true)128          return (129            <Fenetre130              putOnTop={props.putOnTop}131              key={window}132              content={<ContentPopup />}133              width={"500px"}134              height={"380px"}135              closeWindow={props.closeWindow}136              text={"Popup"}137              logo={138                logointernet139              }140              hideWindow={props.hideWindow}141              array={props.windowsArray}142              moveItem={props.moveItem}143              makefullScreen={makefullScreen}144              fullScreen={fullScreenPopup}145            />146          );147        else if (window === "Mes Images" && props.mesimages === true)148          return (149            <Fenetre150              putOnTop={props.putOnTop}151              key={window}152              content={<ContentImages />}153              width={"700px"}154              height={"500px"}155              closeWindow={props.closeWindow}156              text={enTrue ? "My Pictures" : "Mes Images"}157              logo={158                "https://icons.iconarchive.com/icons/dtafalonso/modern-xp/256/ModernXP-62-Folder-Images-icon.png"159              }160              hideWindow={props.hideWindow}161              array={props.windowsArray}162              moveItem={props.moveItem}163              makefullScreen={makefullScreen}164              fullScreen={fullScreenImages}165            />166          );167        else if (window === "Mes Formations" && props.mesformations === true)168          return (169            <Fenetre170              putOnTop={props.putOnTop}171              key={window}172              content={<ContentFormations />}173              width={"700px"}174              height={"500px"}175              closeWindow={props.closeWindow}176              text={enTrue ? "My Education" : "Mes Formations"}177              logo={178                "https://icons.iconarchive.com/icons/dtafalonso/modern-xp/256/ModernXP-62-Folder-Images-icon.png"179              }180              hideWindow={props.hideWindow}181              array={props.windowsArray}182              moveItem={props.moveItem}183              makefullScreen={makefullScreen}184              fullScreen={fullScreenFormations}185            />186          );187        else if (window === "Mes Compétences" && props.mescompetences === true)188          return (189            <Fenetre190              putOnTop={props.putOnTop}191              key={window}192              content={<ContentCompetences />}193              width={"700px"}194              height={"500px"}195              closeWindow={props.closeWindow}196              text={enTrue ? "My Skills" : "Mes Compétences"}197              logo={198                "https://iconarchive.com/download/i95231/dtafalonso/modern-xp/ModernXP-16-Folder-Documents.ico"199              }200              hideWindow={props.hideWindow}201              array={props.windowsArray}202              moveItem={props.moveItem}203              makefullScreen={makefullScreen}204              fullScreen={fullScreenCompetences}205            />206          );207        else if (window === "Internet Explorer" && props.internet === true)208          return (209            <Fenetre210              putOnTop={props.putOnTop}211              key={window}212              content={<ContentInternet />}213              width={"800px"}214              height={"600px"}215              closeWindow={props.closeWindow}216              text={"Internet Explorer"}217              logo={218                logointernet219              }220              hideWindow={props.hideWindow}221              array={props.windowsArray}222              moveItem={props.moveItem}223              makefullScreen={makefullScreen}224              fullScreen={fullScreenInternet}225            />226          );227        else if (window === "Me contacter" && props.mail === true)228          return (229            <Fenetre230              putOnTop={props.putOnTop}231              key={window}232              content={<Form />}233              width={"550px"}234              height={"350px"}235              closeWindow={props.closeWindow}236              text={enTrue ? "Contact Me" : "Me contacter"}237              logo={238                "https://upload.wikimedia.org/wikipedia/fr/5/53/Outlook_express_logo-200-200.jpg"239              }240              hideWindow={props.hideWindow}241              array={props.windowsArray}242              moveItem={props.moveItem}243              makefullScreen={makefullScreen}244              fullScreen={fullScreenContact}245            />246          );247        else if (window === "Mes Projets" && props.mesprojets === true)248          return (249            <Fenetre250              putOnTop={props.putOnTop}251              key={window}252              content={<ContentProjets />}253              width={"50vw"}254              height={"50vh"}255              closeWindow={props.closeWindow}256              text={enTrue ? "My Projects" : "Mes Projets"}257              logo={258                "https://icons.iconarchive.com/icons/dtafalonso/modern-xp/512/ModernXP-38-Folder-Music-icon.png"259              }260              hideWindow={props.hideWindow}261              array={props.windowsArray}262              moveItem={props.moveItem}263              makefullScreen={makefullScreen}264              fullScreen={fullScreenProjets}265            />266          );267        else if (window === "Corbeille" && props.trash === true)268          return (269            <Fenetre270              putOnTop={props.putOnTop}271              key={window}272              content={<ContentTrash />}273              width={"550px"}274              height={"300px"}275              closeWindow={props.closeWindow}276              text={enTrue ? "Trash" : "Corbeille"}277              logo={trashlogo}278              hideWindow={props.hideWindow}279              array={props.windowsArray}280              moveItem={props.moveItem}281              makefullScreen={makefullScreen}282              fullScreen={fullScreenTrash}283            />284          );285        else if (window === "Mon Cv.pdf" && props.cv === true)286          return (287            <Fenetre288              putOnTop={props.putOnTop}289              key={window}290              content={<ContentCv scale={scale} />}291              width={"706px"}292              height={"500px"}293              closeWindow={props.closeWindow}294              text={enTrue ? "Resume.pdf" : "Mon Cv.pdf"}295              logo={296                "https://seeklogo.com/images/A/adobe-pdf-logo-1480D328A9-seeklogo.com.png"297              }298              hideWindow={props.hideWindow}299              array={props.windowsArray}300              moveItem={props.moveItem}301              makefullScreen={makefullScreen}302              fullScreen={fullScreenCv}303              scale={scale}304            />305          );306      })}307      <div className="icones">308        <Icone309          showWindow={props.showWindow}310          name={enTrue ? "Trash" : "Corbeille"}311          logo={trashlogo}312          bottom={"71px"}313          right={"44px"}314        />315        <Icone316          showWindow={props.showWindow}317          name={enTrue ? "Resume.pdf" : "Mon Cv.pdf"}318          logo={319            "https://seeklogo.com/images/A/adobe-pdf-logo-1480D328A9-seeklogo.com.png"320          }321          bottom={"40px"}322          top={"20px"}323          left={"45px"}324        />325      </div>326    </div>327  );328}...HireMercenary.js
Source:HireMercenary.js  
1#pragma strict2var startAfterTalk : boolean = false;3private var begin : boolean = false;4private var noCash : boolean = false;5private var player : GameObject;6private var enter : boolean = false;7class MercenaryInfo{8	var className : String = "";9	var mercenaryPrefab : GameObject;10	var level : int = 1;11	var atk : int = 1;12	var def : int = 1;13	var matk : int = 1;14	var mdef : int = 1;15	var hp : int = 200;16	var price : int = 500;17}18var mercenariesInfo : MercenaryInfo[] = new MercenaryInfo[9];19function Update () {20		if(Input.GetKeyDown("e") && enter && !begin && !startAfterTalk){21			begin = true;22		}23		if(startAfterTalk && enter && !begin){24			begin = GetComponent(Dialogue).talkFinish;25		}26		if(startAfterTalk && begin){27			GetComponent(Dialogue).talkFinish = false;28		}29}30function OnGUI(){31	if(begin && !noCash && player){32		GUI.Box (Rect (Screen.width /2 - 320 ,120, 680, 400), "Mercenaries List");33		if (GUI.Button (Rect (Screen.width /2 + 160 , 460, 120, 50), "Cancel")) {34			CloseWindow();35		}36		GUI.Label (Rect (Screen.width /2 - 290 , 490, 200, 30), "$ " + player.GetComponent(Inventory).cash);37		//---------------------------------------38		if (GUI.Button (Rect (Screen.width /2 - 285 , 140, 200, 90), mercenariesInfo[0].className + " : LV " + mercenariesInfo[0].level + "\n Pay :" + mercenariesInfo[0].price)) {39			GetMercenary(0);40			CloseWindow();41		}42		if (GUI.Button (Rect (Screen.width /2 - 75 , 140, 200, 90), mercenariesInfo[1].className + " : LV " + mercenariesInfo[1].level + "\n Pay :" + mercenariesInfo[1].price)) {43			GetMercenary(1);44			CloseWindow();45		}46		if (GUI.Button (Rect (Screen.width /2 + 135 , 140, 200, 90), mercenariesInfo[2].className + " : LV " + mercenariesInfo[2].level + "\n Pay :" + mercenariesInfo[2].price)) {47			GetMercenary(2);48			CloseWindow();49		}50		//----------------------51		if (GUI.Button (Rect (Screen.width /2 - 285 , 250, 200, 90), mercenariesInfo[3].className + " : LV " + mercenariesInfo[3].level + "\n Pay :" + mercenariesInfo[3].price)) {52			GetMercenary(3);53			CloseWindow();54		}55		if (GUI.Button (Rect (Screen.width /2 - 75 , 250, 200, 90), mercenariesInfo[4].className + " : LV " + mercenariesInfo[4].level + "\n Pay :" + mercenariesInfo[4].price)) {56			GetMercenary(4);57			CloseWindow();58		}59		if (GUI.Button (Rect (Screen.width /2 + 135 , 250, 200, 90), mercenariesInfo[5].className + " : LV " + mercenariesInfo[5].level + "\n Pay :" + mercenariesInfo[5].price)) {60			GetMercenary(5);61			CloseWindow();62		}63		//--------------------------64		if (GUI.Button (Rect (Screen.width /2 - 285 , 360, 200, 90), mercenariesInfo[6].className + " : LV " + mercenariesInfo[6].level + "\n Pay :" + mercenariesInfo[6].price)) {65			GetMercenary(6);66			CloseWindow();67		}68		if (GUI.Button (Rect (Screen.width /2 - 75 , 360, 200, 90), mercenariesInfo[7].className + " : LV " + mercenariesInfo[7].level + "\n Pay :" + mercenariesInfo[7].price)) {69			GetMercenary(7);70			CloseWindow();71		}72		if (GUI.Button (Rect (Screen.width /2 + 135 , 360, 200, 90), mercenariesInfo[8].className + " : LV " + mercenariesInfo[8].level + "\n Pay :" + mercenariesInfo[8].price)) {73			GetMercenary(8);74			CloseWindow();75		}76	}77	78	if(noCash){79		GUI.Box (Rect (Screen.width /2 - 125 ,220, 250, 120), "Not Enough Cash!!");80		if (GUI.Button (Rect (Screen.width /2 - 75 , 255, 150, 60), "OK")) {81			noCash = false;82		}83	}84}85function OnTriggerEnter (other : Collider) {86	if(other.tag == "Player"){87		player = other.gameObject;88		enter = true;89		begin = false;90	}91}92function OnTriggerExit (other : Collider) {93	if(other.tag == "Player"){94		enter = false;95		CloseWindow();96	}97}98function CloseWindow(){99		if(startAfterTalk){100			GetComponent(Dialogue).talkFinish = false;101		}102		//enter = false;103		begin = false;104}105function GetMercenary(id : int){106	if(player.GetComponent(Inventory).cash >= mercenariesInfo[id].price){107			//Get You Mercenary.108			player.GetComponent(Inventory).cash -= mercenariesInfo[id].price;109			if(player.GetComponent(SpawnPartner)){110					//Check if you have current partner.111					if(player.GetComponent(SpawnPartner).currentPartner){112						Destroy(player.GetComponent(SpawnPartner).currentPartner);113					}114			}else{115				player.AddComponent(SpawnPartner);116			}117			if(mercenariesInfo[id].mercenaryPrefab){118				//Spawn Mercenary119				var m : GameObject = Instantiate(mercenariesInfo[id].mercenaryPrefab , player.transform.position , player.transform.rotation);120				m.GetComponent(AIfriend).master = player.transform;121				player.GetComponent(SpawnPartner).currentPartner = m;122				//Apply Mercenary's Status123				m.GetComponent(Status).level = mercenariesInfo[id].level;124				m.GetComponent(Status).atk = mercenariesInfo[id].atk;125				m.GetComponent(Status).def = mercenariesInfo[id].def;126				m.GetComponent(Status).matk = mercenariesInfo[id].matk;127				m.GetComponent(Status).mdef = mercenariesInfo[id].mdef;128				m.GetComponent(Status).maxHealth = mercenariesInfo[id].hp;129				m.GetComponent(Status).health = mercenariesInfo[id].hp;130			}else{131				print("Please Assign Mercenary Prefab");132			}133	}else{134		//When you have not enough cash to hire.135		noCash = true;136	137	}...DueDateWindow.js
Source:DueDateWindow.js  
1function Controller() {2    function closeWindow() {3        $.rootWin.close();4    }5    function dataSelezionata(e) {6        dateBtn.title = String.formatDate(e.value, "medium");7    }8    require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));9    this.__controllerPath = "DueDateWindow";10    arguments[0] ? arguments[0]["__parentSymbol"] : null;11    arguments[0] ? arguments[0]["$model"] : null;12    arguments[0] ? arguments[0]["__itemTemplate"] : null;13    var $ = this;14    var exports = {};15    var __defers = {};16    $.__views.rootWin = Ti.UI.createWindow({...ModalWindow.js
Source:ModalWindow.js  
1import { ModalContainer,ModalWind } from "../../../Styles/common"2import SprintForm from './sprintForm'3import { Bold } from "../../../Styles/typography"4import ProjectNew from "../newProject";5import AddContractor from "../../Superadmin/addContractor";6import CreateNew from "../../Superadmin/createNew";7import Ticket from "../../Adminka/Index";8export const url = process.env.REACT_APP_IP;9const ModalWindow = ({closeWindow, bigTitle,smallTitles,customElements,histCurrent,buttonTitle, offWindow, status}) => {10	11	return (12	<>13		{/* {!loaded?<div>loading...</div>:( */}14			<div style={{display: status?'block':'none'}}>15		16				<ModalContainer>17					<ModalWind>18						<Bold size={30}>{bigTitle}</Bold>19						{customElements === 'CreateSprint'? 20						<>21							<SprintForm offWindow={offWindow} smallTitles={smallTitles} buttonTitle={buttonTitle} customElements={customElements}>22							</SprintForm>23						</>:customElements === 'CreateProject'?24						<>25							<ProjectNew closeWindow={closeWindow} histCurrent={histCurrent}>26							</ProjectNew>27						</>:customElements === 'CreateNews'?28						<>29							<CreateNew closeWindow={closeWindow} histCurrent={histCurrent}>30							</CreateNew>31						</>:customElements === 'CreateTicket'?32						<>33							<Ticket closeWindow={closeWindow} histCurrent={histCurrent}>34							</Ticket>35						</>:customElements === 'addPodsos'?36						<>37							<AddContractor closeWindow={closeWindow} histCurrent={histCurrent}>38							</AddContractor>39						</>40						:''}41					</ModalWind>42				</ModalContainer>43			</div>44			45		{/* )} */}46		</>47	)48}...close.js
Source:close.js  
1import {ipcMain, BrowserWindow, globalShortcut} from 'electron'2const winURL = process.env.NODE_ENV === 'development'3    ? `http://localhost:9080#/close`4    : `file://${__dirname}/index.html#/close`5export const close = {6    closeWindow: null,7    createWindow: (main) => {8        close.closeWindow = new BrowserWindow({9            useContentSize: true,10            height: 135,11            width: 280,12            webPreferences: {13                devTools: false//process.env.NODE_ENV === 'development'14            },15            frame: false,16            resizable: false,17            alwaysOnTop: true,18            skipTaskbar: true,19            maximizable: false,20            parent: main.mainWindow,21            modal: true22        })23        let closeWindow = close.closeWindow24        closeWindow.loadURL(winURL)25        closeWindow.on('closed', () => {26            close.closeWindow = null27        })28        closeWindow.hide()29        ipcMain.on('close-window-show', () => {30            closeWindow.show()31        })32        ipcMain.on('save-close-action', (e, args)=>{33            closeWindow.hide()34            main.mainWindow.webContents.send('saveCloseAction', args)35        })36    }...Using AI Code Generation
1import { Selector } from 'testcafe';2test('My first test', async t => {3        .typeText('#developer-name', 'John Smith')4        .click('#submit-button')5        .closeWindow();6});7import { Selector } from 'testcafe';8test('My first test', async t => {9        .typeText('#developer-name', 'John Smith')10        .click('#submit-button')11        .closeWindow();12});Using AI Code Generation
1import { Selector } from 'testcafe';2test('My first test', async t => {3        .typeText('#developer-name', 'John Smith')4        .click('#submit-button')5        .click('#article-header')6        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');7});8test('Close Window', async t => {9        .closeWindow();10});11test('Switch Window', async t => {12});13test('Switch to Iframe', async t => {14        .switchToIframe('#iframe');15});16test('Switch to Main Window', async t => {17        .switchToMainWindow();18});19test('Maximize Window', async t => {20        .maximizeWindow();21});22test('Resize Window', async t => {23        .resizeWindow(500, 500);24});25test('Take Screenshot', async t => {26        .takeScreenshot();27});28test('Take Element Screenshot', async t => {29        .takeElementScreenshot('#iframe');30});31test('Resize Window To Fit Device', async t => {32        .resizeWindowToFitDevice('iPhone 6', {33        });34});35test('Resize Window', async t => {36        .resizeWindow(500, 500);37});38test('Set Test Speed', async t => {Using AI Code Generation
1import { Selector } from 'testcafe';2test('My first test', async t => {3        .typeText('#developer-name', 'John Smith')4        .click('#windows')5        .click('#submit-button')6        .closeWindow()7        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');8});9import { Selector } from 'testcafe';10test('My first test', async t => {11        .typeText('#developer-name', 'John Smith')12        .click('#windows')13        .click('#submit-button')14        .closeWindow()15        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');16});17import { Selector } from 'testcafe';18test('My first test', async t => {19        .typeText('#developer-name', 'John Smith')20        .click('#windows')21        .click('#submit-button')22        .closeWindow()23        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');24});25import { Selector } from 'testcafe';26test('My first test', async t => {27        .typeText('#developer-name', 'John Smith')28        .click('#windows')Using AI Code Generation
1import { Selector } from 'testcafe';2test('My first test', async t => {3        .typeText('#developer-name', 'John Smith')4        .click('#submit-button')5        .click('#closeButton')6        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');7});8import { Selector } from 'testcafe';9test('My first test', async t => {10        .typeText('#developer-name', 'John Smith')11        .click('#submit-button')12        .click('#closeButton')13        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');14});15import { Selector } from 'testcafe';16test('My first test', async t => {17        .typeText('#developer-name', 'John Smith')18        .click('#submit-button')19        .click('#closeButton')20        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');21});22import { Selector } from 'testcafe';23test('My first test', async t => {24        .typeText('#developer-name', 'John Smith')25        .click('#submit-button')26        .click('#closeButton')27        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');28});29import { Selector } from 'testcafe';30test('My first test', async t => {31        .typeText('#developer-name', 'John Smith')32        .click('#submit-button')33        .click('#closeButton')Using AI Code Generation
1import { Selector } from 'testcafe';2test('My first test', async t => {3        .typeText('#lst-ib', 'testcafe')4        .click('#tsf > div.tsf-p > div.jsb > center > input[type="submit"]:nth-child(1)')5        .click('#rso > div:nth-child(1) > div > div > div > div > h3 > a')6        .closeWindow()7        .typeText('#lst-ib', 'testcafe')8        .click('#tsf > div.tsf-p > div.jsb > center > input[type="submit"]:nth-child(1)')9        .click('#rso > div:nth-child(1) > div > div > div > div > h3 > a')10        .closeWindow()11        .typeText('#lst-ib', 'testcafe')12        .click('#tsf > div.tsf-p > div.jsb > center > input[type="submit"]:nth-child(1)')13        .click('#rso > div:nth-child(1) > div > div > div > div > h3 > a')14        .closeWindow() 15        .typeText('#lst-ib', 'testcafe')16        .click('#tsf > div.tsf-p > div.jsb > center > input[type="submit"]:nth-child(1)')17        .click('#rso > div:nth-child(1) > div > div > div > div > h3 > a')18        .closeWindow() 19        .typeText('#lst-ib', 'testcafe')20        .click('#tsf > div.tsf-p > div.jsb > center > input[type="submit"]:nth-child(1)')21        .click('#rso > div:nth-child(1) > div > div > div > div > h3 > a')22        .closeWindow() 23        .typeText('#lst-ib', 'testcafe')24        .click('#tsf > div.tsf-p > div.jsb > center > input[type="submit"]:nth-child(1)')25        .click('#rso > div:nth-child(1) > div > div > div > div > h3 > a')26        .closeWindow() 27        .typeText('#lst-ib', 'testUsing AI Code Generation
1import { Selector } from 'testcafe';2test('My first test', async t => {3        .typeText('#developer-name', 'John Smith')4        .click('#submit-button')5        .wait(2000)6        .closeWindow()7        .wait(2000)8        .click('#tried-test-cafe');9});10import { Selector } from 'testcafe';11test('My first test', async t => {12        .typeText('#developer-name', 'John Smith')13        .click('#submit-button')14        .wait(2000)15        .closeWindow()16        .wait(2000)17        .click('#tried-test-cafe');18});19import { Selector } from 'testcafe';20test('My first test', async t => {21        .typeText('#developer-name', 'John Smith')22        .click('#submit-button')23        .wait(2000)24        .closeWindow()25        .wait(2000)26        .click('#tried-test-cafe');27});28import { Selector } from 'testcafe';29test('My first test', async t => {30        .typeText('#developer-name', 'John Smith')31        .click('#submit-button')32        .wait(2000)33        .closeWindow()34        .wait(2000)35        .click('#tried-test-cafe');36});37import { Selector } from 'testcafe';38test('My firstUsing AI Code Generation
1import { ClientFunction } from 'testcafe';2const closeWindow = ClientFunction(() => window.close());3test('Close window', async t => {4        .click('#closeWindow')5        .click('#closeWindow');6    await closeWindow();7});8import { ClientFunction } from 'testcafe';9const closeWindow = ClientFunction(() => window.close());10test('Close window', async t => {11        .click('#closeWindow')12        .click('#closeWindow');13    await closeWindow();14});Using AI Code Generation
1import { Selector } from 'testcafe';2import {closeWindow} from 'testcafe-browser-tools';3test('My first test', async t => {4        .click(Selector('button').withText('Open window'))5        .click(Selector('button').withText('Close window'));6    closeWindow();7});8        document.getElementById('open').addEventListener('click', function () {9        });10        document.getElementById('close').addEventListener('click', function () {11            window.close();12        });13test('My first test', async t => {14        .click(Selector('button').withText('Open window'))15        .click(Selector('button').withText('Close window'));16});17        document.getElementById('open').addEventListener('click', function () {18        });19        document.getElementById('close').addEventListener('click', function () {20            window.close();21        });22        window.onbeforeunload = function () {23            closeWindow();24        };Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
