Updated executeScript to use data-attributes

pull/1/head
ioedeveloper 5 years ago
parent 61faa0f666
commit a2853a8a58
  1. 1
      src/app/panels/terminal.js
  2. 4
      test-browser/commands/executeScript.js

@ -120,6 +120,7 @@ class Terminal extends Plugin {
self._view.input.setAttribute('spellcheck', 'false') self._view.input.setAttribute('spellcheck', 'false')
self._view.input.setAttribute('contenteditable', 'true') self._view.input.setAttribute('contenteditable', 'true')
self._view.input.setAttribute('id', 'terminalCliInput') self._view.input.setAttribute('id', 'terminalCliInput')
self._view.input.setAttribute('data-id', 'terminalCliInput')
self._view.input.innerText = '\n' self._view.input.innerText = '\n'
self._view.cli = yo` self._view.cli = yo`

@ -3,8 +3,8 @@ const EventEmitter = require('events')
class ExecuteScript extends EventEmitter { class ExecuteScript extends EventEmitter {
command (script) { command (script) {
this.api this.api
.clearValue('#terminalCliInput') .clearValue('span[data-id="terminalCliInput"]')
.click('#terminalCli') .click('div[data-id="terminalCli"]')
.keys(script) .keys(script)
.keys(this.api.Keys.ENTER) .keys(this.api.Keys.ENTER)
.keys(this.api.Keys.ENTER) // that's a bug... sometimes we need to press 2 times to execute a command .keys(this.api.Keys.ENTER) // that's a bug... sometimes we need to press 2 times to execute a command

Loading…
Cancel
Save