Skip to content

Commit

Permalink
fix(codegen): fix unselect issue (#33076)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsmfm authored Oct 13, 2024
1 parent 699f51b commit 0a63427
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/codegen/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class JavaLanguageGenerator implements LanguageGenerator {
case 'navigate':
return `${subject}.navigate(${quote(action.url)});`;
case 'select':
return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.selectOption(${formatSelectOption(action.options.length > 1 ? action.options : action.options[0])});`;
return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.selectOption(${formatSelectOption(action.options.length === 1 ? action.options[0] : action.options)});`;
case 'assertText':
return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).${action.substring ? 'containsText' : 'hasText'}(${quote(action.text)});`;
case 'assertChecked':
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/codegen/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class JavaScriptLanguageGenerator implements LanguageGenerator {
case 'navigate':
return `await ${subject}.goto(${quote(action.url)});`;
case 'select':
return `await ${subject}.${this._asLocator(action.selector)}.selectOption(${formatObject(action.options.length > 1 ? action.options : action.options[0])});`;
return `await ${subject}.${this._asLocator(action.selector)}.selectOption(${formatObject(action.options.length === 1 ? action.options[0] : action.options)});`;
case 'assertText':
return `${this._isTest ? '' : '// '}await expect(${subject}.${this._asLocator(action.selector)}).${action.substring ? 'toContainText' : 'toHaveText'}(${quote(action.text)});`;
case 'assertChecked':
Expand Down

0 comments on commit 0a63427

Please sign in to comment.