Skip to content

Commit

Permalink
chore: enable playwright test extension in vscode (#13135)
Browse files Browse the repository at this point in the history
* chore: enable playwright test extension in vscode

This enables using the vscode debugger in playwright tests
  • Loading branch information
Emyrk committed May 2, 2024
1 parent 699e187 commit 7779c0a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions site/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ pnpm build
pnpm playwright:test
```

To run the playwright debugger from VSCode, just launch VSCode from the nix
environment and have the extension installed.

```shell
# Optionally add '--command zsh' to choose your shell.
nix develop
code .
```

# Enterprise tests

Enterprise tests require a license key to run.
Expand Down
9 changes: 8 additions & 1 deletion site/e2e/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ class CoderReporter implements Reporter {
}
}

const logLines = (chunk: string): string[] => chunk.trimEnd().split("\n");
const logLines = (chunk: string | Buffer): string[] => {
if (chunk instanceof Buffer) {
// When running in a debugger, the input to this is a Buffer instead of a string.
// Unsure why, but this prevents the `trimEnd` from throwing an error.
return [chunk.toString()];
}
return chunk.trimEnd().split("\n");
};

const exportDebugPprof = async (outputFile: string) => {
const response = await axiosInstance.get(
Expand Down

0 comments on commit 7779c0a

Please sign in to comment.