allure-js-commons
- Version 2.15.1
- Published
- 636 kB
- 3 dependencies
- Apache-2.0 license
Install
npm i allure-js-commons
yarn add allure-js-commons
pnpm add allure-js-commons
Overview
Allure JS Commons
Index
Variables
Functions
Classes
Interfaces
Enums
Type Aliases
Variables
variable allureIdRegexp
const allureIdRegexp: RegExp;
variable allureIdRegexpGlobal
const allureIdRegexpGlobal: RegExp;
variable allureLabelRegexp
const allureLabelRegexp: RegExp;
variable allureLabelRegexpGlobal
const allureLabelRegexpGlobal: RegExp;
Functions
function allureReportFolder
allureReportFolder: (outputFolder?: string) => string;
function escapeRegExp
escapeRegExp: (value: string) => string;
function extractMetadataFromString
extractMetadataFromString: (title: string) => { labels: Label[]; cleanTitle: string;};
function getLabelsFromEnv
getLabelsFromEnv: () => Label[];
function getStatusFromError
getStatusFromError: (error: Error) => Status;
function getSuitesLabels
getSuitesLabels: (suites: string[]) => Label[];
function isAnyStepFailed
isAnyStepFailed: (item: ExecutableItem) => boolean;
function isPromise
isPromise: (obj: any) => boolean;
function md5
md5: (data: string) => string;
function parseTestPlan
parseTestPlan: () => TestPlanV1 | undefined;
function readImageAsBase64
readImageAsBase64: (filePath: string) => Promise<string | undefined>;
function serialize
serialize: (val: unknown) => string;
function stripAscii
stripAscii: (str: string) => string;
function typeToExtension
typeToExtension: (options: AttachmentOptions) => string;
Classes
class Allure
abstract class Allure implements Omit<AllureRuntimeApiInterface, 'step' | 'attachment'> {}
constructor
protected constructor(runtime: AllureRuntime);
property currentExecutable
readonly currentExecutable: ExecutableItemWrapper;
property currentTest
readonly currentTest: AllureTest;
property runtime
protected runtime: AllureRuntime;
method attachment
abstract attachment: ( name: string, content: Buffer | string, options: ContentType | string | AttachmentOptions) => void;
method description
description: (markdown: string) => void;
method descriptionHtml
descriptionHtml: (html: string) => void;
method epic
epic: (epic: string) => void;
method feature
feature: (feature: string) => void;
method historyId
historyId: (id: string) => void;
method id
id: (allureId: string) => void;
method issue
issue: (name: string, url: string) => void;
method label
label: (name: string, value: string) => void;
method layer
layer: (layer: string) => void;
method link
link: (url: string, name?: string, type?: string) => void;
method logStep
abstract logStep: (name: string, status?: Status) => void;
method owner
owner: (owner: string) => void;
method parameter
parameter: (name: string, value: any, options?: ParameterOptions) => void;
method parentSuite
parentSuite: (name: string) => void;
method severity
severity: (severity: string) => void;
method step
abstract step: <T>(name: string, body: (step: StepInterface) => T) => T;
method story
story: (story: string) => void;
method subSuite
subSuite: (name: string) => void;
method suite
suite: (name: string) => void;
method tag
tag: (tag: string) => void;
method testCaseId
testCaseId: (id: string) => void;
method tms
tms: (name: string, url: string) => void;
method writeCategoriesDefinitions
writeCategoriesDefinitions: (categories: Category[]) => void;
method writeEnvironmentInfo
writeEnvironmentInfo: (info: Record<string, string>) => void;
class AllureCommandStepExecutable
class AllureCommandStepExecutable implements AllureCommandStep {}
constructor
constructor(name: string);
property attachments
attachments: AttachmentMetadata[];
property metadata
metadata: MetadataMessage;
property name
name: string;
method attach
attach: (content: string | Buffer, type: string) => void;
method description
description: (content: string) => void;
method epic
epic: (epic: string) => void;
method feature
feature: (feature: string) => void;
method issue
issue: (name: string, url: string) => void;
method label
label: (label: string, value: string) => void;
method link
link: (url: string, name?: string, type?: string) => void;
method owner
owner: (owner: string) => void;
method parameter
parameter: (name: string, value: any, options?: ParameterOptions) => void;
method parentSuite
parentSuite: (name: string) => void;
method run
run: ( body: StepBodyFunction, messageEmitter: (message: MetadataMessage) => Promise<void>) => Promise<void>;
method severity
severity: (severity: string) => void;
method start
start: (body: StepBodyFunction) => Promise<MetadataMessage>;
method step
step: (name: string, body: StepBodyFunction) => Promise<void>;
method story
story: (story: string) => void;
method subSuite
subSuite: (name: string) => void;
method suite
suite: (name: string) => void;
method tag
tag: (tag: string) => void;
method tms
tms: (name: string, url: string) => void;
method toExecutableItem
static toExecutableItem: ( runtime: AllureRuntime, stepMetadata: StepMetadata) => ExecutableItem;
class AllureGroup
class AllureGroup {}
constructor
constructor(runtime: AllureRuntime);
property name
name: string;
property uuid
readonly uuid: string;
method addAfter
addAfter: () => ExecutableItemWrapper;
method addBefore
addBefore: () => ExecutableItemWrapper;
method endGroup
endGroup: () => void;
method startGroup
startGroup: (name?: string) => AllureGroup;
method startTest
startTest: (name?: string, start?: number) => AllureTest;
class AllureRuntime
class AllureRuntime {}
constructor
constructor(config: AllureConfig);
property writer
writer: AllureWriter;
method startGroup
startGroup: (name?: string) => AllureGroup;
method writeAttachment
writeAttachment: ( content: Buffer | string, options: ContentType | string | AttachmentOptions, encoding?: BufferEncoding) => string;
method writeAttachmentFromPath
writeAttachmentFromPath: ( fromPath: PathLike, options: ContentType | string | AttachmentOptions) => string;
method writeCategoriesDefinitions
writeCategoriesDefinitions: (categories: Category[]) => void;
method writeEnvironmentInfo
writeEnvironmentInfo: (info?: Record<string, string>) => void;
method writeGroup
writeGroup: (result: TestResultContainer) => void;
method writeResult
writeResult: (result: TestResult) => void;
class AllureStep
class AllureStep extends ExecutableItemWrapper {}
constructor
constructor(stepResult: ExecutableItem, start?: number);
method endStep
endStep: (stop?: number) => void;
class AllureTest
class AllureTest extends ExecutableItemWrapper {}
constructor
constructor(runtime: AllureRuntime, start?: number);
property uuid
readonly uuid: string;
method addIssueLink
addIssueLink: (url: string, name: string) => void;
method addLabel
addLabel: (name: string, value: string) => void;
method addLink
addLink: (url: string, name?: string, type?: string) => void;
method addTmsLink
addTmsLink: (url: string, name: string) => void;
method applyMetadata
applyMetadata: ( metadata: Partial<MetadataMessage>, stepApplyFn?: (step: ExecutableItem) => void) => void;
method calculateHistoryId
calculateHistoryId: () => void;
method endTest
endTest: (stop?: number) => void;
class ExecutableItemWrapper
class ExecutableItemWrapper {}
constructor
constructor(info: TestResult | ExecutableItem);
property isAllStepsEnded
readonly isAllStepsEnded: boolean;
property isAnyStepFailed
readonly isAnyStepFailed: boolean;
property status
status: Status;
property wrappedItem
readonly wrappedItem: TestResult | ExecutableItem;
method addAttachment
addAttachment: ( name: string, options: ContentType | string | AttachmentOptions, fileName: string) => void;
method addParameter
addParameter: (name: string, value: string, options?: ParameterOptions) => void;
method addStep
addStep: (step: ExecutableItem) => void;
method parameter
parameter: (name: string, value: any, options?: ParameterOptions) => void;
method startStep
startStep: (name: string, start?: number) => AllureStep;
method wrap
wrap: <T>(fun: (...args: any[]) => T) => (...args: any[]) => T;
class FileSystemAllureWriter
class FileSystemAllureWriter implements AllureWriter {}
constructor
constructor(config: AllureConfig);
method writeAttachment
writeAttachment: ( name: string, content: Buffer | string, encoding?: BufferEncoding) => void;
method writeAttachmentFromPath
writeAttachmentFromPath: (from: PathLike, distFileName: string) => void;
method writeCategoriesDefinitions
writeCategoriesDefinitions: (categories: Category[]) => void;
method writeEnvironmentInfo
writeEnvironmentInfo: (info?: Record<string, string | undefined>) => void;
method writeGroup
writeGroup: (result: TestResultContainer) => void;
method writeResult
writeResult: (result: TestResult) => void;
class InMemoryAllureWriter
class InMemoryAllureWriter implements AllureWriter, AllureResults {}
property attachments
attachments: Record<string, any>;
property categories
categories?: Category[];
property envInfo
envInfo?: Record<string, string>;
property groups
groups: TestResultContainer[];
property tests
tests: TestResult[];
method getGroupByName
getGroupByName: (name: string) => TestResultContainer;
method getMaybeGroupByName
getMaybeGroupByName: (name: string) => TestResultContainer | undefined;
method getMaybeTestByName
getMaybeTestByName: (name: string) => TestResult | undefined;
method getTestByName
getTestByName: (name: string) => TestResult;
method reset
reset: () => void;
method writeAttachment
writeAttachment: (name: string, content: Buffer | string) => void;
method writeAttachmentFromPath
writeAttachmentFromPath: (from: PathLike, toFileName: string) => void;
method writeCategoriesDefinitions
writeCategoriesDefinitions: (categories: Category[]) => void;
method writeEnvironmentInfo
writeEnvironmentInfo: (envInfo?: Record<string, string | undefined>) => void;
method writeGroup
writeGroup: (result: TestResultContainer) => void;
method writeResult
writeResult: (result: TestResult) => void;
class MessageAllureWriter
class MessageAllureWriter implements AllureWriter {}
method writeAttachment
writeAttachment: ( name: string, content: Buffer | string, encoding?: BufferEncoding) => void;
method writeAttachmentFromPath
writeAttachmentFromPath: (from: PathLike, distFileName: string) => void;
method writeCategoriesDefinitions
writeCategoriesDefinitions: (categories: Category[]) => void;
method writeEnvironmentInfo
writeEnvironmentInfo: (info?: Record<string, string | undefined>) => void;
method writeGroup
writeGroup: (result: TestResultContainer) => void;
method writeResult
writeResult: (result: TestResult) => void;
Interfaces
interface AllureCommandStep
interface AllureCommandStep<T = MetadataMessage> {}
property attachments
attachments: AttachmentMetadata[];
property metadata
metadata: T;
property name
name: string;
method attach
attach: ( name: string, content: Buffer | string, options: ContentType | string) => void | Promise<void>;
method description
description: (content: string) => void | Promise<void>;
method epic
epic: (epic: string) => void | Promise<void>;
method feature
feature: (feature: string) => void | Promise<void>;
method issue
issue: (issue: string, url: string) => void | Promise<void>;
method label
label: (label: string, value: string) => void | Promise<void>;
method link
link: (url: string, name?: string, type?: string) => void | Promise<void>;
method owner
owner: (owner: string) => void | Promise<void>;
method parameter
parameter: ( name: string, value: string, options?: ParameterOptions) => void | Promise<void>;
method parentSuite
parentSuite: (name: string) => void | Promise<void>;
method severity
severity: (severity: string) => void | Promise<void>;
method story
story: (story: string) => void | Promise<void>;
method subSuite
subSuite: (name: string) => void | Promise<void>;
method suite
suite: (name: string) => void | Promise<void>;
method tag
tag: (tag: string) => void | Promise<void>;
method tms
tms: (issue: string, url: string) => void | Promise<void>;
interface AllureConfig
interface AllureConfig {}
property resultsDir
readonly resultsDir: string;
property testMapper
readonly testMapper?: (test: TestResult) => TestResult | null;
property writer
readonly writer?: AllureWriter;
interface AllureResults
interface AllureResults {}
property attachments
attachments: Record<string, Buffer | string>;
property categories
categories?: Category[];
property envInfo
envInfo?: Record<string, string | undefined>;
property groups
groups: TestResultContainer[];
property tests
tests: TestResult[];
interface AllureRuntimeApiInterface
interface AllureRuntimeApiInterface {}
method attachment
attachment: (content: string | Buffer, type: string) => void;
method description
description: (markdown: string) => void;
method descriptionHtml
descriptionHtml: (html: string) => void;
method epic
epic: (epic: string) => void;
method feature
feature: (feature: string) => void;
method historyId
historyId: (id: string) => void;
method id
id: (allureId: string) => void;
method issue
issue: (name: string, url: string) => void;
method label
label: (name: string, value: string) => void;
method layer
layer: (layer: string) => void;
method link
link: (url: string, name?: string, type?: string) => void;
method owner
owner: (owner: string) => void;
method parameter
parameter: (name: string, value: any, options?: ParameterOptions) => void;
method parentSuite
parentSuite: (name: string) => void;
method severity
severity: (severity: string) => void;
method step
step: (name: string, body: StepBodyFunction) => void;
method story
story: (story: string) => void;
method subSuite
subSuite: (name: string) => void;
method suite
suite: (name: string) => void;
method tag
tag: (tag: string) => void;
method testCaseId
testCaseId: (id: string) => void;
method tms
tms: (name: string, url: string) => void;
interface AllureWriter
interface AllureWriter {}
method writeAttachment
writeAttachment: ( name: string, content: Buffer | string, encoding?: BufferEncoding) => void;
method writeAttachmentFromPath
writeAttachmentFromPath: (from: PathLike, distFileName: string) => void;
method writeCategoriesDefinitions
writeCategoriesDefinitions: (categories: Category[]) => void;
method writeEnvironmentInfo
writeEnvironmentInfo: (info: Record<string, string | undefined>) => void;
method writeGroup
writeGroup: (result: TestResultContainer) => void;
method writeResult
writeResult: (result: TestResult) => void;
interface Attachment
interface Attachment {}
interface AttachmentMetadata
interface AttachmentMetadata {}
interface AttachmentOptions
interface AttachmentOptions {}
property contentType
contentType: ContentType | string;
property fileExtension
fileExtension?: string;
interface Category
interface Category {}
property description
description?: string;
property descriptionHtml
descriptionHtml?: string;
property flaky
flaky?: boolean;
property matchedStatuses
matchedStatuses?: Status[];
property messageRegex
messageRegex?: string | RegExp;
property name
name?: string;
property traceRegex
traceRegex?: string | RegExp;
interface ExecutableItem
interface ExecutableItem {}
property attachments
attachments: Attachment[];
property description
description?: string;
property descriptionHtml
descriptionHtml?: string;
property name
name?: string;
property parameters
parameters: Parameter[];
property stage
stage: Stage;
property start
start?: number;
property status
status?: Status;
property statusDetails
statusDetails: StatusDetails;
property steps
steps: StepResult[];
property stop
stop?: number;
interface ExecutorInfo
interface ExecutorInfo {}
property buildName
buildName?: string;
property buildOrder
buildOrder?: number;
property buildUrl
buildUrl?: string;
property name
name?: string;
property reportName
reportName?: string;
property reportUrl
reportUrl?: string;
property type
type?: string;
property url
url?: string;
interface ImageDiffAttachment
interface ImageDiffAttachment {}
interface Link
interface Link {}
interface MetadataMessage
interface MetadataMessage {}
property attachments
attachments?: AttachmentMetadata[];
property description
description?: string;
property descriptionHtml
descriptionHtml?: string;
property displayName
displayName?: string;
property historyId
historyId?: string;
property labels
labels?: Label[];
property links
links?: Link[];
property parameter
parameter?: Parameter[];
property steps
steps?: StepMetadata[];
property testCaseId
testCaseId?: string;
interface Parameter
interface Parameter {}
interface StatusDetails
interface StatusDetails {}
interface StepInterface
interface StepInterface {}
interface StepMetadata
interface StepMetadata extends Omit<ExecutableItem, 'attachments' | 'steps'> {}
property attachments
attachments: AttachmentMetadata[];
property steps
steps: StepMetadata[];
interface TestPlanV1
interface TestPlanV1 {}
interface TestResult
interface TestResult extends ExecutableItem {}
Enums
enum ContentType
enum ContentType { TEXT = 'text/plain', XML = 'application/xml', HTML = 'text/html', CSV = 'text/csv', TSV = 'text/tab-separated-values', CSS = 'text/css', URI = 'text/uri-list', SVG = 'image/svg+xml', PNG = 'image/png', JSON = 'application/json', ZIP = 'application/zip', WEBM = 'video/webm', JPEG = 'image/jpeg', MP4 = 'video/mp4',}
member CSS
CSS = 'text/css'
member CSV
CSV = 'text/csv'
member HTML
HTML = 'text/html'
member JPEG
JPEG = 'image/jpeg'
member JSON
JSON = 'application/json'
member MP4
MP4 = 'video/mp4'
member PNG
PNG = 'image/png'
member SVG
SVG = 'image/svg+xml'
member TEXT
TEXT = 'text/plain'
member TSV
TSV = 'text/tab-separated-values'
member URI
URI = 'text/uri-list'
member WEBM
WEBM = 'video/webm'
member XML
XML = 'application/xml'
member ZIP
ZIP = 'application/zip'
enum LabelName
enum LabelName { ALLURE_ID = 'ALLURE_ID', AS_ID = 'ALLURE_ID', SUITE = 'suite', PARENT_SUITE = 'parentSuite', SUB_SUITE = 'subSuite', EPIC = 'epic', FEATURE = 'feature', STORY = 'story', SEVERITY = 'severity', TAG = 'tag', OWNER = 'owner', LEAD = 'lead', HOST = 'host', THREAD = 'thread', TEST_METHOD = 'testMethod', TEST_CLASS = 'testClass', PACKAGE = 'package', FRAMEWORK = 'framework', LANGUAGE = 'language', LAYER = 'layer',}
member ALLURE_ID
ALLURE_ID = 'ALLURE_ID'
member AS_ID
AS_ID = 'ALLURE_ID'
member EPIC
EPIC = 'epic'
member FEATURE
FEATURE = 'feature'
member FRAMEWORK
FRAMEWORK = 'framework'
member HOST
HOST = 'host'
member LANGUAGE
LANGUAGE = 'language'
member LAYER
LAYER = 'layer'
member LEAD
LEAD = 'lead'
member OWNER
OWNER = 'owner'
member PACKAGE
PACKAGE = 'package'
member PARENT_SUITE
PARENT_SUITE = 'parentSuite'
member SEVERITY
SEVERITY = 'severity'
member STORY
STORY = 'story'
member SUB_SUITE
SUB_SUITE = 'subSuite'
member SUITE
SUITE = 'suite'
member TAG
TAG = 'tag'
member TEST_CLASS
TEST_CLASS = 'testClass'
member TEST_METHOD
TEST_METHOD = 'testMethod'
member THREAD
THREAD = 'thread'
enum LinkType
enum LinkType { ISSUE = 'issue', TMS = 'tms',}
enum Severity
enum Severity { BLOCKER = 'blocker', CRITICAL = 'critical', NORMAL = 'normal', MINOR = 'minor', TRIVIAL = 'trivial',}
enum Stage
enum Stage { SCHEDULED = 'scheduled', RUNNING = 'running', FINISHED = 'finished', PENDING = 'pending', INTERRUPTED = 'interrupted',}
member FINISHED
FINISHED = 'finished'
member INTERRUPTED
INTERRUPTED = 'interrupted'
member PENDING
PENDING = 'pending'
member RUNNING
RUNNING = 'running'
member SCHEDULED
SCHEDULED = 'scheduled'
Type Aliases
type FixtureResult
type FixtureResult = ExecutableItem;
type ParameterOptions
type ParameterOptions = Pick<Parameter, 'mode' | 'excluded'>;
type StepBodyFunction
type StepBodyFunction<T = any> = ( this: AllureCommandStepExecutable, step: AllureCommandStepExecutable) => T | Promise<T>;
type StepResult
type StepResult = ExecutableItem;
Package Files (18)
- dist/cjs/index.d.ts
- dist/cjs/src/current/Allure.d.ts
- dist/cjs/src/current/AllureCommandStep.d.ts
- dist/cjs/src/current/AllureConfig.d.ts
- dist/cjs/src/current/AllureGroup.d.ts
- dist/cjs/src/current/AllureRuntime.d.ts
- dist/cjs/src/current/AllureTest.d.ts
- dist/cjs/src/current/ExecutableItemWrapper.d.ts
- dist/cjs/src/current/framework/index.d.ts
- dist/cjs/src/current/isPromise.d.ts
- dist/cjs/src/current/model.d.ts
- dist/cjs/src/current/testplan.d.ts
- dist/cjs/src/current/utils.d.ts
- dist/cjs/src/current/writers/AllureWriter.d.ts
- dist/cjs/src/current/writers/FileSystemAllureWriter.d.ts
- dist/cjs/src/current/writers/InMemoryAllureWriter.d.ts
- dist/cjs/src/current/writers/MessageAllureWriter.d.ts
- dist/cjs/src/current/writers/utils.d.ts
Dependencies (3)
Dev Dependencies (28)
- @types/chai
- @types/eslint
- @types/md5
- @types/mocha
- @types/node
- @types/sinon
- @types/source-map-support
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- allure-mocha
- chai
- eslint
- eslint-config-prettier
- eslint-plugin-import
- eslint-plugin-jsdoc
- eslint-plugin-no-null
- eslint-plugin-prefer-arrow
- expect
- glob
- mocha
- mocha-multi-reporters
- npm-run-all
- rimraf
- sinon
- source-map-support
- ts-node
- tslib
- typescript
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/allure-js-commons
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/allure-js-commons)
- HTML<a href="https://www.jsdocs.io/package/allure-js-commons"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 7906 ms. - Missing or incorrect documentation? Open an issue for this package.