Socket
Socket
Sign inDemoInstall

@atomic-testing/core

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atomic-testing/core - npm Package Compare versions

Comparing version 0.26.0 to 0.27.0

dist/drivers/listHelper.d.ts

4

dist/drivers/ComponentDriver.js

@@ -97,3 +97,3 @@ "use strict";

// @ts-ignore
throw new MissingPartError_1.MissingPartError(missingPartNames);
throw new MissingPartError_1.MissingPartError(missingPartNames, this);
}

@@ -191,3 +191,3 @@ });

if (actual !== expected) {
throw new WaitForFailureError_1.WaitForFailureError(this.locator, actualOption);
throw new WaitForFailureError_1.WaitForFailureError(this.locator, actualOption, this);
}

@@ -194,0 +194,0 @@ });

export { ComponentDriver } from './ComponentDriver';
export { ContainerDriver } from './ContainerDriver';
export * as driverHelper from './driverHelper';
export type { IClickableDriver, IFormFieldDriver, IInputDriver, IToggleDriver } from './driverTypes';
export * as listHelper from './listHelper';
export * from './WaitForOption';

@@ -29,3 +29,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.driverHelper = exports.ContainerDriver = exports.ComponentDriver = void 0;
exports.listHelper = exports.ContainerDriver = exports.ComponentDriver = void 0;
var ComponentDriver_1 = require("./ComponentDriver");

@@ -35,4 +35,4 @@ Object.defineProperty(exports, "ComponentDriver", { enumerable: true, get: function () { return ComponentDriver_1.ComponentDriver; } });

Object.defineProperty(exports, "ContainerDriver", { enumerable: true, get: function () { return ContainerDriver_1.ContainerDriver; } });
exports.driverHelper = __importStar(require("./driverHelper"));
exports.listHelper = __importStar(require("./listHelper"));
__exportStar(require("./WaitForOption"), exports);
//# sourceMappingURL=index.js.map

@@ -0,3 +1,4 @@

export { ErrorBase } from './ErrorBase';
export { MissingPartError, MissingPartErrorId } from './MissingPartError';
export { TooManyMatchingElementError, TooManyMatchingElementErrorId } from './TooManyMatchingElementError';
export { WaitForFailureError, WaitForFailureErrorId } from './WaitForFailureError';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WaitForFailureErrorId = exports.WaitForFailureError = exports.TooManyMatchingElementErrorId = exports.TooManyMatchingElementError = exports.MissingPartErrorId = exports.MissingPartError = void 0;
exports.WaitForFailureErrorId = exports.WaitForFailureError = exports.TooManyMatchingElementErrorId = exports.TooManyMatchingElementError = exports.MissingPartErrorId = exports.MissingPartError = exports.ErrorBase = void 0;
var ErrorBase_1 = require("./ErrorBase");
Object.defineProperty(exports, "ErrorBase", { enumerable: true, get: function () { return ErrorBase_1.ErrorBase; } });
var MissingPartError_1 = require("./MissingPartError");

@@ -5,0 +7,0 @@ Object.defineProperty(exports, "MissingPartError", { enumerable: true, get: function () { return MissingPartError_1.MissingPartError; } });

@@ -0,6 +1,9 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { LocatorChain } from '../locators';
import { ErrorBase } from './ErrorBase';
export declare const ItemNotFoundErrorId = "ItemNotFoundError";
export declare class ItemNotFoundError extends Error {
export declare class ItemNotFoundError extends ErrorBase {
readonly locator: LocatorChain;
constructor(locator: LocatorChain);
readonly driver: ComponentDriver<any>;
constructor(locator: LocatorChain, driver: ComponentDriver<any>);
}

@@ -5,2 +5,3 @@ "use strict";

const locatorUtil_1 = require("../utils/locatorUtil");
const ErrorBase_1 = require("./ErrorBase");
exports.ItemNotFoundErrorId = 'ItemNotFoundError';

@@ -11,6 +12,7 @@ function getErrorMessage(locator) {

}
class ItemNotFoundError extends Error {
constructor(locator) {
super(getErrorMessage(locator));
class ItemNotFoundError extends ErrorBase_1.ErrorBase {
constructor(locator, driver) {
super(getErrorMessage(locator), driver);
this.locator = locator;
this.driver = driver;
this.name = exports.ItemNotFoundErrorId;

@@ -17,0 +19,0 @@ }

@@ -0,6 +1,9 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { ScenePart } from '../partTypes';
import { ErrorBase } from './ErrorBase';
export declare const MissingPartErrorId = "MissingPartError";
export declare class MissingPartError<T extends ScenePart> extends Error {
export declare class MissingPartError<T extends ScenePart> extends ErrorBase {
readonly missingPartName: keyof T | ReadonlyArray<keyof T>;
constructor(missingPartName: keyof T | ReadonlyArray<keyof T>);
readonly driver: ComponentDriver<T>;
constructor(missingPartName: keyof T | ReadonlyArray<keyof T>, driver: ComponentDriver<T>);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingPartError = exports.MissingPartErrorId = void 0;
const ErrorBase_1 = require("./ErrorBase");
exports.MissingPartErrorId = 'MissingPartError';
class MissingPartError extends Error {
constructor(missingPartName) {
class MissingPartError extends ErrorBase_1.ErrorBase {
constructor(missingPartName, driver) {
const partNames = Array.isArray(missingPartName) ? missingPartName : [missingPartName];
const partNameString = partNames.map((name) => `${name}`).join(', ');
super(`The part "${partNameString}" is missing`);
super(`The part "${partNameString}" is missing`, driver);
this.missingPartName = missingPartName;
this.driver = driver;
this.name = exports.MissingPartErrorId;

@@ -12,0 +14,0 @@ }

@@ -0,6 +1,9 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { PartLocatorType } from '../locators/PartLocatorType';
import { ErrorBase } from './ErrorBase';
export declare const TooManyMatchingElementErrorId = "TooManyMatchingElementError";
export declare class TooManyMatchingElementError extends Error {
export declare class TooManyMatchingElementError extends ErrorBase {
readonly query: PartLocatorType;
constructor(query: PartLocatorType);
readonly driver: ComponentDriver<any>;
constructor(query: PartLocatorType, driver: ComponentDriver<any>);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TooManyMatchingElementError = exports.TooManyMatchingElementErrorId = void 0;
const ErrorBase_1 = require("./ErrorBase");
exports.TooManyMatchingElementErrorId = 'TooManyMatchingElementError';
class TooManyMatchingElementError extends Error {
constructor(query) {
super('Too many matching element');
class TooManyMatchingElementError extends ErrorBase_1.ErrorBase {
constructor(query, driver) {
super('Too many matching element', driver);
this.query = query;
this.driver = driver;
this.name = exports.TooManyMatchingElementErrorId;

@@ -10,0 +12,0 @@ }

@@ -0,7 +1,10 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { WaitForOption } from '../drivers/WaitForOption';
import { LocatorChain } from '../locators';
import { ErrorBase } from './ErrorBase';
export declare const WaitForFailureErrorId = "WaitForFailureError";
export declare class WaitForFailureError extends Error {
export declare class WaitForFailureError extends ErrorBase {
readonly locator: LocatorChain;
constructor(locator: LocatorChain, option: WaitForOption);
readonly driver: ComponentDriver<any>;
constructor(locator: LocatorChain, option: WaitForOption, driver: ComponentDriver<any>);
}

@@ -5,2 +5,3 @@ "use strict";

const locatorUtil_1 = require("../utils/locatorUtil");
const ErrorBase_1 = require("./ErrorBase");
exports.WaitForFailureErrorId = 'WaitForFailureError';

@@ -11,6 +12,7 @@ function getErrorMessage(locator, option) {

}
class WaitForFailureError extends Error {
constructor(locator, option) {
super(getErrorMessage(locator, option));
class WaitForFailureError extends ErrorBase_1.ErrorBase {
constructor(locator, option, driver) {
super(getErrorMessage(locator, option), driver);
this.locator = locator;
this.driver = driver;
this.name = exports.WaitForFailureErrorId;

@@ -17,0 +19,0 @@ }

export type { ClickOption } from './ClickOption';
export type { CssProperty } from './CssProperty';
export type { EnterTextOption } from './EnterTextOption';
export type { Interactor as Interactor } from './Interactor';
export type { Interactor } from './Interactor';

@@ -5,5 +5,7 @@ import { Optional } from './dataTypes';

import { WaitForOption } from './drivers/WaitForOption';
import { Interactor } from './interactor';
import { LocatorChain } from './locators/LocatorChain';
import { PartLocatorType } from './locators/PartLocatorType';
export type PartName<T extends ScenePart> = keyof T;
export type ComponentDriverClass<T extends ComponentDriver<P>, P extends ScenePart = {}> = new (locator: LocatorChain, interactor: Interactor, option?: Partial<IComponentDriverOption<P>>) => T;
export interface ComponentPartDefinition<T extends ScenePart> {

@@ -17,3 +19,3 @@ /**

*/
driver: typeof ComponentDriver<T>;
driver: typeof ComponentDriver<T> | ComponentDriverClass<ComponentDriver<T>, T>;
/**

@@ -32,3 +34,3 @@ * Option for the driver

*/
driver: typeof ContainerDriver<ContentT, T>;
driver: typeof ContainerDriver<ContentT, T> | (new (locator: LocatorChain, interactor: Interactor, option?: Partial<IContainerDriverOption<ContentT, T>>) => ContainerDriver<ContentT, T>);
/**

@@ -35,0 +37,0 @@ * Option for the driver

{
"name": "@atomic-testing/core",
"version": "0.26.0",
"version": "0.27.0",
"description": "Core library for atomic-testing",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -87,3 +87,3 @@ import { Optional } from '../dataTypes';

// @ts-ignore
throw new MissingPartError(missingPartNames);
throw new MissingPartError(missingPartNames, this);
}

@@ -186,3 +186,3 @@ }

if (actual !== expected) {
throw new WaitForFailureError(this.locator, actualOption);
throw new WaitForFailureError(this.locator, actualOption, this);
}

@@ -189,0 +189,0 @@ }

export { ComponentDriver } from './ComponentDriver';
export { ContainerDriver } from './ContainerDriver';
export * as driverHelper from './driverHelper';
export type { IClickableDriver, IFormFieldDriver, IInputDriver, IToggleDriver } from './driverTypes';
export * as listHelper from './listHelper';
export * from './WaitForOption';

@@ -0,3 +1,4 @@

export { ErrorBase } from './ErrorBase';
export { MissingPartError, MissingPartErrorId } from './MissingPartError';
export { TooManyMatchingElementError, TooManyMatchingElementErrorId } from './TooManyMatchingElementError';
export { WaitForFailureError, WaitForFailureErrorId } from './WaitForFailureError';

@@ -0,3 +1,5 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { LocatorChain } from '../locators';
import { toCssSelector } from '../utils/locatorUtil';
import { ErrorBase } from './ErrorBase';

@@ -11,7 +13,7 @@ export const ItemNotFoundErrorId = 'ItemNotFoundError';

export class ItemNotFoundError extends Error {
constructor(public readonly locator: LocatorChain) {
super(getErrorMessage(locator));
export class ItemNotFoundError extends ErrorBase {
constructor(public readonly locator: LocatorChain, public readonly driver: ComponentDriver<any>) {
super(getErrorMessage(locator), driver);
this.name = ItemNotFoundErrorId;
}
}

@@ -0,12 +1,17 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { ScenePart } from '../partTypes';
import { ErrorBase } from './ErrorBase';
export const MissingPartErrorId = 'MissingPartError';
export class MissingPartError<T extends ScenePart> extends Error {
constructor(public readonly missingPartName: keyof T | ReadonlyArray<keyof T>) {
export class MissingPartError<T extends ScenePart> extends ErrorBase {
constructor(
public readonly missingPartName: keyof T | ReadonlyArray<keyof T>,
public readonly driver: ComponentDriver<T>,
) {
const partNames = Array.isArray(missingPartName) ? missingPartName : [missingPartName];
const partNameString = partNames.map((name) => `${name}`).join(', ');
super(`The part "${partNameString}" is missing`);
super(`The part "${partNameString}" is missing`, driver);
this.name = MissingPartErrorId;
}
}

@@ -0,10 +1,12 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { PartLocatorType } from '../locators/PartLocatorType';
import { ErrorBase } from './ErrorBase';
export const TooManyMatchingElementErrorId = 'TooManyMatchingElementError';
export class TooManyMatchingElementError extends Error {
constructor(public readonly query: PartLocatorType) {
super('Too many matching element');
export class TooManyMatchingElementError extends ErrorBase {
constructor(public readonly query: PartLocatorType, public readonly driver: ComponentDriver<any>) {
super('Too many matching element', driver);
this.name = TooManyMatchingElementErrorId;
}
}

@@ -0,4 +1,6 @@

import { ComponentDriver } from '../drivers/ComponentDriver';
import { WaitForOption } from '../drivers/WaitForOption';
import { LocatorChain } from '../locators';
import { toCssSelector } from '../utils/locatorUtil';
import { ErrorBase } from './ErrorBase';

@@ -12,7 +14,11 @@ export const WaitForFailureErrorId = 'WaitForFailureError';

export class WaitForFailureError extends Error {
constructor(public readonly locator: LocatorChain, option: WaitForOption) {
super(getErrorMessage(locator, option));
export class WaitForFailureError extends ErrorBase {
constructor(
public readonly locator: LocatorChain,
option: WaitForOption,
public readonly driver: ComponentDriver<any>,
) {
super(getErrorMessage(locator, option), driver);
this.name = WaitForFailureErrorId;
}
}
export type { ClickOption } from './ClickOption';
export type { CssProperty } from './CssProperty';
export type { EnterTextOption } from './EnterTextOption';
export type { Interactor as Interactor } from './Interactor';
export type { Interactor } from './Interactor';

@@ -5,2 +5,3 @@ import { Optional } from './dataTypes';

import { WaitForOption } from './drivers/WaitForOption';
import { Interactor } from './interactor';
import { LocatorChain } from './locators/LocatorChain';

@@ -11,2 +12,8 @@ import { PartLocatorType } from './locators/PartLocatorType';

export type ComponentDriverClass<T extends ComponentDriver<P>, P extends ScenePart = {}> = new (
locator: LocatorChain,
interactor: Interactor,
option?: Partial<IComponentDriverOption<P>>,
) => T;
export interface ComponentPartDefinition<T extends ScenePart> {

@@ -21,3 +28,3 @@ /**

*/
driver: typeof ComponentDriver<T>;
driver: typeof ComponentDriver<T> | ComponentDriverClass<ComponentDriver<T>, T>;

@@ -39,3 +46,9 @@ /**

*/
driver: typeof ContainerDriver<ContentT, T>;
driver:
| typeof ContainerDriver<ContentT, T>
| (new (
locator: LocatorChain,
interactor: Interactor,
option?: Partial<IContainerDriverOption<ContentT, T>>,
) => ContainerDriver<ContentT, T>);

@@ -42,0 +55,0 @@ /**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc