Skip to content

Commit

Permalink
Fix open_file_dialog playwright test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-pratt committed Jan 8, 2025
1 parent a682dd9 commit 75eacc8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions playwright/tests/script-runner/prompts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ test('opens a dialog for prompt', async ({ page, utils }) => {
await expect(page.locator('[data-test=state] input')).toHaveValue('stopped')
})

// Opening a file dialog might not be possible in a Github action?
test.skip('opens a file dialog', async ({ page, utils }) => {
test('opens a file dialog', async ({ page, utils }) => {
await page.locator('textarea').fill(`
file = open_file_dialog("Open a single file", "Choose something interesting")
puts file.read
Expand Down Expand Up @@ -320,15 +319,15 @@ test.skip('opens a file dialog', async ({ page, utils }) => {
// It is important to call waitForEvent before click to set up waiting.
page.waitForEvent('filechooser'),
// Open the file chooser
page.locator('text=Choose File').click(),
page.getByLabel('Choose File').first().click(),
])
await fileChooser.setFiles('.env')
await fileChooser.setFiles('package.json')
await page.locator('.v-dialog >> button:has-text("Ok")').click()
await expect(page.locator('[data-test=state] input')).toHaveValue('stopped')
await expect(page.locator('[data-test=output-messages]')).toContainText(
'File(s): [".env"]',
'File(s): ["package.json"]',
)
await expect(page.locator('[data-test=output-messages]')).toContainText(
'RUBYGEMS_URL',
'devDependencies',
)
})

0 comments on commit 75eacc8

Please sign in to comment.