Skip to content

Commit

Permalink
Add Window Timeout text field to command editor, for commands that ar…
Browse files Browse the repository at this point in the history
…e flagged as opening new windows
  • Loading branch information
AlexGarrity authored and toddtarsi committed May 18, 2024
1 parent 2903952 commit 21f4d1a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
2 changes: 2 additions & 0 deletions packages/selenium-ide/src/browser/I18N/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ const testCore = {
value: 'Value',
windowHandleName: 'Window Handle Name',
windowHandleNameNote: 'Variable name to set to the new window handle',
windowTimeout: 'Window Timeout',
windowTimeoutNote: 'The amount of time to wait for the window to open (in milliseconds)',
commands: 'Commands',
tabCommand: 'Cmd',
tabTarget: 'Target',
Expand Down
2 changes: 2 additions & 0 deletions packages/selenium-ide/src/browser/I18N/zh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ const testCore = {
value: '指令值',
windowHandleName: '窗口句柄名称',
windowHandleNameNote: '要设置为新窗口句柄的变量名称',
windowTimeout: '窗口超时',
windowTimeoutNote: '等待窗口打开的时间量(以毫秒为单位)',
commands: '指令集',
tabCommand: '指令',
tabTarget: '关键字',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,32 @@ const CommandEditor: FC<CommandEditorProps> = ({
<ArgField command={correctedCommand} {...props} fieldName="target" />
<ArgField command={correctedCommand} {...props} fieldName="value" />
{command.opensWindow && (
<CommandTextField
command={correctedCommand}
{...props}
fieldName={
intl.formatMessage({
id: languageMap.testCore.windowHandleName,
}) as 'windowHandleName'
}
note={intl.formatMessage({
id: languageMap.testCore.windowHandleNameNote,
})}
/>
<>
<CommandTextField
command={correctedCommand}
{...props}
fieldName={
intl.formatMessage({
id: languageMap.testCore.windowHandleName,
}) as 'windowHandleName'
}
note={intl.formatMessage({
id: languageMap.testCore.windowHandleNameNote,
})}
/>
<CommandTextField
command={correctedCommand}
{...props}
fieldName={
intl.formatMessage({
id: languageMap.testCore.windowTimeout,
}) as 'windowTimeout'
}
note={intl.formatMessage({
id: languageMap.testCore.windowTimeoutNote,
})}
/>
</>
)}
<CommandTextField
command={correctedCommand}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface CommandArgFieldProps extends CommandEditorProps {
}

export interface CommandFieldProps extends CommandEditorProps {
fieldName: 'comment' | 'windowHandleName' | LocatorFields
fieldName: 'comment' | 'windowHandleName' | 'windowTimeout' | LocatorFields
note?: string
}

Expand Down

0 comments on commit 21f4d1a

Please sign in to comment.