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

[3.0] Refined allure-js-commons #909

Merged
merged 84 commits into from
May 16, 2024
Merged

[3.0] Refined allure-js-commons #909

merged 84 commits into from
May 16, 2024

Conversation

epszaw
Copy link
Member

@epszaw epszaw commented Mar 20, 2024

Context

This is major allure-js-commons refactoring. The main issue with the current implementation is that each integration provides its own Runtime API. So, it's impossible to create 2nd level integrations (e.g. allure-selenium or allure-axios). Besides, there is some inconsistency with the API's.

The other issue is that commons used to be node-only. In the latest release, we added browser implementation. This PR will adopt it even further, completely replacing the old commons.

The goal of the change is to expose Runtime API from allure-js-commons:

import { label } from "allure-js-commons"

it("test", async() => {
   await label("name", "value");
});

The code above will work in all the supported frameworks.

New Commons architecture:

  1. New TestRuntime interface. Provides abstraction for allure-js-commons. All the Runtime API will use TestRuntime, exposed in globalThis.allureTestRuntime variable. Each integration needs to implement its own TestRuntime and ensure it is configured and set to globalise in every scope where Runtime API is supported (e.g. in worker threads in case of parallel execution).
  2. Allure Facade — Runtime API methods (exposed as two namespaces, allure-js-commons for async and allure-js-commons/sync for sync alternatives).
  3. SDK - set of interfaces and utils used to develop new integrations, such as ReporterRuntime (unified way to store Allure State), Writers, Crypro (node & browser), TestPlan, etc.

Linked issues

fixes #801

All the issues that should be addressed in this PR: https://github.com/allure-framework/allure-js/milestone/1

Checklist

epszaw added 4 commits May 13, 2024 19:24
fix typescript errors
add some minor change to lifecycle state class
@baev baev marked this pull request as ready for review May 16, 2024 10:02
@baev baev merged commit 2584bfe into main May 16, 2024
8 checks passed
@baev baev deleted the new-lifecycle branch May 16, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to assign custom names for any attachments
3 participants