Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ScriptRunner open_file_dialog #1814

Merged
merged 2 commits into from
Jan 8, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<v-file-input
label="Choose File"
v-model="inputValue"
:rules="fileInputRules"
autofocus
data-test="file-input"
:accept="filter"
Expand Down Expand Up @@ -102,6 +103,8 @@ export default {
data() {
return {
inputValue: null,
valid: null,
fileInputRules: [(value) => !!value?.length || 'Required'],
}
},
computed: {
Expand Down
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',
)
})
Loading