Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/selenium-ide/src/neo/__test__/models/Command.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/selenium-ide/src/neo/models/Command/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down