bruno
bruno copied to clipboard
Improvements in Playwright setup and added tests for running bruno-testbench
- Trace will capture UI snapshots now.
- Trace is on in local by default and will be captured during retry when a test fails in CI.
- UI snapshots gives the ability to inspect the page while viewing the traces. Helps with debugging failed tests and finding better locators.
- Improved test Fixtures
- Use a tempdir for
userDatafor all instances of the app during test run. - Added ability to run tests with user-data presets(preferences, security settings, etc.) using
pageWithUserDataFixture.- For a given folder inside
e2e-tests, if there is a folder namedinit-user-data, all the files within it will get copied to theuserDatalocation of a dedicated Bruno Electron app instance. - That dedicated app instance will be used for all the tests in that folder that uses
pageWithUserDatafixture({pageWithUserData: page}). {{projectRoot}}(literal text) within those files(e.g.preferences.json) will get replaced with the absolute path of the current project/repo's path. This will be useful to make it env agnostic whether its between contributors or its running in CI.
- For a given folder inside
createTmpDirFixture can be used to create temporary folder which can be provided as Location to create collections.- Ability to create tests with fresh user-data(
newPageFixture).
- Use a tempdir for
- Improved logging
- All electron logs will be prefixed with
[Electron #<worker id>] |to differentiate the logs.
- All electron logs will be prefixed with
- Improved the env vars to customize the Electron
userDatapath.ELECTRON_USER_DATA_PATHenv var can now be used modify the ElectronuserDatapath.
Test Results
1 files ±0 112 suites ±0 1m 3s ⏱️ +24s 172 tests ±0 172 ✅ +2 0 💤 ±0 0 ❌ - 2 230 runs ±0 229 ✅ +2 1 💤 ±0 0 ❌ - 2
Results for commit 6b380dc0. ± Comparison against base commit 7c07488e.
:recycle: This comment has been updated with latest results.
CLI Test Results
1 files 113 suites 36s ⏱️ 175 tests 175 ✅ 0 💤 0 ❌ 233 runs 232 ✅ 1 💤 0 ❌
Results for commit a006fe82.
:recycle: This comment has been updated with latest results.
if time permits, please add the following eslint config
... const playwright = require('eslint-plugin-playwright'); ... { files: ["e2e-tests/**/*.{js,ts}"], ignores: ["**/*.config.js"], extends: [playwright.configs['flat/recommended']], languageOptions: { globals: { ...globals.node } }, rules: { "no-undef": "error", "indent": ["error", 2], "no-unused-vars": "error", // Common test-friendly rules "no-unused-expressions": "off", "max-lines-per-function": "off", "no-await-in-loop": "off", // Playwright tests often need sequential awaits "no-restricted-syntax": "off", // Allow for...of loops which are common in Playwright "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0, "maxBOF": 0 }], "padding-line-between-statements": [ "error", // Add blank line before return statements { blankLine: "always", prev: "*", next: "return" }, ] } }
skipping this since its not in the scope of this PR