MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / simplify

Method simplify

lib/locator.js:65–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63 }
64
65 simplify() {
66 if (this.isNull()) return null
67 switch (this.type) {
68 case 'by':
69 case 'xpath':
70 return this.value
71 case 'css':
72 return this.value
73 case 'id':
74 return `#${this.value}`
75 case 'name':
76 return `[name="${this.value}"]`
77 case 'fuzzy':
78 return this.value
79 case 'shadow':
80 return { shadow: this.value }
81 case 'pw':
82 return { pw: this.value }
83 case 'role':
84 return `[role="${this.value}"]`
85 }
86 return this.value
87 }
88
89 toStrict() {
90 if (!this.type) return null

Callers 1

waitForTextMethod · 0.95

Calls 1

isNullMethod · 0.95

Tested by

no test coverage detected