import { LocatorBuilder , EvaluateFn } from '../types' ; export class TagNameLocator implements LocatorBuilder { constructor ( public tagName ) { } get pageFuncArgs ( ) : string [ ] { return [ this . tagName ] ; } get pageFunc ( ) : EvaluateFn { return ( tagName , node ? ) => ( node ?? document ) . getElementsByTagName ( tagName ) [ 0 ] ; } get pageFuncMany ( ) : EvaluateFn { return ( tagName , node ? ) => ( node ?? document ) . getElementsByTagName ( tagName ) ; } toString ( ) { return `element with tagName "${ this . tagName }"` ; } }