Best JavaScript code snippet using playwright-internal
ranges.js
Source: ranges.js
1let ranges = {2 "RFI": {3 "SB": {4 "title": "RFI from the Small Blind",5 "raise": ["22+", "A2s+", "K2s+", "Q4s+", "J6s+", "T7s+", "97s+",6 "87s", "76s", "65s", "54s",7 "A5+", "K8+", "Q9+", "J9+", "T9+"],8 "raise-or-fold": ["Q2s-Q3s", "J4s-J5s", "T6s", "96s", "86s", "75s",9 "A2-A4", "K7", "Q8", "J8", "T8", "98"],10 },11 "LJ": {12 "title": "RFI from the Low Jack",13 "raise": ["77+", "A2s+", "K9s+", "Q9s+", "J9s+", "T9s",14 "AT+", "KJ+"],15 "raise-or-fold": ["55-66", "K8s", "98s", "87s", "76s", "65s+",]16 },17 "HJ": {18 "title": "RFI from the High Jack",19 "raise": ["55+", "A2s+", "K9s+", "Q9s+", "J9s+", "T9s", "98s",20 "87s", "76s", "65s", "54s",21 "AT+", "KJ+"],22 "raise-or-fold": ["33-44", "K7s-K8s", "T8s", "QJ"]23 },24 "CO": {25 "title": "RFI from the Cut Off",26 "raise": ["22+", "A2s+", "K6s+", "Q8s+", "J9s+", "T9s+", "98s+",27 "87s+", "76s+", "65s+", "54s+",28 "A9+", "KJ+", "QJ+"],29 "raise-or-fold": ["K3s-K5s", "Q6s-Q7s", "J7s-J8s", "T7s-T8s",30 "97s", "86s", "A8", "KT", "QT", "JT"]31 },32 "BTN": {33 "title": "RFI from the Button",34 "raise": ["22+", "A2s+", "K2s+", "Q4s+", "J6s+", "T7s+", "97s+",35 "87s+", "76s+", "65s+", "54s+",36 "A5+", "K8+", "Q9+", "J9+", "T9"],37 "raise-or-fold": ["Q2s-Q3s", "J4s-J5s", "T6s", "96s", "86s", "75s",38 "A4", "J8", "T8", "98"]39 }40 },41 "RFIvs3Bet": {42 "SB": {43 "vsBB": {44 "title": "RFI Small Blind vs 3-Bet from Big Blind",45 "raise": ["TT+", "AQs+", "A2s",46 "AT-AJ", "AK"],47 "raise-or-call": ["A3s-A4s", "AQ", "KJ+"],48 "call": ["A5s-AJs", "K8s-KQs", "Q9s-QJs",49 "J9s+", "T8s+", "55-99",50 "KQ"],51 "call-or-fold": ["K7s", "Q8s", "J8s", "98s", "87s", "76s", "65s",52 "54s", "22-44"],53 "raise-call-or-fold": ["K6s", "QJ"]54 }55 },56 "LJ": {57 "vsSB": {58 "title": "RFI Low Jack vs 3-Bet from Small Blind",59 "raise": ["KK+", "AKs"],60 "raise-or-call": ["JJ-QQ", "AJs", "KJs+", "AK"],61 "raise-or-fold": ["A9s", "AQ"],62 "call": ["AQs", "TT"],63 "call-or-fold": ["55-99", "ATs", "A4s", "QTs+", "JTs", "76s", "65s"],64 "raise-call-or-fold": ["A5s", "KTs"]65 },66 "vsBB": {67 "title": "RFI Low Jack vs 3-Bet from Big Blind",68 "raise": ["AA"],69 "raise-or-call": ["KK", "AKs", "ATs-AJs", "KJs", "AK"],70 "raise-or-fold": ["A9s", "A3s"],71 "call": ["TT-QQ", "AQs", "KQs"],72 "call-or-fold": ["55-99", "QJs", "JTs", "T9s", "87s", "76s", "65s"],73 "raise-call-or-fold": ["A4s-A5s", "KTs"]74 },75 "vsHJ": {76 "title": "RFI Low Jack vs 3-Bet from High Jack",77 "raise": ["KK+", "AKs"],78 "raise-or-call": ["JJ-QQ", "AJs", "KQs", "AK"],79 "raise-or-fold": ["AQ"],80 "call": ["AQs", "TT"],81 "call-or-fold": ["55-99", "QJs", "JTs", "T9s", "98s", "87s", "76s", "65s"],82 "raise-call-or-fold": ["ATs", "KTs-KJs", "A5s"]83 },84 "vsCO": {85 "title": "RFI Low Jack vs 3-Bet from Cut Off",86 "raise": ["KK+", "AKs"],87 "raise-or-call": ["JJ-QQ", "AJs", "KQs", "AK"],88 "raise-or-fold": ["AQ"],89 "call": ["AQs", "TT"],90 "call-or-fold": ["55-99", "QJs", "JTs", "T9s", "98s", "87s", "76s", "65s"],91 "raise-call-or-fold": ["ATs", "KTs-KJs", "A5s"]92 },93 "vsBTN": {94 "title": "RFI Low Jack vs 3-Bet from Button",95 "raise": ["KK+", "AKs"],96 "raise-or-call": ["JJ-QQ", "AJs", "KJs-KQs", "AK"],97 "raise-or-fold": ["AQ"],98 "call": ["AQs", "TT"],99 "call-or-fold": ["55-99", "A4s", "QTs+", "JTs", "T9s", "98s", "87s", "76s", "65s"],100 "raise-call-or-fold": ["ATs", "KTs", "A5s"]101 }102 },103 "HJ": {104 "vsSB": {105 "title": "RFI High Jack vs 3-Bet from Small Blind",106 "raise": ["KK+", "AKs"],107 "raise-or-call": ["JJ-QQ", "AJs", "KTs+", "AQ+"],108 "raise-or-fold": ["AJ"],109 "call": ["99-TT", "AQs"],110 "call-or-fold": ["33-88", "ATs", "QTs+", "JTs", "T9s", "98s", "87s", "76s", "65s", "54s"],111 "raise-call-or-fold": ["A4s-A5s"]112 },113 "vsBB": {114 "title": "RFI High Jack vs 3-Bet from Big Blind",115 "raise": ["KK+", "AKs"],116 "raise-or-call": ["A5s", "ATs", "KTs-KJs", "AK"],117 "raise-or-fold": ["A9s", "K9s", "AQ"],118 "call": ["TT-QQ", "AJs-AQs", "KQs"],119 "call-or-fold": ["33-99", "QTs+", "JTs", "T9s", "87s", "76s", "65s", "54s"],120 "raise-call-or-fold": ["A4s"]121 },122 "vsCO": {123 "title": "RFI High Jack vs 3-Bet from Cut Off",124 "raise": ["QQ+", "AK", "AKs", "KJs"],125 "raise-or-call": ["TT-JJ", "AJs", "KQs", "AQ"],126 "raise-or-fold": ["KTs"],127 "call": ["AQs"],128 "call-or-fold": ["33-99", "QJs", "JTs", "T9s", "98s", "87s", "76s", "65s", "54s"],129 "raise-call-or-fold": ["A5s", "ATs"]130 },131 "vsBTN": {132 "title": "RFI High Jack vs 3-Bet from Button",133 "raise": ["QQ+", "AK", "AKs", "KTs-KJs"],134 "raise-or-call": ["TT-JJ", "AJs", "KQs", "AQ"],135 "raise-or-fold": ["A4s"],136 "call": ["AQs"],137 "call-or-fold": ["33-99", "QJs", "JTs", "T9s", "98s", "87s", "76s", "65s", "54s"],138 "raise-call-or-fold": ["A5s", "ATs"]139 }140 },141 "CO": {142 "vsSB": {143 "title": "RFI Cut Off vs 3-Bet from Small Blind",144 "raise": ["KK+", "AKs"],145 "raise-or-call": ["JJ-QQ", "KTs", "AQ+"],146 "raise-or-fold": ["A8s", "AJ"],147 "raise-call-or-fold": ["A9s", "A3s-A4s", "K9s", "KQ"],148 "call": ["88-TT", "ATs-AQs", "KJs-KQs", "QJs", "JTs", "87s", "76s"],149 "call-or-fold": ["22-77", "QTs", "T9s", "98s", "65s", "54s"]150 },151 "vsBB": {152 "title": "RFI Cut Off vs 3-Bet from Big Blind",153 "raise": ["KK+", "AKs"],154 "raise-or-call": ["QQ", "A9s", "A5s", "AQ+"],155 "raise-or-fold": ["AJ"],156 "raise-call-or-fold": ["A8s", "A3s-A4s", "K9s", "KQ"],157 "call": ["99-JJ", "ATs-AQs", "KTs-KQs", "QTs+", "JTs"],158 "call-or-fold": ["22-88", "T9s", "87s", "76s", "65s", "54s"]159 },160 "vsBTN": {161 "title": "RFI Cut Off vs 3-Bet from Button",162 "raise": ["JJ+", "AK", "AKs"],163 "raise-or-call": ["TT", "ATs-AJs", "KTs-KJs", "QJs", "AQ"],164 "raise-or-fold": ["AJ"],165 "raise-call-or-fold": ["A4s-A5s", "K9s", "JTs", "KQ"],166 "call": ["88-99", "AQs", "KQs", "87s", "76s", "65s", "54s"],167 "call-or-fold": ["22-77", "A9s", "QTs", "T9s", "98s"]168 }169 },170 "BTN": {171 "vsSB": {172 "title": "RFI Button vs 3-Bet from Small Blind",173 "raise": ["QQ+", "AKs"],174 "raise-or-call": ["TT-JJ", "A4s", "A8s-A9s", "K9s", "J9s", "54s",175 "AK", "AJ", "KQ"],176 "raise-or-fold": ["A6s", "K5s", "AT", "KJ"],177 "call": ["22-99", "A5s", "ATs-AQs", "KTs-KQs", "QTs+", "JTs", "T9s", "87s", "76s", "65s", "AQ"],178 "call-or-fold": ["K6s-K8s", "T8s", "97s+"],179 "raise-call-or-fold": ["A7s", "A3s", "Q9s"]180 },181 "vsBB": {182 "title": "RFI Button vs 3-Bet from Big Blind",183 "raise": ["QQ+", "AKs", "AK"],184 "raise-or-call": ["JJ", "A4s", "A7s-A8s", "T8s", 185 "AJ", "KQ"],186 "raise-or-fold": ["A2s", "K5s", "AT"],187 "call": ["66-TT", "A5s", "A9s-AQs", "K9s-KQs", "QTs+", "J9s+", "T9s", "98s", "87s", "AQ"],188 "call-or-fold": ["22-55", "K6s-K8s", "76s", "65s", "54s"],189 "raise-call-or-fold": ["A6s", "A3s", "Q9s", "KJ"]190 },191 }192 },193 "vsRFI": {194 "vsSB": {195 "BB": {196 "title": "vs RFI: Big Blind vs Small Blind",197 "raise": ["TT+", "AQ+", "AQs+", "A4s-A5s"],198 "raise-or-call": ["88-99", "ATs-AJs", "A2s-A3s", "KTs+", "Q9s+", "J8s+", "T8s+", "98s", "87s", "76s", "65s", "54s", "AJ", "A2-A4", "KJ+", "K6", ],199 "call": ["22-77", "A6s-A9s", "K2s-K9s", "Q2s-Q8s", "J2s-J7s", "T2s-T7s", "95s-97s", "85s-86s", "74s-75s", "62s-63s", "52s-53s", "42s+", "32s",200 "A5-AT", "K7-KT", "Q8+", "J8+", "T9"],201 "call-or-fold": ["84s", "73s", "T8", "98", "87", "76", "65"]202 }203 },204 "vsLJ": {205 "SB": {206 "title": "vs RFI: Small Blind vs Low Jack",207 "raise": ["99+", "AK", "ATs+", "A5s", "KTs+", "QJs"],208 "raise-or-fold": ["AQ", "QTs", "JTs"],209 },210 "BB": {211 "title": "vs RFI: Big Blind vs Low Jack",212 "raise": ["QQ+", "AK", "AKs"],213 "raise-or-call": ["A8s-AQs", "A2s-A5s", "KTs+", "K6s-K7s", "Q9s+", "JJ", "JTs", "87s", "76s", "65s", "54s"],214 "call": ["A6s-A7s", "K8s-K9s", "K2s-K5s", "Q6s-Q8s", "J8s-J9s", "T7s+", "96s+", "86s", "75s", "64s", "53s", "43s", "22-TT", "AT-AQ", "KJ+"],215 "call-or-fold": ["Q3s-Q5s", "J7s", "52s", "42s", "QJ"]216 },217 "HJ": {218 "title": "vs RFI: High Jack vs Low Jack",219 "raise": ["TT+", "AQ+", "AJs+", "A4s-A5s", "KJs+", "QJs"],220 "raise-or-fold": ["A9s-ATs", "KTs", "99", "76s", "65s", "54s"],221 },222 "CO": {223 "title": "vs RFI: Cut Off vs Low Jack",224 "raise": ["99+", "AQ+", "A9s+", "A4s-A5s", "KTs+", "QJs"],225 "raise-or-fold": ["88", "QTs", "76s", "65s", "54s", "KQ"],226 },227 "BTN": {228 "title": "vs RFI: Button vs Low Jack",229 "raise": ["QQ+", "AK", "AKs", "A4s-A5s", "QTs+"],230 "raise-or-call": ["AQs", "A8s-A9s", "A3s", "KTs", "T9s", "AQ", "KQ", "TT-JJ"],231 "raise-or-fold": ["K9s", "AJ"],232 "raise-call-or-fold": ["98s", "87s", "76s", "65s", "54s"],233 "call": ["ATs-AJs", "KJs+", "JTs", "66-99"],234 "call-or-fold": ["22-55"]235 }236 },237 "vsHJ": {238 "SB": {239 "title": "vs RFI: Small Blind vs High Jack",240 "raise": ["99+", "AQ+", "ATs+", "A5s", "KTs+", "QTs+", "JTs"],241 "raise-or-fold": ["88", "A4s"],242 },243 "BB": {244 "title": "vs RFI: Big Blind vs High Jack",245 "raise": ["QQ+", "AK", "AKs"],246 "raise-or-call": ["A8s-AQs", "A2s-A5s", "KTs+", "K6s-K7s", "Q9s+", "TT-JJ", "JTs", "87s", "76s", "65s", "54s"],247 "call": ["A6s-A7s", "K8s-K9s", "K2s-K5s", "Q6s-Q8s", "J8s-J9s", "T7s+", "96s+", "86s", "75s", "64s", "53s", "43s", "22-99", "AT-AQ", "KJ+", "QJ"],248 "call-or-fold": ["Q3s-Q5s", "J7s", "85s", "74s", "63s", "52s", "42s", "A9", "KT", "QT", "JT"]249 },250 "CO": {251 "title": "vs RFI: Cut Off vs High Jack",252 "raise": ["88+", "AQ+", "A9s+", "A4s-A5s", "KTs+", "QTs+", "JTs", "KQ"],253 "raise-or-fold": ["76s", "65s", "54s", "AJ"],254 },255 "BTN": {256 "title": "vs RFI: Button vs High Jack",257 "raise": ["QQ+", "AK", "AKs", "A4s-A5s", "QTs+"],258 "raise-or-call": ["AQs", "A8s-A9s", "A3s", "KTs+", "Q9s", "J9s+", "T9s", "AQ", "KQ", "TT-JJ"],259 "raise-or-fold": ["A6s", "K9s", "AJ"],260 "raise-call-or-fold": ["A7s", "98s", "87s", "76s", "65s", "54s"],261 "call": ["ATs-AJs", "66-99"],262 "call-or-fold": ["22-55"]263 }264 },265 "vsCO": {266 "SB": {267 "title": "vs RFI: Small Blind vs Cut Off",268 "raise": ["99+", "AQ+", "ATs+", "A5s", "KTs+", "QTs+", "JTs"],269 "raise-or-fold": ["77-88", "A9s", "A4s", "K9s", "J9s", "T9s", "AJ"],270 },271 "BB": {272 "title": "vs RFI: Big Blind vs Cut Off",273 "raise": ["JJ+", "AK", "AQs+"],274 "raise-or-call": ["ATs-AJs", "A2s-A5s", "KTs+", "K6s-K7s", "Q9s+", "Q4s-Q5s", "TT", "J9s+", "T9s", "87s", "76s", "65s", "54s", "KQ"],275 "call": ["A6s-A9s", "K8s-K9s", "K2s-K5s", "Q6s-Q8s", "J7s-J8s", "T7s-T8s", "96s+", "86s", "75s", "64s", "53s", "43s", "22-99", "A9-AQ", "KT-KJ", "QT+", "JT"],276 "call-or-fold": ["Q3s", "J6s", "85s", "74s", "63s", "52s", "42s", "A8", "A5"]277 },278 "BTN": {279 "title": "vs RFI: Button vs Cut Off",280 "raise": ["QQ+", "AK", "AQs+", "QTs+"],281 "raise-or-call": ["A3s-AJs", "KTs+", "Q9s", "J9s+", "T9s", "AJ-AQ", "KQ", "55-JJ"],282 "raise-or-fold": ["K8s", "AT", "KJ"],283 "raise-call-or-fold": ["A2s", "K9s", "98s", "87s", "76s", "65s", "54s"],284 "call-or-fold": ["22-44"]285 }286 },287 "vsBTN": {288 "SB": {289 "title": "vs RFI: Small Blind vs Button",290 "raise": ["77+", "AJ+", "A8s+", "A4s-A5s", "K9s+", "QTs+", "J9s+", "T9s", "KQ"],291 "raise-or-fold": ["55-66", "A7s", "Q9s", "AT", "KJ"],292 },293 "BB": {294 "title": "vs RFI: Big Blind vs Button",295 "raise": ["TT+", "AK", "AQs+", "J9s+", "T9s"],296 "raise-or-call": ["ATs-AJs", "A2s-A5s", "K9s+", "K6s-K7s", "Q8s+", "88-99", "J7s-J8s", 297 "T6s-T8s", "97s+", "87s", "76s", "65s", "54s", "KJ+", "AT-AQ"],298 "call": ["A6s-A9s", "K8s", "K2s-K5s", "Q2s-Q7s", "J4s-J6s", "96s", "85s-86s", "74s-75s", "64s", "53s", "43s", "22-77", "A7-A9", "A5", "K9-KT", "QT+", "J9+", "T9"],299 "call-or-fold": ["63s", "52s", "42s", "A6", "A4", "K8", "Q9", "T8", "98", "87", "76", "65"]300 },301 }302 },303 "cold4bet": {304 "CO": {305 "vsHJ": {306 "title": "Cold 4-Bet: CO vs HJ 3-Bet",307 "raise": ["QQ+", "AK", "AKs"],308 "raise-or-call": ["AQs", "A5s", "KQs"]309 }310 },311 "BTN": {312 "vsHJ": {313 "title": "Cold 4-Bet: BTN vs HJ 3-Bet",314 "raise": ["QQ+", "AK", "AKs"],315 "raise-or-fold": ["AQs", "A5s", "KQs", "JJ"],316 },317 "vsCO": {318 "title": "Cold 4-Bet: BTN vs CO 3-Bet",319 "raise": ["QQ+", "AK", "AQs+", "KQs"],320 "raise-or-fold": ["A5s", "KJs", "AQ", "TT-JJ"],321 }322 },323 "SB": {324 "vsHJ": {325 "title": "Cold 4-Bet: Small Blind vs HJ 3-Bet",326 "raise": ["QQ+", "AKs", "AK"],327 "raise-or-fold": ["AQs", "KQs", "A5s"]328 },329 "vsCO": {330 "title": "Cold 4-Bet: Small Blind vs CO 3-Bet",331 "raise": ["QQ+", "AQs+", "AK", "KQs"],332 "raise-or-fold": ["KJs", "A5s", "JJ"]333 },334 "vsBTN": {335 "title": "Cold 4-Bet: Small Blind vs BTN 3-Bet",336 "raise": ["QQ+", "AQs+", "AK", "KQs"],337 "raise-or-fold": ["AJs", "KJs", "TT-JJ", "AQ"]338 }339 },340 "BB": {341 "vsHJ": {342 "title": "Cold 4-Bet: Big Blind vs HJ 3-Bet",343 "raise": ["QQ+", "AKs", "AK"],344 "raise-or-fold": ["AQs", "A5s", "KQs", "JJ"]345 },346 "vsCO": {347 "title": "Cold 4-Bet: Big Blind vs CO 3-Bet",348 "raise": ["QQ+", "AQs+", "AK", "KQs"],349 "raise-or-fold": ["A5s", "KJs", "JJ", "AQ"]350 },351 "vsBTN": {352 "title": "Cold 4-Bet: Big Blind vs BTN 3-Bet",353 "raise": ["QQ+", "AQs+", "AK", "KQs"],354 "raise-or-fold": ["AJs", "KJs", "TT-JJ", "AQ"]355 }356 },357 "BBvsSB": {358 "vsLJHJ": {359 "title": "Cold 4-Bet: Big Blind vs Small Blind 3-Bet and MP open",360 "raise": ["TT+", "AJs+", "AK", "KJs+"],361 "raise-or-fold": ["AQ"],362 },363 "vsCO": {364 "title": "Cold 4-Bet: Big Blind vs Small Blind 3-Bet and CO open",365 "raise": ["TT+", "AJs+", "AK", "KJs+"],366 "raise-or-fold": ["ATs", "AQ"],367 },368 "vsBTN": {369 "title": "Cold 4-Bet: Big Blind vs Small Blind 3-Bet and BTN open",370 "raise": ["TT+", "AJs+", "AQ+", "KJs+"],371 "raise-or-fold": ["ATs", "KTs", "99"],372 }373 }374 }...
auction.js
Source: auction.js
1import React, { useState, useContext } from 'react'2import { useParams } from 'react-router-dom'3import { AkaSwapContext } from '../../../context/AkaSwapContext'4import { Container } from '../../../components/layout'5import { Loading } from '../../../components/loading'6import { Button, SwapBtn } from '../../../components/button'7// import { getTotalSales } from '../../../utils/sanitise'8import styles from './styles.module.scss'9import { RenderMedia } from '../../../components/render-media'10import { AUCTION_RAISE_RANGE, MIMETYPE, MIN_SWAP_PRICE } from '../../../constants'11import { getLanguage, MAX_AUCTION_PURCHASE_PRICE } from '../../../constants'12import { prepareAuction } from '../../../data/ipfs'13import { ModalInputForm, ModalField } from '../../../components/input-form'1415export const Auction = ({ totalAmount, owners, tokenInfo, address, onDone }) => {16 const language = getLanguage()17 const { id } = useParams()18 const { syncTaquito, makeAuction, acc } = useContext(AkaSwapContext)1920 const [startPrice, setStartPrice] = useState(0)21 const [usePurchasePrice, setUsePurchasePrice] = useState(false)22 const [raiseRange, setRaiseRange] = useState(5)23 const [purchasePrice, setPurchasePrice] = useState(0)24 const [duration, setDuration] = useState(0)2526 // const sales = getTotalSales({ owners, creators: tokenInfo.creators })27 const [progress, setProgress] = useState(false)28 const [message, setMessage] = useState('')2930 const handleSubmit = async () => {3132 if (acc === null) {33 await syncTaquito().catch()34 return;35 }36 if (!duration || duration === '' || duration < 1 || duration > 14 || duration % 1 !== 0) {37 alert(language.alert.duration + language.alert.mustBe + language.alert.integer + language.alert.rangeOf + "[1-14]")38 return;39 }40 if (startPrice < MIN_SWAP_PRICE / 1000000) {41 alert(language.alert.priceLowerThanLimit)42 return;43 }44 if (!raiseRange || raiseRange === '' || !startPrice || startPrice === '') {45 alert(language.alert.emptyInput)46 return47 }48 if ((usePurchasePrice && (!purchasePrice || purchasePrice === '' || purchasePrice < startPrice * 2))) {49 // simple validation for now50 alert(language.alert.purchasePriceLimit)51 } else {52 setProgress(true)53 setMessage('generating auction')54 // makeAuction is valid call API55 // (akaObjId, duration, directPrice, metadata, raisePercentage, startPrice)56 let directPrice = usePurchasePrice ? purchasePrice : MAX_AUCTION_PURCHASE_PRICE;57 let ipfsHash = await prepareAuction({58 title: tokenInfo.name,59 description: tokenInfo.description,60 address: acc.address61 })6263 await makeAuction(id, duration, parseFloat(directPrice) * 1000000, ipfsHash.path, raiseRange, parseFloat(startPrice) * 1000000)64 .then((e) => {65 // when taquito returns a success/fail message66 setProgress(false)67 setMessage(e.description)68 onDone()69 //history.push(`${PATH.ISSUER}/${address}`)70 })71 .catch((e) => {72 setProgress(false)73 window.location.reload()74 setMessage('an error occurred')75 })76 }77787980 }8182 return (8384 <>85 <Container full>86 <div className={styles.auctionPage}>87 <div className={styles.title}>{language.detail.auction.title}</div>88 <div className={styles.thumbnail}>89 {<RenderMedia90 mimeType={MIMETYPE.JPEG}91 uri={tokenInfo.thumbnailUri.split('//')[1]}92 frameColor={tokenInfo.frameColor}93 ></RenderMedia>}94 </div>95 <ModalInputForm>96 <ModalField97 labelRow={language.detail.auction.label.startPrice}98 hint={language.detail.auction.subLabel.startPrice}99 type="number"100 placeholder={language.detail.auction.placeholder.startPrice}101 min={0}102 defaultValue={0}103 onChange={(e) => setStartPrice(e.target.value)}104 disabled={progress}105 />106 <ModalField107 labelRow={language.detail.auction.label.setPurchasePrice}108 hint={language.detail.auction.subLabel.setPurchasePrice}109 type="checkbox"110 onChange={(e) => {111 setUsePurchasePrice(e.target.checked)112 // setFrameColor(e.target.checked? "#202125":null)113 }}114 value={usePurchasePrice}115 checked={usePurchasePrice}116 />117 {usePurchasePrice &&118 <ModalField119 labelRow={language.detail.auction.label.purchasePrice}120 hint={language.detail.auction.subLabel.purchasePrice}121 type="number"122 placeholder={language.detail.auction.placeholder.purchasePrice}123 min={0}124 onChange={(e) => setPurchasePrice(e.target.value)}125 disabled={progress}126 />127 }128 <ModalField129 labelRow={language.detail.auction.label.raise}130 hint={language.detail.auction.subLabel.raise}131 >132 <button133 onClick={(e) => { console.log(raiseRange); setRaiseRange(e.target.value) }}134 value={AUCTION_RAISE_RANGE[0]}135 className={styles.raiseBtn + ' ' + (raiseRange === AUCTION_RAISE_RANGE[0] ? styles.selected : '')}136 >{AUCTION_RAISE_RANGE[0]}%</button>137 <button138 onClick={(e) => setRaiseRange(e.target.value)}139 value={AUCTION_RAISE_RANGE[1]}140 className={styles.raiseBtn + ' ' + (raiseRange === AUCTION_RAISE_RANGE[1] ? styles.selected : '')}141 >{AUCTION_RAISE_RANGE[1]}%</button>142 <button143 onClick={(e) => setRaiseRange(e.target.value)}144 value={AUCTION_RAISE_RANGE[2]}145 className={styles.raiseBtn + ' ' + (raiseRange === AUCTION_RAISE_RANGE[2] ? styles.selected : '')}146 >{AUCTION_RAISE_RANGE[2]}%</button>147148 </ModalField>149 <ModalField150 labelRow={language.detail.auction.label.duration}151 hint={language.detail.auction.subLabel.duration}152 type="number"153 placeholder={language.detail.auction.placeholder.duration}154 min={0}155 max={14}156 onChange={(e) => setDuration(e.target.value)}157 disabled={progress}158 />159 </ModalInputForm>160 {//deprecated161 //<table className={styles.table}>162 // <tbody>163 // <tr className={styles.row}>164 // <td className={styles.label}>{language.detail.auction.label.startPrice}</td>165 // <td rowspan="2" className={styles.input}>166 // <Input167 // type="number"168 // placeholder={language.detail.auction.placeholder.startPrice}169 // min={0}170 // defaultValue={0}171 // onChange={(e) => setStartPrice(e.target.value)}172 // disabled={progress}173 // />174 // </td>175 // </tr>176 // <tr className={styles.subrow}>177 // <td>178 // {language.detail.auction.subLabel.startPrice}179 // </td >180 // </tr>181 // <tr className={styles.row}>182 // <td className={styles.label}>{language.detail.auction.label.setPurchasePrice}</td>183 // <td rowspan="2">184 // <CheckBox185 // type="checkbox"186 // onChange={(e) => {187 // setUsePurchasePrice(e.target.checked)188 // // setFrameColor(e.target.checked? "#202125":null)189 // }}190 // value={usePurchasePrice}191 // checked={usePurchasePrice}192 // />193 // </td>194 // </tr>195 // <tr className={styles.subrow}>196 // <td>197 // {language.detail.auction.subLabel.setPurchasePrice}198 // </td>199 // </tr>200 // {usePurchasePrice && (201 // <>202 // <tr className={styles.row}>203 // <td className={styles.label}>{language.detail.auction.label.purchasePrice}</td>204 // <td rowspan="2" className={styles.input}>205 // <Input206 // type="number"207 // placeholder={language.detail.auction.placeholder.purchasePrice}208 // min={0}209 // onChange={(e) => setPurchasePrice(e.target.value)}210 // disabled={progress}211 // />212 // </td>213 // </tr>214 // <tr className={styles.subrow}>215 // <td>216 // {language.detail.auction.subLabel.purchasePrice}217 // </td>218 // </tr>219 // </>220 // )}221 // <tr className={styles.row}>222 // <td className={styles.label}>{language.detail.auction.label.raise}</td>223 // <td rowspan="2" className={styles.raise}>224 // <button225 // onClick={(e) => { setRaiseRange(e.target.value) }}226 // value={AUCTION_RAISE_RANGE[0]}227 // className={styles.raiseBtn + ' ' + raiseRange === AUCTION_RAISE_RANGE[0] ? styles.selected : ''}228 // >{AUCTION_RAISE_RANGE[0]}%</button>229 // <button230 // onClick={(e) => setRaiseRange(e.target.value)}231 // value={AUCTION_RAISE_RANGE[1]}232 // className={styles.raiseBtn + ' ' + raiseRange === AUCTION_RAISE_RANGE[1] ? styles.selected : ''}233 // >{AUCTION_RAISE_RANGE[1]}%</button>234 // <button235 // onClick={(e) => setRaiseRange(e.target.value)}236 // value={AUCTION_RAISE_RANGE[2]}237 // className={styles.raiseBtn + ' ' + raiseRange === AUCTION_RAISE_RANGE[2] ? styles.selected : ''}238 // >{AUCTION_RAISE_RANGE[2]}%</button>239 // {//<Slider240 // // type="range"241 // // min={1}242 // // max={3}243 // // label={["5%","10%","20%"]}244 // // step={1}245 // // value={raiseRange}246 // // onChange={(e) => {247 // // setRaiseRange(e.target.value)248 // // }}249 // // />250 // }251 // </td>252 // </tr>253 // <tr className={styles.subrow}>254 // <td>255 // {language.detail.auction.subLabel.raise}256 // </td>257 // </tr>258 //259 // <tr className={styles.row}>260 // <td className={styles.label}>{language.detail.auction.label.duration}</td>261 // <td rowspan="2" className={styles.input}>262 // <Input263 // type="number"264 // placeholder={language.detail.auction.placeholder.duration}265 // min={0}266 // max={14}267 // onChange={(e) => setDuration(e.target.value)}268 // disabled={progress}269 // />270 // </td>271 // </tr>272 // <tr className={styles.subrow}>273 // <td>274 // {language.detail.auction.subLabel.duration}275 // </td>276 // </tr>277 // </tbody>278 //</table>279 }280 <Container full>281 <p className={styles.detail}>{language.detail.auction.warning}282 {" - "}283 <a className={styles.link} href="/about/#auctionrules">here</a>284 </p>285 </Container>286 <Button onClick={handleSubmit} disabled={progress}>287 <SwapBtn>{language.detail.auction.cta}</SwapBtn>288 </Button>289 <div>290 <p>{message}</p>291 {progress && <Loading />}292 </div>293 </div>294 </Container >295296297 </>298 )
...
property_documentation.js
Source: property_documentation.js
1[2 {3 "i18n": {4 "hu": {5 "description": "Elmond egy `'feltámasztás'` varázslatot, és #{spells.raise-dead.power} varázspontnyi zombit kelt életre a holttestekbÅl #{spells.raise-dead.duration} idÅre, fele életerŠés sebesség pontokkal. A zombik véletleszerűen kelnek életre #{spells.raise-dead.radius}m távolságon belül.",6 "name": "feltámasztás"7 },8 "bg": {9 "description": "ÐÑави Ð¼Ð°Ð³Ð¸Ñ `'raise-dead'`. ÐагиÑÑа вÑÑÑа Ñила Ð¾Ñ #{spells.raise-dead.power} на ÑÑÑпове вÑв вид на зомбиÑа Ñ Ð½Ð°Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð° Ð¶Ð¸Ð²Ð¾Ñ Ð¸ ÑкоÑоÑÑ Ð·Ð° #{spells.raise-dead.duration} ÑекÑнди. ÐомбиÑаÑа Ð±Ð¸Ð²Ð°Ñ Ð¸Ð·Ð±Ñани на ÑлÑÑаен пÑинÑип Ð¾Ñ ÑÑÑповеÑе на ÑазÑÑоÑние до #{spells.raise-dead.radius} меÑÑа."10 },11 "sr": {12 "description": "Izvedi ' uzdizanje mrtvih' caroliju, vracajuci nazad #{spells.raise-dead.power} snagu lesa u zivot u vidu zombija za vreme od #{spells.raise-dead.duration} na pola zivotnih bodova i brzine. Zombiji su nasumicno izabrani od leseva u opsegu #{spells.raise-dead.radius}"13 },14 "nl-NL": {15 "description": "Voer een \"raise-dead\" spreuk uit, waarmee je voor #{spells.raise-dead.power} kracht aan lijken opnieuw tot leven kunt wekken als zombies voor #{spells.raise-dead.duration} op half hun leven en half hun snelheid. De zombies worden willekeurig gekozen van de lijken die zich binnen een afstand van #{spells.raise-dead.radius}m bevinden. "16 },17 "nl-BE": {18 "description": "Voert een `'raise-dead'` spreuk uit, waarbij lijken tot leven gewekt worden voor #{spells.raise-dead.power} kracht, als zombies aan halve gezondheid en snelheid, gedurende #{spells.raise-dead.duration}. De zombies worden willekeurig gekozen binnen een straal van #{spells.raise-dead.radius}m."19 },20 "el": {21 "description": "ΡίÏνει Îνα ξÏÏκι `ÎνάÏÏαÏÎ·Ï ÎεκÏÏν`, εÏαναÏÎÏονÏÎ±Ï #{spells.raise-dead.power} ÏÏνÏοÏ
Ï Î´ÏÎ½Î±Î¼Î·Ï Î¼ÎµÏοÏ
ÏιÏμÎνοÏ
Ï Ïε ζÏμÏι για ÏÏÏνο #{spells.raise-dead.duration} με Ïη μιÏή ζÏÏική ενÎÏγεια και ÏαÏÏÏηÏα. Τα ζÏμÏι δημιοÏ
ÏγοÏνÏαι ÏÏ
Ïαία αÏÏ ÏÏÏμαÏα ÏοÏ
βÏίÏκονÏαι Ïε ακÏίνα #{spells.raise-dead.radius}m."22 },23 "it": {24 "description": "Lancia un intensimo `'raise-dead'`, riportando #{spells.raise-dead.power} potere ai cadaveri che tornano in vita come zombie per #{spells.raise-dead.duration} con metà vita e velocità . Gli zombie sono scelti casualmente dai corpi entro #{spells.raise-dead.radius}m."25 },26 "pl": {27 "description": "RzuÄ zaklÄcie `'raise-dead'`, przywrÃ³Ä do życia zwÅoki o mocy #{spells.raise-dead.power} jako zombie na czas #{spells.raise-dead.duration} z poÅowÄ
życia i szybkoÅci. Zombiaki sÄ
wybierane losowo ze zwÅok w zasiÄgu #{spells.raise-dead.radius}m."28 },29 "uk": {30 "description": "ÐÐ°ÐºÐ»Ð°Ð´Ð°Ñ Ð·Ð°ÐºÐ»Ð¸Ð½Ð°Ð½Ð½Ñ `'raise-dead'` на ÑÑÐ»Ñ `target`, повеÑÑаÑÑи #{spells.raise-dead.power} енеÑгеÑиÑÐ½Ð¾Ñ Ð²Ð°ÑÑоÑÑÑ ÑÑл до жиÑÑÑ Ñ Ð²Ð¸Ð³Ð»ÑÐ´Ñ Ð·Ð¾Ð¼Ð±Ñ Ð¿ÑоÑÑгом #{spells.raise-dead.power} Ñз Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð¾Ñ Ð·Ð´Ð¾Ñов'Ñ Ñа ÑвидкоÑÑÑ. ÐÐ¾Ð¼Ð±Ñ Ð¾Ð±Ð¸ÑаÑÑÑÑÑ Ð²Ð¸Ð¿Ð°Ð´ÐºÐ¾Ð²Ð¸Ð¼ Ñином Ñз ÑÑÑпÑв Ñ ÑадÑÑÑÑ #{spells.raise-dead.radius} меÑÑÑв."31 },32 "sv": {33 "description": "Kastar en `'raise-dead'`-besvärjelse, vilket hämtar tillbaka en styrka av #{spells.raise-dead.power} kroppar som zombies under #{spells.raise-dead.duration} med halv hälsa och hastighet. Zombies väljs slumpmässigt innom #{spells.raise-dead.radius}m."34 },35 "pt-BR": {36 "description": "Lança um feitiço `\"raise-dead\"`, trazendo de volta à vida #{spells.raise.dead.power} como zumbis por #{spells.raise-dead.duration} com metade da força e velocidade. Os zumbis são escolhidos aleatóriamente dos cadáveres dentro de #{spells.raise-dead.radius}m."37 },38 "es-419": {39 "description": ""40 },41 "sk": {42 "description": "Kúzli `'raise-dead'` prinášajúce späť telá ako zombie v hodnote #{spells.raise-dead.power} na dobu #{spells.raise-dead.duration} sekúnd pri poloviÄnom zdravà a rýchlosti. Zombie sú vyberané náhodne v dosahu #{spells.raise-dead.radius}m."43 },44 "zh-HANS": {45 "description": "æ§è¡`âèµ·æ»åçâ`çåè¯ï¼å¯ä»¥å¸¦å #{spells.raise-dead.power} è½åçå°¸ä½ï¼ä»¥åµå°¸å½¢æï¼åè¡åéï¼æç»åæ´» #{spells.raise-dead.duration} æ¶é´ãè¿äºåµå°¸æ¯å¨æ½æ³å°ç¹#{spells.raise-dead.radius}ç±³å
ï¼éæºå¤æ´»éè¿çå°¸ä½ã"46 },47 "ru": {48 "description": "ÐакладÑÐ²Ð°ÐµÑ Ð·Ð°ÐºÐ»Ð¸Ð½Ð°Ð½Ð¸Ðµ ÐоднÑÑÑ Ð¼ÐµÑÑвеÑов (`'raise-dead'`), воÑкÑеÑÐ°Ñ #{spells.raise-dead.count} ÑÑÑп(ов) в каÑеÑÑве зомби на вÑÐµÐ¼Ñ #{spells.raise-dead.duration} Ñ Ð¿Ð¾Ð»Ð¾Ð²Ð¸Ð½Ð½Ð¾Ð¹ ÑкоÑоÑÑÑÑ Ð¸ жизнÑÑ. Ðомби вÑбиÑаÑÑÑÑ ÑлÑÑайнÑм обÑазом ÑÑеди ÑÑÑпов в ÑадиÑÑе #{spells.raise-dead.radius} м. "49 },50 "fr": {51 "description": "Lance un sort `'raise-dead'`, ramenant #{raiseDeadCount} corps à la vie en tant que zombies pendant #{raiseDeadDuration}s avec la moitié de leur vie et de leur vitesse. Les zombies sont choisis au hasard parmis ceux situés à #{raiseDeadRadius}m max."52 },53 "de-DE": {54 "description": "Wirkt einen `'raise-dead'` Spruch der #{raiseDeadCount} Leichen als Zombies für #{raiseDeadDuration} wiederbelebt. Lebenspunkte und Geschwindigkeit sind halbiert. Die Zombies werden zufällig unter den Leichen innerhalb von #{raiseDeadRadius}m Radius ausgesuht."55 },56 "-": {57 "-": "-"58 }59 },60 "snippets": {61 "io": {62 "tab": "raise-dead",63 "code": "cast(\"raise-dead\")"64 },65 "lua": {66 "tab": "raise-dead",67 "code": "self:cast(\"raise-dead\")"68 },69 "clojure": {70 "tab": "raise-dead",71 "code": "(.cast this \"raise-dead\")"72 },73 "python": {74 "tab": "raise-dead",75 "code": "self.cast(\"raise-dead\")"76 },77 "javascript": {78 "tab": "raise-dead",79 "code": "this.cast(\"raise-dead\")"80 },81 "coffeescript": {82 "tab": "raise-dead",83 "code": "@cast \"raise-dead\""84 }85 },86 "example": {87 "lua": "if self:canCast(\"raise-dead\") then\n self:cast(\"raise-dead\")\nend",88 "io": "if(canCast(\"raise-dead\")) then(\n cast(\"raise-dead\")\n)",89 "clojure": "(if (.canCast this \"raise-dead\")\n (.cast this 'raise-dead'))",90 "python": "if self.canCast('raise-dead'):\n self.cast('raise-dead')",91 "coffeescript": "@cast('raise-dead') if @canCast 'raise-dead'",92 "javascript": "if (this.canCast('raise-dead'))\n this.cast('raise-dead');"93 },94 "description": "Casts a `'raise-dead'` spell, bringing back #{spells.raise-dead.power} power worth of corpses back to life as zombies for #{spells.raise-dead.duration} at half health and speed. The zombies are chosen randomly from corpses within #{spells.raise-dead.radius}m.",95 "type": "function",96 "name": "castRaiseDead"97 }...
index.js
Source: index.js
1export const fetchData = async (username, password, inputChartType, inputPlayerCount, inputHeroPosition, inputVillianPosition, inputSizing) => {2 let url = `https://poker-preflop.herokuapp.com/api/getChartRange/?chartType=${inputChartType}&playerCount=${inputPlayerCount}&heroPosition=${inputHeroPosition}&villianPosition=${inputVillianPosition}&sizing=${inputSizing}`3 let authString = `${username}:${password}`4 let headers = new Headers();5 headers.set('Authorization', 'Basic ' + btoa(authString))6 try {7 const response = await fetch(url, {8 method: 'GET',9 mode: 'cors',10 headers: headers,11 });12 let data = await response.json();13 return data[0];14 } catch (error) {15 console.log(error);16 }17};18export const defaultChart = {19 'AA': {'Raise': 0, 'Call': 0, 'Fold': 1},20 'AKs': {'Raise': 0, 'Call': 0, 'Fold': 1},21 'AQs': {'Raise': 0, 'Call': 0, 'Fold': 0},22 'AJs': {'Raise': 0, 'Call': 0, 'Fold': 0},23 'ATs': {'Raise': 0, 'Call': 0, 'Fold': 0},24 'A9s': {'Raise': 0, 'Call': 0, 'Fold': 0},25 'A8s': {'Raise': 0, 'Call': 0, 'Fold': 0},26 'A7s': {'Raise': 0, 'Call': 0, 'Fold': 0},27 'A6s': {'Raise': 0, 'Call': 0, 'Fold': 0},28 'A5s': {'Raise': 0, 'Call': 0, 'Fold': 0},29 'A4s': {'Raise': 0, 'Call': 0, 'Fold': 0},30 'A3s': {'Raise': 0, 'Call': 0, 'Fold': 1},31 'A2s': {'Raise': 0, 'Call': 0, 'Fold': 1},32 'AKo': {'Raise': 0, 'Call': 0, 'Fold': 1},33 'KK': {'Raise': 0, 'Call': 0, 'Fold': 1},34 'KQs': {'Raise': 0, 'Call': 0, 'Fold': 1},35 'KJs': {'Raise': 0, 'Call': 0, 'Fold': 1},36 'KTs': {'Raise': 0, 'Call': 0, 'Fold': 0},37 'K9s': {'Raise': 0, 'Call': 0, 'Fold': 0},38 'K8s': {'Raise': 0, 'Call': 0, 'Fold': 0},39 'K7s': {'Raise': 0, 'Call': 0, 'Fold': 0},40 'K6s': {'Raise': 0, 'Call': 0, 'Fold': 0},41 'K5s': {'Raise': 0, 'Call': 0, 'Fold': 0},42 'K4s': {'Raise': 0, 'Call': 0, 'Fold': 1},43 'K3s': {'Raise': 0, 'Call': 0, 'Fold': 1},44 'K2s': {'Raise': 0, 'Call': 0, 'Fold': 1},45 'AQo': {'Raise': 0, 'Call': 0, 'Fold': 0},46 'KQo': {'Raise': 0, 'Call': 0, 'Fold': 1},47 'QQ': {'Raise': 0, 'Call': 0, 'Fold': 1},48 'QJs': {'Raise': 0, 'Call': 0, 'Fold': 1},49 'QTs': {'Raise': 0, 'Call': 0, 'Fold': 0},50 'Q9s': {'Raise': 0, 'Call': 0, 'Fold': 0},51 'Q8s': {'Raise': 0, 'Call': 0, 'Fold': 0},52 'Q7s': {'Raise': 0, 'Call': 0, 'Fold': 0},53 'Q6s': {'Raise': 0, 'Call': 0, 'Fold': 0},54 'Q5s': {'Raise': 0, 'Call': 0, 'Fold': 1},55 'Q4s': {'Raise': 0, 'Call': 0, 'Fold': 1},56 'Q3s': {'Raise': 0, 'Call': 0, 'Fold': 1},57 'Q2s': {'Raise': 0, 'Call': 0, 'Fold': 0},58 'AJo': {'Raise': 0, 'Call': 0, 'Fold': 0},59 'KJo': {'Raise': 0, 'Call': 0, 'Fold': 0},60 'QJo': {'Raise': 0, 'Call': 0, 'Fold': 1}, 61 'JJ': {'Raise': 0, 'Call': 0, 'Fold': 1},62 'JTs': {'Raise': 0, 'Call': 0, 'Fold': 1},63 'J9s': {'Raise': 0, 'Call': 0, 'Fold': 0},64 'J8s': {'Raise': 0, 'Call': 0, 'Fold': 0},65 'J7s': {'Raise': 0, 'Call': 0, 'Fold': 0},66 'J6s': {'Raise': 0, 'Call': 0, 'Fold': 1},67 'J5s': {'Raise': 0, 'Call': 0, 'Fold': 1},68 'J4s': {'Raise': 0, 'Call': 0, 'Fold': 1},69 'J3s': {'Raise': 0, 'Call': 0, 'Fold': 0},70 'J2s': {'Raise': 0, 'Call': 0, 'Fold': 0},71 'ATo': {'Raise': 0, 'Call': 0, 'Fold': 0},72 'KTo': {'Raise': 0, 'Call': 0, 'Fold': 0},73 'QTo': {'Raise': 0, 'Call': 0, 'Fold': 0},74 'JTo': {'Raise': 0, 'Call': 0, 'Fold': 1},75 'TT': {'Raise': 0, 'Call': 0, 'Fold': 1},76 'T9s': {'Raise': 0, 'Call': 0, 'Fold': 1},77 'T8s': {'Raise': 0, 'Call': 0, 'Fold': 0},78 'T7s': {'Raise': 0, 'Call': 0, 'Fold': 1},79 'T6s': {'Raise': 0, 'Call': 0, 'Fold': 1},80 'T5s': {'Raise': 0, 'Call': 0, 'Fold': 1},81 'T4s': {'Raise': 0, 'Call': 0, 'Fold': 0},82 'T3s': {'Raise': 0, 'Call': 0, 'Fold': 0},83 'T2s': {'Raise': 0, 'Call': 0, 'Fold': 0},84 'A9o': {'Raise': 0, 'Call': 0, 'Fold': 0},85 'K9o': {'Raise': 0, 'Call': 0, 'Fold': 0},86 'Q9o': {'Raise': 0, 'Call': 0, 'Fold': 0},87 'J9o': {'Raise': 0, 'Call': 0, 'Fold': 0},88 'T9o': {'Raise': 0, 'Call': 0, 'Fold': 1},89 '99': {'Raise': 0, 'Call': 0, 'Fold': 1},90 '98s': {'Raise': 0, 'Call': 0, 'Fold': 1},91 '97s': {'Raise': 0, 'Call': 0, 'Fold': 1},92 '96s': {'Raise': 0, 'Call': 0, 'Fold': 1},93 '95s': {'Raise': 0, 'Call': 0, 'Fold': 0},94 '94s': {'Raise': 0, 'Call': 0, 'Fold': 0},95 '93s': {'Raise': 0, 'Call': 0, 'Fold': 0},96 '92s': {'Raise': 0, 'Call': 0, 'Fold': 0},97 'A8o': {'Raise': 0, 'Call': 0, 'Fold': 0},98 'K8o': {'Raise': 0, 'Call': 0, 'Fold': 0},99 'Q8o': {'Raise': 0, 'Call': 0, 'Fold': 0},100 'J8o': {'Raise': 0, 'Call': 0, 'Fold': 0},101 'T8o': {'Raise': 0, 'Call': 0, 'Fold': 1},102 '98o': {'Raise': 0, 'Call': 0, 'Fold': 1},103 '88': {'Raise': 0, 'Call': 0, 'Fold': 1},104 '87s': {'Raise': 0, 'Call': 0, 'Fold': 1},105 '86s': {'Raise': 0, 'Call': 0, 'Fold': 0},106 '85s': {'Raise': 0, 'Call': 0, 'Fold': 0},107 '84s': {'Raise': 0, 'Call': 0, 'Fold': 0},108 '83s': {'Raise': 0, 'Call': 0, 'Fold': 0},109 '82s': {'Raise': 0, 'Call': 0, 'Fold': 0},110 'A7o': {'Raise': 0, 'Call': 0, 'Fold': 0},111 'K7o': {'Raise': 0, 'Call': 0, 'Fold': 0},112 'Q7o': {'Raise': 0, 'Call': 0, 'Fold': 0},113 'J7o': {'Raise': 0, 'Call': 0, 'Fold': 0},114 'T7o': {'Raise': 0, 'Call': 0, 'Fold': 1},115 '97o': {'Raise': 0, 'Call': 0, 'Fold': 1},116 '87o': {'Raise': 0, 'Call': 0, 'Fold': 1},117 '77': {'Raise': 0, 'Call': 0, 'Fold': 1},118 '76s': {'Raise': 0, 'Call': 0, 'Fold': 1},119 '75s': {'Raise': 0, 'Call': 0, 'Fold': 0},120 '74s': {'Raise': 0, 'Call': 0, 'Fold': 0},121 '73s': {'Raise': 0, 'Call': 0, 'Fold': 0},122 '72s': {'Raise': 0, 'Call': 0, 'Fold': 0},123 'A6o': {'Raise': 0, 'Call': 0, 'Fold': 0},124 'K6o': {'Raise': 0, 'Call': 0, 'Fold': 0},125 'Q6o': {'Raise': 0, 'Call': 0, 'Fold': 0},126 'J6o': {'Raise': 0, 'Call': 0, 'Fold': 1},127 'T6o': {'Raise': 0, 'Call': 0, 'Fold': 1},128 '96o': {'Raise': 0, 'Call': 0, 'Fold': 1},129 '86o': {'Raise': 0, 'Call': 0, 'Fold': 0},130 '76o': {'Raise': 0, 'Call': 0, 'Fold': 1},131 '66': {'Raise': 0, 'Call': 0, 'Fold': 1},132 '65s': {'Raise': 0, 'Call': 0, 'Fold': 1},133 '64s': {'Raise': 0, 'Call': 0, 'Fold': 0},134 '63s': {'Raise': 0, 'Call': 0, 'Fold': 0},135 '62s': {'Raise': 0, 'Call': 0, 'Fold': 0},136 'A5o': {'Raise': 0, 'Call': 0, 'Fold': 0},137 'K5o': {'Raise': 0, 'Call': 0, 'Fold': 0},138 'Q5o': {'Raise': 0, 'Call': 0, 'Fold': 1},139 'J5o': {'Raise': 0, 'Call': 0, 'Fold': 1},140 'T5o': {'Raise': 0, 'Call': 0, 'Fold': 1},141 '95o': {'Raise': 0, 'Call': 0, 'Fold': 0},142 '85o': {'Raise': 0, 'Call': 0, 'Fold': 0},143 '75o': {'Raise': 0, 'Call': 0, 'Fold': 0},144 '65o': {'Raise': 0, 'Call': 0, 'Fold': 1},145 '55': {'Raise': 0, 'Call': 0, 'Fold': 1},146 '54s': {'Raise': 0, 'Call': 0, 'Fold': 1},147 '53s': {'Raise': 0, 'Call': 0, 'Fold': 0},148 '52s': {'Raise': 0, 'Call': 0, 'Fold': 0},149 'A4o': {'Raise': 0, 'Call': 0, 'Fold': 0},150 'K4o': {'Raise': 0, 'Call': 0, 'Fold': 1},151 'Q4o': {'Raise': 0, 'Call': 0, 'Fold': 1},152 'J4o': {'Raise': 0, 'Call': 0, 'Fold': 1},153 'T4o': {'Raise': 0, 'Call': 0, 'Fold': 0},154 '94o': {'Raise': 0, 'Call': 0, 'Fold': 0},155 '84o': {'Raise': 0, 'Call': 0, 'Fold': 0},156 '74o': {'Raise': 0, 'Call': 0, 'Fold': 0},157 '64o': {'Raise': 0, 'Call': 0, 'Fold': 0},158 '54o': {'Raise': 0, 'Call': 0, 'Fold': 1},159 '44': {'Raise': 0, 'Call': 0, 'Fold': 1},160 '43s': {'Raise': 0, 'Call': 0, 'Fold': 1},161 '42s': {'Raise': 0, 'Call': 0, 'Fold': 0},162 'A3o': {'Raise': 0, 'Call': 0, 'Fold': 1},163 'K3o': {'Raise': 0, 'Call': 0, 'Fold': 1},164 'Q3o': {'Raise': 0, 'Call': 0, 'Fold': 1},165 'J3o': {'Raise': 0, 'Call': 0, 'Fold': 0},166 'T3o': {'Raise': 0, 'Call': 0, 'Fold': 0},167 '93o': {'Raise': 0, 'Call': 0, 'Fold': 0},168 '83o': {'Raise': 0, 'Call': 0, 'Fold': 0},169 '73o': {'Raise': 0, 'Call': 0, 'Fold': 0},170 '63o': {'Raise': 0, 'Call': 0, 'Fold': 0},171 '53o': {'Raise': 0, 'Call': 0, 'Fold': 0},172 '43o': {'Raise': 0, 'Call': 0, 'Fold': 1},173 '33': {'Raise': 0, 'Call': 0, 'Fold': 1},174 '32s': {'Raise': 0, 'Call': 0, 'Fold': 1},175 'A2o': {'Raise': 0, 'Call': 0, 'Fold': 1},176 'K2o': {'Raise': 0, 'Call': 0, 'Fold': 1},177 'Q2o': {'Raise': 0, 'Call': 0, 'Fold': 0},178 'J2o': {'Raise': 0, 'Call': 0, 'Fold': 0},179 'T2o': {'Raise': 0, 'Call': 0, 'Fold': 0},180 '92o': {'Raise': 0, 'Call': 0, 'Fold': 0},181 '82o': {'Raise': 0, 'Call': 0, 'Fold': 0},182 '72o': {'Raise': 0, 'Call': 0, 'Fold': 0},183 '62o': {'Raise': 0, 'Call': 0, 'Fold': 0},184 '52o': {'Raise': 0, 'Call': 0, 'Fold': 0},185 '42o': {'Raise': 0, 'Call': 0, 'Fold': 0},186 '32o': {'Raise': 0, 'Call': 0, 'Fold': 1},187 '22': {'Raise': 0, 'Call': 0, 'Fold': 1}...
raiseHandController.js
Source: raiseHandController.js
1var teacherInteractedToUi = false;2var teacherRaiseHandQue = [];3var raiseHandQueueArray = [];4function raiseHand(parser_result){5 teacherRaiseHandQue.push(parser_result);6 var parser_result = teacherRaiseHandQue[0].trim();7 if(!teacherInteractedToUi) {8 teacherInteractedToUi = true;9 handleRaiseHand();10 }11}12function handleRaiseHandQue(){13 teacherInteractedToUi = false14 teacherRaiseHandQue.shift()15 if(teacherRaiseHandQue.length > 0) handleRaiseHand()16}17function handleRaiseHandQueOutSide(){18 teacherInteractedToUi = false19 if(teacherRaiseHandQue.length > 0) handleRaiseHand()20}21function handleRaiseHand(){22 23 var parser_result = teacherRaiseHandQue[0];24 console.log(parser_result);25 26 27 var obj = JSON.parse(parser_result);28 29 var raiseHandStudent = obj.response.raiseHandResult.studentName;30 var raiseHandUserId = obj.response.raiseHandResult.userId;31 var raiseHandProfilePic = obj.response.raiseHandResult.profilePic;32 var raiseHandDuration= obj.response.raiseHandResult.duration;33 var raiseHandText = obj.response.raiseHandResult.raiseHandText;34 35 raiseHandQueue1(parser_result);36 37 /* bootbox.prompt({38 title: raiseHandStudent+ " Asked A Question : "+ raiseHandText,39 buttons: {40 confirm: {41 label: "Answer Now"42 },43 cancel: {44 label: "Add to Queue"45 }46 },47 value: "",48 callback: function(result) {49 if (result === null) {50 51 raiseHandQueue1(parser_result);52 53 } else {54 onPrompt(result,parser_result);55 }56 }57 });*/58 59 60 61 /*debugger62 63 WL.SimpleDialog.show("Raise hand Recived From "+raise_studentName, raiseHandText, [{64 text: 'Answer',65 handler: raiseHandAccept66 },{67 text: 'Add to Queue',68 handler: raiseHandQueue169 }]);*/70}71/*function raiseHandAccept(){72 debugger73 74 WL.Logger.debug("raiseHandAccept");75 76 navigator.notification.prompt(77 raiseHandText, // message78 onPrompt, // callback to invoke79 'CyberClaz', // title80 ['Ok'], // buttonLabels81 '' // defaultText82 );83}84*/85function onPrompt(answer,parser_result) {86 87 88 var obj = JSON.parse(parser_result);89 90 var raiseHandStudent = obj.response.raiseHandResult.studentName;91 var raiseHandUserId = obj.response.raiseHandResult.userId;92 var raiseHandProfilePic = obj.response.raiseHandResult.profilePic;93 var raiseHandDuration= obj.response.raiseHandResult.duration;94 var raiseHandText = obj.response.raiseHandResult.raiseHandText;95 96 97 98 $.ajax({99 url: webServerUrl,100 data: 'request=RaiseHandAnswerNow&logText='+raiseHandStudent+' Asked A Question&userId='+raiseHandUserId+'&duration='+clazDuration+'&RHflag=RHQueueAnswerzz'+'&raiseHandText='+raiseHandText+'&raiseHandAnswer='+answer+'&clazId='+sessionStorage.getItem("classEventId"),101 type: 'post',102 success: function(msg){103 104 105 106 107 var date = new Date(); 108 currentDate = date.getDate(); // Get current date109 month = date.getMonth() + 1; // current month110 hour = date.getHours();111 min = date.getMinutes();112 sec = date.getSeconds(); 113 year = date.getFullYear();114 115 var now = " "+currentDate + "/" + month + "/" + year +" "+ hour + ":" + min + ":" + sec; 116 117 118 119 var addLogs = document.getElementById('addLogs');120 addLogs.innerHTML = '<article style="margin-right:10px;" id="chat-id-1" class="chat-item left"> <a href="javascript:void(0)" class="pull-left thumb-sm avatar"><img src="'+ raiseHandProfilePic + '" class="img-circle"></a> <section class="chat-body"> <div class="panel text-sm m-b-none"> <div class="panel-body" style=" padding: 5px;background-color:#00c6c1;color:#fff; "> <span class="arrow left" style="border-right-color:#00c6c1"></span><span style="font-size:12px; margin-top:-30px;">'+raiseHandStudent+' Asked A Question</span> </div> </div> <small class="text-muted"><i class="fa fa-check text-success"></i> '+ now + '</small> </section> </article>' + addLogs.innerHTML;121 122 123 var raiseHandDoubts = document.getElementById("raiseHandDoubts");124 raiseHandDoubts.innerHTML = '<article id="' + raiseHandText + '" style="" id="chat-id-1" class="chat-item left"> <a href="javascript:void(0)" class="pull-left thumb-sm avatar"><img src="' + raiseHandProfilePic + '" class="img-circle"></a> <section class="chat-body"> <div class="panel text-sm m-b-none"> <div class="panel-body" style=" padding: 5px;background-color:#00c6c1;color:#fff; "> <span class="arrow left" style="border-right-color:#00c6c1;"></span>'+ raiseHandStudent +' : ' + raiseHandText + '<br>You : '+answer+'</div> </div> <small class="text-muted"><i class="fa fa-circle text-success text-xs"></i> </small> Answered </section> </article><br><br>' + raiseHandDoubts.innerHTML;125 126 127 128 }129 });130 131 132 handleRaiseHandQue();133}134function raiseHandQueue1(parser_result){135 136 var obj = JSON.parse(parser_result);137 138 var raiseHandStudent = obj.response.raiseHandResult.studentName;139 var raiseHandUserId = obj.response.raiseHandResult.userId;140 var raiseHandProfilePic = obj.response.raiseHandResult.profilePic;141 var raiseHandDuration= obj.response.raiseHandResult.duration;142 var raiseHandText = obj.response.raiseHandResult.raiseHandText;143 144 145 146 147 148 raiseHandQueueArray.push(parser_result);149 150 151 $.ajax({152 url: webServerUrl,153 data: 'request=raiseHandQueueNotification&raiseDoubt='+raiseHandText+'&raiseUser='+raiseHandUserId,154 type: 'post',155 success: function(msg){156 157 var raiseHandDoubts = document.getElementById("raiseHandDoubts");158 raiseHandDoubts.innerHTML = '<div id="'+ raiseHandText +'"><article style="" id="chat-id-1" class="chat-item left" onclick="answerFromQueue('+queueCount+')"> <a href="javascript:void(0)" class="pull-left thumb-sm avatar"><img src="' + raiseHandProfilePic + '" class="img-circle"></a> <section class="chat-body"> <div class="panel text-sm m-b-none"> <div class="panel-body" style=" padding: 5px;background-color:#FF4747;color:#fff; "> <span class="arrow left" style="border-right-color:#FF4747;"></span>'+ raiseHandStudent +' : ' + raiseHandText + '</div> </div> <small class="text-muted"><i class="fa fa-circle text-danger text-xs"></i> </small> Added In Queue </section> </article></div><br>'+raiseHandDoubts.innerHTML ;159 160 161 162 163 164 165 166 /* raiseHands.raiseHand.push({ 167 "from" :raiseHandUserId,168 "content" :raiseHandText, 169 "studentName" :raiseHandStudent, 170 "raisePic" :raiseHandProfilePic, 171 "index" :queueCount 172 173 });*/174 175 //alert(JSON.stringify(raiseHands));176 177 queueCount++;178 179 180 }181 182 });183 184 handleRaiseHandQue(); 185 186}187function send_raisehand_generalLog(message,raiseHandText,raiseHandAnswer,raise_studentName){188 189 genLogText[genLogCount]=message;190 genLogTime[genLogCount]=timestamp;191 genLogCount++;192 193 message = message.replace(/ /g,'%20');194 raiseHandText = raiseHandText.replace(/ /g,'%20');195 raiseHandAnswer = raiseHandAnswer.replace(/ /g,'%20');196 //alert(raiseHandText);197 var timestamp=time_stamp();198 timestamp = timestamp.replace(/ /g,'%20');199 200 var cur_time = timer_value();201 var duration=cur_time['hour']+":"+ cur_time['min']+":"+ cur_time['sec'];202 203 generalLogObj = new generalLog_controller(); 204 generalLogObj.generalLogRequest(message,timestamp,duration,raiseHandText,raiseHandAnswer,raise_studentName,"0");205 206}207function showtt(ab)208{209 210 var id = ab;211 var whid="#show"+id;212 var ansid="#answer"+id; 213 var txtcon=$(whid).html();214 var raiseQstn = txtcon.replace(/%20/g, " ");215 var txtans=$(ansid).html();216 var raiseAns = txtans.replace(/%20/g, " ");217 teacherInteractedToUi = true218 WL.SimpleDialog.show("CyberClaz", "Question:"+raiseQstn+" Answer:"+raiseAns, [{219 text: 'Ok',220 handler: clickedshowtt221 }]);222 223}224function clickedshowtt(){225 handleRaiseHandQueOutSide()...
tablet-raiseHand.js
Source: tablet-raiseHand.js
1"use strict";2//3// tablet-raiseHand.js4//5// client script that creates a tablet button to raise hand6//7// Created by Triplelexx on 17/04/228// Copyright 2017 High Fidelity, Inc.9//10// Hand icons adapted from https://linearicons.com, created by Perxis https://perxis.com CC BY-SA 4.0 license.11//12// Distributed under the Apache License, Version 2.0.13// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html14//15(function() { // BEGIN LOCAL_SCOPE16 var BUTTON_NAME = "RAISE\nHAND";17 var USERCONNECTION_MESSAGE_CHANNEL = "io.highfidelity.makeUserConnection";18 var DEBUG_PREFIX = "TABLET RAISE HAND: ";19 var isRaiseHandButtonActive = false;20 var animHandlerId;21 var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");22 var button = tablet.addButton({23 text: BUTTON_NAME,24 icon: "icons/tablet-icons/raise-hand-i.svg",25 activeIcon: "icons/tablet-icons/raise-hand-a.svg"26 });27 function onClicked() {28 isRaiseHandButtonActive = !isRaiseHandButtonActive;29 button.editProperties({ isActive: isRaiseHandButtonActive });30 if (isRaiseHandButtonActive) {31 removeAnimation();32 animHandlerId = MyAvatar.addAnimationStateHandler(raiseHandAnimation, []);33 Messages.subscribe(USERCONNECTION_MESSAGE_CHANNEL);34 Messages.messageReceived.connect(messageHandler);35 } else {36 removeAnimation();37 Messages.unsubscribe(USERCONNECTION_MESSAGE_CHANNEL);38 Messages.messageReceived.disconnect(messageHandler);39 }40 }41 function removeAnimation() {42 if (animHandlerId) {43 animHandlerId = MyAvatar.removeAnimationStateHandler(animHandlerId);44 }45 }46 function raiseHandAnimation(animationProperties) {47 // all we are doing here is moving the right hand to a spot that is above the hips.48 var headIndex = MyAvatar.getJointIndex("Head");49 var offset = 0.0;50 var result = {};51 if (headIndex) {52 offset = 0.85 * MyAvatar.getAbsoluteJointTranslationInObjectFrame(headIndex).y;53 }54 var handPos = Vec3.multiply(offset, { x: -0.7, y: 1.25, z: 0.25 });55 result.rightHandPosition = handPos;56 result.rightHandRotation = Quat.fromPitchYawRollDegrees(0, 0, 0);57 return result;58 }59 function messageHandler(channel, messageString, senderID) {60 if (channel !== USERCONNECTION_MESSAGE_CHANNEL && senderID !== MyAvatar.sessionUUID) {61 return;62 }63 var message = {};64 try {65 message = JSON.parse(messageString);66 } catch (e) {67 print(DEBUG_PREFIX + "messageHandler error: " + e);68 }69 switch (message.key) {70 case "waiting":71 case "connecting":72 case "connectionAck":73 case "connectionRequest":74 case "done":75 removeAnimation();76 if (isRaiseHandButtonActive) {77 isRaiseHandButtonActive = false;78 button.editProperties({ isActive: isRaiseHandButtonActive });79 }80 break;81 default:82 print(DEBUG_PREFIX + "messageHandler unknown message: " + message);83 break;84 }85 }86 button.clicked.connect(onClicked);87 Script.scriptEnding.connect(function() {88 Messages.unsubscribe(USERCONNECTION_MESSAGE_CHANNEL);89 Messages.messageReceived.disconnect(messageHandler);90 button.clicked.disconnect(onClicked);91 tablet.removeButton(button);92 removeAnimation();93 });...
EditModelSimple.test.js
Source: EditModelSimple.test.js
1import EditModelSimple from './EditModelSimple';2import { customerFields } from './helpers/fields';3describe('EditModelSimple', () => {4 const model = { id: 12, first_name: 'Fred', last_name: 'Bloggs' };5 const persistedModel = { id: 12 };6 describe('page mode', () => {7 it('should show the edit page view when page mode is true', () => {8 const component = shallow(9 <EditModelSimple10 model={model}11 persistedModel={persistedModel}12 modelFields={customerFields}13 raiseState={jest.fn()}14 pageMode15 />,16 );17 expect(component.find('EditModelPage')).toHaveLength(1);18 expect(component.find('EditModelRow')).toHaveLength(0);19 });20 it('should apply a change and raise state when the action is invoked', () => {21 const raiseState = jest.fn();22 const component = shallow(23 <EditModelSimple24 model={model}25 persistedModel={persistedModel}26 modelFields={customerFields}27 raiseState={raiseState}28 pageMode29 />,30 );31 component.find('EditModelPage').prop('onChange')('first_name', 'Anna');32 expect(raiseState).toHaveBeenCalledTimes(1);33 expect(raiseState).toHaveBeenCalledWith({34 id: 12,35 first_name: 'Anna',36 last_name: 'Bloggs',37 changed: true,38 error_detail: {},39 });40 });41 it('should call raise state with persisted model when reset is invoked', () => {42 const raiseState = jest.fn();43 const component = shallow(44 <EditModelSimple45 model={model}46 persistedModel={persistedModel}47 modelFields={customerFields}48 raiseState={raiseState}49 pageMode50 />,51 );52 component.find('EditModelPage').prop('modelReset')();53 expect(raiseState).toHaveBeenCalledTimes(1);54 expect(raiseState).toHaveBeenCalledWith(persistedModel);55 });56 });57 describe('row mode', () => {58 it('should show the edit row view when page mode is not true', () => {59 const component = shallow(60 <EditModelSimple61 model={model}62 persistedModel={persistedModel}63 modelFields={customerFields}64 raiseState={jest.fn()}65 />,66 );67 expect(component.find('EditModelPage')).toHaveLength(0);68 expect(component.find('EditModelRow')).toHaveLength(1);69 });70 it('should apply a change and raise state when the action is invoked for a row', () => {71 const raiseState = jest.fn();72 const component = shallow(73 <EditModelSimple74 model={model}75 persistedModel={persistedModel}76 modelFields={customerFields}77 raiseState={raiseState}78 />,79 );80 component.find('EditModelRow').prop('onChange')('first_name', 'Anna');81 expect(raiseState).toHaveBeenCalledTimes(1);82 expect(raiseState).toHaveBeenCalledWith({83 id: 12,84 first_name: 'Anna',85 last_name: 'Bloggs',86 changed: true,87 error_detail: {},88 });89 });90 it('should call raise state with persisted model when reset is invoked for a row', () => {91 const raiseState = jest.fn();92 const component = shallow(93 <EditModelSimple94 model={model}95 persistedModel={persistedModel}96 modelFields={customerFields}97 raiseState={raiseState}98 />,99 );100 component.find('EditModelRow').prop('modelReset')();101 expect(raiseState).toHaveBeenCalledTimes(1);102 expect(raiseState).toHaveBeenCalledWith(persistedModel);103 });104 });...
main.js
Source: main.js
...17 map.push( floor.Floor(), { x: x, y: y } )18 }19}2021map.raise( { x: -5, y: -1 }, 7 )22map.raise( { x: -4, y: -1 }, 14 )23map.raise( { x: -3, y: -1 }, 20 )24map.raise( { x: -2, y: -1 }, 20 )25map.raise( { x: -1, y: -1 }, 20 )26map.raise( { x: 0, y: -1 }, 20 )27map.raise( { x: 1, y: -1 }, 20 )28map.raise( { x: 2, y: -1 }, 20 )29map.raise( { x: 3, y: -1 }, 20 )30map.raise( { x: 3, y: 0 }, 14 )31map.raise( { x: 3, y: 1 }, 7 )323334map.raise( { x: -1, y: -2 }, 50 )35map.raise( { x: 0, y: -2 }, 50 )36map.raise( { x: 0, y: -3 }, 50 )37map.raise( { x: -1, y: -3 }, 50 )38map.raise( { x: -2, y: -2 }, 45 )39map.raise( { x: -2, y: -3 }, 39 )40map.raise( { x: -2, y: -4 }, 35 )41map.raise( { x: -1, y: -4 }, 30 )42map.raise( { x: 0, y: -4 }, 25 )43map.raise( { x: 1, y: -4 }, 20 )44map.raise( { x: 1, y: -3 }, 20 )45map.raise( { x: 1, y: -2 }, 20 )4647map.raise( { x: -7, y: 4 }, 50 )48map.raise( { x: 11, y: -4 }, 50 )4950var npc = NPC()51map.push( npc, { x: -1, y: 0 } )52map.push( pc.instance, { x: 0, y: 0 } )5354display.init()55
...
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: `screenshot.png` });7 await browser.close();8})();9This project is [MIT](
Using AI Code Generation
1const { PlaywrightInternalError } = require('@playwright/test');2throw new PlaywrightInternalError('some error');3const { test } = require('@playwright/test');4test('test', async ({ page }) => {5});6module.exports = {7 reporter: [ [ 'list' ], [ 'json', { outputFile: 'test-results.json' } ] ]8};9{10 {11 {12 {13 "error": {14 "stack": "PlaywrightInternalError: some error\n at Object.<anonymous> (/Users/ps/test/test.js:4:11)\n at Module._compile (internal/modules/cjs/loader.js:999:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n at Module.load (internal/modules/cjs/loader.js:863:32)\n at Function.Module._load (internal/modules/cjs/loader.js:708:14)\n at Module.require (internal/modules/cjs/loader.js:887:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object.<anonymous> (/Users/ps/test/test.spec.js:1:1)\n at Module._compile (internal/modules/cjs/loader.js:999:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n at Module.load (internal/modules/cjs/loader.js:863:32)\n at Function.Module._load (internal/modules/cjs/loader.js:708:14)\n at Function.executeUserEntryPoint [as runMain
Using AI Code Generation
1const { Playwright } = require('@playwright/test');2const { InternalError } = Playwright;3const internalError = new InternalError('Internal Error', 'test.js');4internalError.raise();5#### constructor(message, file, line, column)6#### InternalError.raise(message, file, line, column)7#### InternalError.is(error)8#### InternalError.isStrict(error)9[MIT](./LICENSE)
Running Playwright in Azure Function
Jest + Playwright - Test callbacks of event-based DOM library
firefox browser does not start in playwright
Is it possible to get the selector from a locator object in playwright?
How to run a list of test suites in a single file concurrently in jest?
firefox browser does not start in playwright
I played with your example for a while and I got the same errors. These are the things I found that made my example work:
It must be Linux. I know that you mentioned that you picked a Linux plan. But I found that in VS Code that part is hidden, and on the Web the default is Windows. This is important because only the Linux plan runs npm install
on the server.
Make sure that you are building on the server. You can find this option in the VS Code Settings:
Make sure you set the environment variable PLAYWRIGHT_BROWSERS_PATH
, before making the publish.
Check out the latest blogs from LambdaTest on this topic:
Automation frameworks enable automation testers by simplifying the test development and execution activities. A typical automation framework provides an environment for executing test plans and generating repeatable output. They are specialized tools that assist you in your everyday test automation tasks. Whether it is a test runner, an action recording tool, or a web testing tool, it is there to remove all the hard work from building test scripts and leave you with more time to do quality checks. Test Automation is a proven, cost-effective approach to improving software development. Therefore, choosing the best test automation framework can prove crucial to your test results and QA timeframes.
Anyone who has worked in the software industry for a while can tell you stories about projects that were on the verge of failure. Many initiatives fail even before they reach clients, which is especially disheartening when the failure is fully avoidable.
Enterprise resource planning (ERP) is a form of business process management software—typically a suite of integrated applications—that assists a company in managing its operations, interpreting data, and automating various back-office processes. The introduction of a new ERP system is analogous to the introduction of a new product into the market. If the product is not handled appropriately, it will fail, resulting in significant losses for the business. Most significantly, the employees’ time, effort, and morale would suffer as a result of the procedure.
With the rise of Agile, teams have been trying to minimize the gap between the stakeholders and the development team.
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!!