Repository navigation
feat: optional Allure helpers and an Allure report for every e2e run - #1
Merged
Merged
Conversation
- @alttester/driver/allure: createLogRecorder, attachScreenshot, attachHighlightedScreenshot, attachHierarchy, attachLog and attachFailureEvidence. allure-js-commons is an optional peer dependency; no other entry point imports it. - The e2e suite writes Allure results on every run. Failed tests get the game screenshot and the test file's driver log. CI builds the report whether the run passed or failed and uploads it as the allure-report artifact.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Allure reporting in two parts.
1.
@alttester/driver/allure, an optional entry pointIt attaches AltTester material to the test that is running, in any runner with an Allure adapter (allure-vitest, allure-mocha, allure-jest, allure-playwright,
@wdio/allure-reporter).createLogRecorder(): a logger forAltDriver.connect({ enableLogging })that keeps the last 500 lines in memory instead of printing them.attachScreenshot,attachHighlightedScreenshot,attachHierarchy,attachLog: one item each.attachFailureEvidence(driver, { log, object, hierarchy }): what a failed test needs. An item it can't collect (the app crashed, or the driver isn't connected) becomes a "not available" note, and the function never throws.allure-js-commonsis an optional peer dependency and stays external in the build. No other entry point imports it: the builtindex,protocolandnodefiles don't reference it, so users who don't use Allure install nothing extra.2. An Allure report for every e2e run
vitest.e2e.config.tsadds the allure-vitest reporter and emptiesallure-results/at the start of each run.test/e2e/allure.setup.tsattaches the game screenshot and the test file's driver log to every failed test.e2e.ymlbuilds the report after every run, passed or failed, and uploads it as theallure-reportartifact (kept 7 days, the org maximum).npm run reportandnpm run report:opendo the same locally.Checks
npm run typecheck,npm test(170 passed, 6 of them new for the helper) andnpm run build.allure-results, the passed one had nothing attached, andnpm run reportbuiltallure-report/.