-
Notifications
You must be signed in to change notification settings - Fork 8
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
Mappings from video and starting tests already in trace mode #42
Comments
Hi, Can you try the |
@thenbe In VSC playwright starts tests in trace viewer every time, so it seems like it collects attachments in real-time. 2024-11-10.10-52-29.movIs it possible to start tests in the tracer viewer every time? |
Ahh I see what you mean by trace viewer now (as opposed to the inspector). I'm not quite sure what's a good way to approach this as I haven't used playwright heavily since the the trace viewer was introduced.
I couldn't find one, but is there a way to do this purely through the playwright cli? If so, then we should be able to do it in neotest-playwright too. I can see that the FWIW, I feel like this behavior is not what I would expect as a user, so perhaps this is something that will be changed in a future version of playwright? When passing the I'm on playwright |
As for the mappings, these are what I currently have mapped. Although they've changed a fair bit from the time the video was created. {
'nvim-neotest/neotest',
cond = not vim.g.started_by_foreign,
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-treesitter/nvim-treesitter',
'nvim-neotest/nvim-nio',
{
'thenbe/neotest-playwright',
dependencies = 'nvim-neotest/neotest', -- this is needed to avoid an error when neotest is lazy-loaded as a result of a key defined in neotest-playwright's config
dev = false,
keys = {
{ '<leader>t.', '<cmd>NeotestPlaywrightRefresh<cr>', desc = '[test] [playwright] Refresh' },
{ '<leader>tp', '<cmd>NeotestPlaywrightProject<cr>', desc = '[test] [playwright] Set projects' },
{ '<leader>te', '<cmd>NeotestPlaywrightPreset<cr>', desc = '[test] [playwright] Set preset' },
-- stylua: ignore
{ '<leader>Ta', function() require('neotest').playwright.attachment() end, desc = '[test] [playwright] Launch attachment' },
},
},
},
keys = {
-- stylua: ignore start
{ '<leader>tr', function() require('neotest').run.run() end, desc = '[test] Run test' },
{ '<leader>tR', function() require('neotest').run.run(vim.fn.expand('%')) end, desc = '[test] Run tests in file' },
{ '<leader>ts', function() require('neotest').run.stop() end, desc = '[test] Stop test' },
{ '<leader>tO', function() require('neotest').output.open({ enter = true }) end, desc = '[test] Open output' },
{ '<leader>Tt', function() require('neotest.consumers.summary').toggle() end, desc = '[test] Toggle test tree' },
{ '<leader>To', function() require('neotest.consumers.output_panel').toggle() end, desc = '[test] Toggle output panel' },
-- stylua: ignore end
},
config = function()
require('neotest').setup({
-- log_level = vim.log.levels.DEBUG,
adapters = {
require('neotest-playwright').adapter({
options = {
preset = 'none', -- "none" | "headed" | "debug"
persist_project_selection = true,
enable_dynamic_test_discovery = true,
-- filter_dir = function(name, rel_path, root) return name ~= 'node_modules' end,
---@param file_path string
is_test_file = function(file_path)
local result = file_path:find('%.test%.[tj]sx?$') ~= nil -- enforce extension
-- local result = file_path:find('tests/.*%.test%.[jt]sx?$') ~= nil -- enforce directory and extension
-- P({ 'is_test_file', result, file_path })
return result
end,
experimental = {
telescope = {
enabled = true,
-- opts = {},
},
},
},
}),
},
consumers = {
playwright = require('neotest-playwright.consumers').consumers,
},
})
end,
}, |
Hi,
Mighty contributors of this amazing project, could you share mappings from the demo video with us?
Is it possible to start the test already in trace mode, to easily revert the history of the test?
Thanks and good job, excellent plugin :)
The text was updated successfully, but these errors were encountered: