diff --git a/packages/selenium-ide/src/neo/__test__/models/Command.spec.js b/packages/selenium-ide/src/neo/__test__/models/Command.spec.js index 3a8ebe87c3..73b92e03cb 100644 --- a/packages/selenium-ide/src/neo/__test__/models/Command.spec.js +++ b/packages/selenium-ide/src/neo/__test__/models/Command.spec.js @@ -206,6 +206,20 @@ describe('Command', () => { expect(command.windowTimeout).toBe(jsRepresentation.windowTimeout) expect(command instanceof Command).toBeTruthy() }) + + it('should not overridden value when replace command', () => { + const command = new Command() + command.setCommand('assert text') + command.setValue('Hello World') + command.setCommand('wait for element present') + expect(command.value).toBe('Hello World') + }) + + it("should not set value for commands that do not start with 'wait for'", () => { + const command = new Command() + command.setCommand('click') + expect(command.value).toBe('') + }) }) describe('Commands enum', () => { diff --git a/packages/selenium-ide/src/neo/models/Command/index.js b/packages/selenium-ide/src/neo/models/Command/index.js index 4822b85c4f..c426700e18 100644 --- a/packages/selenium-ide/src/neo/models/Command/index.js +++ b/packages/selenium-ide/src/neo/models/Command/index.js @@ -106,6 +106,10 @@ export default class Command { if (!this.canHaveTargets) { this.setTargets() } + + if (this.command.indexOf('waitFor') > -1 && this.value === '') { + this.setValue('30000') + } } @action.bound