()
| 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 |