@atomic-testing/core
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -1,2 +0,2 @@ | ||
import { ScenePart } from '../types'; | ||
import { ScenePart } from '../partTypes'; | ||
export declare const MissingPartErrorId = "MissingPartError"; | ||
@@ -3,0 +3,0 @@ export declare class MissingPartError<T extends ScenePart> extends Error { |
@@ -1,2 +0,2 @@ | ||
import { ScenePart } from '../types'; | ||
import { ScenePart } from '../partTypes'; | ||
export interface IExampleUnit<T extends ScenePart, ExampleT> { | ||
@@ -3,0 +3,0 @@ title: string; |
@@ -1,9 +0,11 @@ | ||
export { ComponentDriver } from './ComponentDriver'; | ||
export { defaultOnFinishUpdate, defaultStep } from './defaultValues'; | ||
export type { IClickableDriver, IClickOption, IFormFieldDriver, IInputDriver, IToggleDriver } from './driverTypes'; | ||
export type { Nullable, Optional } from './dataTypes'; | ||
export { ComponentDriver } from './drivers/ComponentDriver'; | ||
export { ContainerDriver } from './drivers/ContainerDriver'; | ||
export type { IClickableDriver, IFormFieldDriver, IInputDriver, IToggleDriver } from './drivers/driverTypes'; | ||
export { TooManyMatchingElementError, TooManyMatchingElementErrorId } from './errors/TooManyMatchingElementError'; | ||
export * from './example/types'; | ||
export type { ClickOption, CssProperty, EnterTextOption, Interactor } from './interactor'; | ||
export * from './locators/'; | ||
export type { IComponentDriverOption, IContainerDriverOption, ScenePart, ScenePartDefinition, ScenePartDriver, } from './partTypes'; | ||
export { TestEngine } from './TestEngine'; | ||
export type { IComponentDriverOption, IEnterTextOption, IInteractor, LocatorChain, Nullable, Optional, ScenePart, ScenePartDefinition, ScenePartDriver, StepFunction, } from './types'; | ||
export * as collectionUtil from './utils/collectionUtil'; | ||
@@ -10,0 +12,0 @@ export * as domUtil from './utils/domUtil'; |
@@ -29,8 +29,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.timingUtil = exports.locatorUtil = exports.escapeUtil = exports.domUtil = exports.collectionUtil = exports.TestEngine = exports.TooManyMatchingElementErrorId = exports.TooManyMatchingElementError = exports.defaultStep = exports.defaultOnFinishUpdate = exports.ComponentDriver = void 0; | ||
var ComponentDriver_1 = require("./ComponentDriver"); | ||
exports.timingUtil = exports.locatorUtil = exports.escapeUtil = exports.domUtil = exports.collectionUtil = exports.TestEngine = exports.TooManyMatchingElementErrorId = exports.TooManyMatchingElementError = exports.ContainerDriver = exports.ComponentDriver = void 0; | ||
var ComponentDriver_1 = require("./drivers/ComponentDriver"); | ||
Object.defineProperty(exports, "ComponentDriver", { enumerable: true, get: function () { return ComponentDriver_1.ComponentDriver; } }); | ||
var defaultValues_1 = require("./defaultValues"); | ||
Object.defineProperty(exports, "defaultOnFinishUpdate", { enumerable: true, get: function () { return defaultValues_1.defaultOnFinishUpdate; } }); | ||
Object.defineProperty(exports, "defaultStep", { enumerable: true, get: function () { return defaultValues_1.defaultStep; } }); | ||
var ContainerDriver_1 = require("./drivers/ContainerDriver"); | ||
Object.defineProperty(exports, "ContainerDriver", { enumerable: true, get: function () { return ContainerDriver_1.ContainerDriver; } }); | ||
var TooManyMatchingElementError_1 = require("./errors/TooManyMatchingElementError"); | ||
@@ -37,0 +36,0 @@ Object.defineProperty(exports, "TooManyMatchingElementError", { enumerable: true, get: function () { return TooManyMatchingElementError_1.TooManyMatchingElementError; } }); |
@@ -10,3 +10,4 @@ export { byAttribute } from './byAttribute'; | ||
export { byValue } from './byValue'; | ||
export type { LocatorChain } from './LocatorChain'; | ||
export type { CssLocator, PartLocatorType } from './PartLocatorType'; | ||
export { LocatorRelativePosition, LocatorType } from './PartLocatorType'; | ||
export type { CssLocator, PartLocatorType } from './PartLocatorType'; |
@@ -1,10 +0,10 @@ | ||
import { IComponentDriverOption, IInteractor, LocatorChain } from '@atomic-testing/core'; | ||
import { ComponentDriver } from './ComponentDriver'; | ||
import { ScenePart } from './types'; | ||
import { IComponentDriverOption, Interactor, LocatorChain } from '@atomic-testing/core'; | ||
import { ComponentDriver } from './drivers/ComponentDriver'; | ||
import { ScenePart } from './partTypes'; | ||
export declare class TestEngine<T extends ScenePart> extends ComponentDriver<T> { | ||
readonly interactor: IInteractor; | ||
readonly interactor: Interactor; | ||
private readonly _cleanUp; | ||
constructor(locator: LocatorChain, interactor: IInteractor, option?: IComponentDriverOption<T>, cleanUp?: () => Promise<void>); | ||
constructor(locator: LocatorChain, interactor: Interactor, option?: IComponentDriverOption<T>, cleanUp?: () => Promise<void>); | ||
cleanUp(): Promise<void>; | ||
get driverName(): string; | ||
} |
@@ -13,3 +13,3 @@ "use strict"; | ||
exports.TestEngine = void 0; | ||
const ComponentDriver_1 = require("./ComponentDriver"); | ||
const ComponentDriver_1 = require("./drivers/ComponentDriver"); | ||
class TestEngine extends ComponentDriver_1.ComponentDriver { | ||
@@ -16,0 +16,0 @@ constructor(locator, interactor, option, cleanUp) { |
@@ -1,4 +0,4 @@ | ||
import { PartLocatorType } from '../locators/PartLocatorType'; | ||
import { LocatorChain } from '../types'; | ||
export declare function append(locator: Readonly<LocatorChain>, selector: PartLocatorType): LocatorChain; | ||
import type { LocatorChain } from '../locators/LocatorChain'; | ||
import { LocatorRelativePosition, PartLocatorType } from '../locators/PartLocatorType'; | ||
export declare function append(locator: Readonly<LocatorChain> | Readonly<PartLocatorType>, selector: PartLocatorType): LocatorChain; | ||
export declare function findRootLocatorIndex(locator: LocatorChain): number; | ||
@@ -8,1 +8,2 @@ export declare function getEffectiveLocator(locator: LocatorChain): LocatorChain; | ||
export declare function getLocatorStatement(locator: PartLocatorType): string; | ||
export declare function overrideLocatorRelativePosition(locator: PartLocatorType, relative: LocatorRelativePosition): PartLocatorType; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getLocatorStatement = exports.toCssSelector = exports.getEffectiveLocator = exports.findRootLocatorIndex = exports.append = void 0; | ||
exports.overrideLocatorRelativePosition = exports.getLocatorStatement = exports.toCssSelector = exports.getEffectiveLocator = exports.findRootLocatorIndex = exports.append = void 0; | ||
const PartLocatorType_1 = require("../locators/PartLocatorType"); | ||
function append(locator, selector) { | ||
return locator.concat(selector); | ||
const baseLocator = Array.isArray(locator) ? locator : [locator]; | ||
return baseLocator.concat(selector); | ||
} | ||
@@ -56,2 +57,13 @@ exports.append = append; | ||
exports.getLocatorStatement = getLocatorStatement; | ||
function overrideLocatorRelativePosition(locator, relative) { | ||
if (typeof locator === 'string') { | ||
return { | ||
type: PartLocatorType_1.LocatorType.Css, | ||
selector: locator, | ||
relative, | ||
}; | ||
} | ||
return Object.assign(Object.assign({}, locator), { relative }); | ||
} | ||
exports.overrideLocatorRelativePosition = overrideLocatorRelativePosition; | ||
//# sourceMappingURL=locatorUtil.js.map |
{ | ||
"name": "@atomic-testing/core", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "Core library for atomic-testing", | ||
@@ -19,6 +19,6 @@ "main": "dist/index.js", | ||
"@types/node": "^16.0.0", | ||
"jest": "^29.2.0", | ||
"ts-jest": "^29.0.0", | ||
"jest": "^29.5.0", | ||
"ts-jest": "^29.0.5", | ||
"ts-node": "^10.9.0", | ||
"typescript": "^4.9.0" | ||
"typescript": "^5.0.2" | ||
}, | ||
@@ -25,0 +25,0 @@ "dependencies": {}, |
@@ -1,2 +0,2 @@ | ||
import { ScenePart } from '../types'; | ||
import { ScenePart } from '../partTypes'; | ||
@@ -3,0 +3,0 @@ export const MissingPartErrorId = 'MissingPartError'; |
@@ -1,2 +0,2 @@ | ||
import { ScenePart } from '../types'; | ||
import { ScenePart } from '../partTypes'; | ||
@@ -3,0 +3,0 @@ export interface IExampleUnit<T extends ScenePart, ExampleT> { |
@@ -1,20 +0,17 @@ | ||
export { ComponentDriver } from './ComponentDriver'; | ||
export { defaultOnFinishUpdate, defaultStep } from './defaultValues'; | ||
export type { IClickableDriver, IClickOption, IFormFieldDriver, IInputDriver, IToggleDriver } from './driverTypes'; | ||
export type { Nullable, Optional } from './dataTypes'; | ||
export { ComponentDriver } from './drivers/ComponentDriver'; | ||
export { ContainerDriver } from './drivers/ContainerDriver'; | ||
export type { IClickableDriver, IFormFieldDriver, IInputDriver, IToggleDriver } from './drivers/driverTypes'; | ||
export { TooManyMatchingElementError, TooManyMatchingElementErrorId } from './errors/TooManyMatchingElementError'; | ||
export * from './example/types'; | ||
export type { ClickOption, CssProperty, EnterTextOption, Interactor } from './interactor'; | ||
export * from './locators/'; | ||
export { TestEngine } from './TestEngine'; | ||
export type { | ||
IComponentDriverOption, | ||
IEnterTextOption, | ||
IInteractor, | ||
LocatorChain, | ||
Nullable, | ||
Optional, | ||
IContainerDriverOption, | ||
ScenePart, | ||
ScenePartDefinition, | ||
ScenePartDriver, | ||
StepFunction, | ||
} from './types'; | ||
} from './partTypes'; | ||
export { TestEngine } from './TestEngine'; | ||
export * as collectionUtil from './utils/collectionUtil'; | ||
@@ -21,0 +18,0 @@ export * as domUtil from './utils/domUtil'; |
@@ -10,3 +10,4 @@ export { byAttribute } from './byAttribute'; | ||
export { byValue } from './byValue'; | ||
export type { LocatorChain } from './LocatorChain'; | ||
export type { CssLocator, PartLocatorType } from './PartLocatorType'; | ||
export { LocatorRelativePosition, LocatorType } from './PartLocatorType'; | ||
export type { CssLocator, PartLocatorType } from './PartLocatorType'; |
@@ -1,5 +0,5 @@ | ||
import { IComponentDriverOption, IInteractor, LocatorChain } from '@atomic-testing/core'; | ||
import { IComponentDriverOption, Interactor, LocatorChain } from '@atomic-testing/core'; | ||
import { ComponentDriver } from './ComponentDriver'; | ||
import { ScenePart } from './types'; | ||
import { ComponentDriver } from './drivers/ComponentDriver'; | ||
import { ScenePart } from './partTypes'; | ||
@@ -11,3 +11,3 @@ export class TestEngine<T extends ScenePart> extends ComponentDriver<T> { | ||
locator: LocatorChain, | ||
public readonly interactor: IInteractor, | ||
public readonly interactor: Interactor, | ||
option?: IComponentDriverOption<T>, | ||
@@ -14,0 +14,0 @@ cleanUp?: () => Promise<void>, |
@@ -1,6 +0,10 @@ | ||
import { CssLocator, LocatorRelativePosition, PartLocatorType } from '../locators/PartLocatorType'; | ||
import { LocatorChain } from '../types'; | ||
import type { LocatorChain } from '../locators/LocatorChain'; | ||
import { CssLocator, LocatorRelativePosition, LocatorType, PartLocatorType } from '../locators/PartLocatorType'; | ||
export function append(locator: Readonly<LocatorChain>, selector: PartLocatorType): LocatorChain { | ||
return locator.concat(selector); | ||
export function append( | ||
locator: Readonly<LocatorChain> | Readonly<PartLocatorType>, | ||
selector: PartLocatorType, | ||
): LocatorChain { | ||
const baseLocator: LocatorChain = Array.isArray(locator) ? locator : [locator]; | ||
return baseLocator.concat(selector); | ||
} | ||
@@ -57,1 +61,19 @@ | ||
} | ||
export function overrideLocatorRelativePosition( | ||
locator: PartLocatorType, | ||
relative: LocatorRelativePosition, | ||
): PartLocatorType { | ||
if (typeof locator === 'string') { | ||
return { | ||
type: LocatorType.Css, | ||
selector: locator, | ||
relative, | ||
}; | ||
} | ||
return { | ||
...locator, | ||
relative, | ||
}; | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84950
135
1627