MCPcopy
hub / github.com/vercel/next.js / elementsByCss

Method elementsByCss

test/lib/browsers/playwright.ts:510–524  ·  view source on GitHub ↗
(selector: string)

Source from the content-addressed store, hash-verified

508 }
509
510 elementsByCss(selector: string) {
511 return this.startChain(() =>
512 page.$$(selector).then((els) => {
513 return els.map((el) => {
514 const origGetAttribute = el.getAttribute.bind(el)
515 el.getAttribute = (name) => {
516 // ensure getAttribute defaults to empty string to
517 // match selenium
518 return origGetAttribute(name).then((val) => val || '')
519 }
520 return el
521 })
522 })
523 )
524 }
525
526 waitForElementByCss(selector: string, opts: number | ElementByCssOpts = {}) {
527 const {

Callers 15

index.test.tsFile · 0.80
index.test.tsFile · 0.80
hasAnotherScriptFunction · 0.80
hasSsgScriptFunction · 0.80
getImageUrlsFunction · 0.80
runTestsFunction · 0.80
getImageUrlsFunction · 0.80
didPrefetchFunction · 0.80
getImageUrlsFunction · 0.80
runTestsFunction · 0.80

Calls 4

startChainMethod · 0.95
thenMethod · 0.80
mapMethod · 0.45
bindMethod · 0.45

Tested by 15

hasAnotherScriptFunction · 0.64
hasSsgScriptFunction · 0.64
getImageUrlsFunction · 0.64
runTestsFunction · 0.64
getImageUrlsFunction · 0.64
didPrefetchFunction · 0.64
getImageUrlsFunction · 0.64
runTestsFunction · 0.64
getImageUrlsFunction · 0.64
runTestsFunction · 0.64