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

feat: Websocket communication between k6 Studio and browser #382

Conversation

allansson
Copy link
Collaborator

Description

This PR sets up WebSocket communication between k6 Studio and the recorded browser. It currently only sends a dummy event to the server and is logged in the renderer process.

How to Test

  1. Start a recording.
  2. Open up DevTools in k6 Studio.
  3. You should see a message being logged every ~5 seconds.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

Related PR(s)/Issue(s)

Closes https://github.com/grafana/k6-cloud/issues/3087

@allansson allansson changed the base branch from main to wip/browser-recording December 16, 2024 09:14
@@ -23,7 +24,7 @@ export default defineConfig((env) => {
external,
},
},
plugins: [pluginHotRestart('restart')],
plugins: [pluginHotRestart('restart'), tsconfigPaths()],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows the main process to use @/ import paths.

@@ -22,7 +23,7 @@ export default defineConfig((env) => {
},
},
},
plugins: [pluginHotRestart('reload')],
plugins: [pluginHotRestart('reload'), tsconfigPaths()],
Copy link
Collaborator Author

@allansson allansson Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows the preload process to use @/ import paths.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed we're going to want to write zod schemas for recordings, i.e. HAR files, at some point so I structured this like we've done with generator/settings schemas.

@allansson allansson marked this pull request as ready for review December 16, 2024 09:25
@allansson allansson requested a review from a team as a code owner December 16, 2024 09:25
@allansson allansson requested review from going-confetti, cristianoventura and e-fisher and removed request for a team and cristianoventura December 16, 2024 09:25
Copy link
Collaborator

@going-confetti going-confetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@allansson allansson merged commit 95e17e8 into wip/browser-recording Dec 17, 2024
1 check passed
@allansson allansson deleted the feat/websocket-communication-between-studio-and-extension branch December 17, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants