@atomic-testing/core
Advanced tools
Comparing version 0.31.0 to 0.32.0
export { ComponentDriver } from './ComponentDriver'; | ||
export { ContainerDriver } from './ContainerDriver'; | ||
export { ListComponentDriver } from './ListComponentDriver'; | ||
export type { ListComponentDriverOption, ListComponentDriverSpecificOption } from './ListComponentDriver'; | ||
export * from './WaitForOption'; | ||
export type { IClickableDriver, IFormFieldDriver, IInputDriver, IToggleDriver } from './driverTypes'; | ||
export * as listHelper from './listHelper'; | ||
export * from './WaitForOption'; |
@@ -18,2 +18,5 @@ "use strict"; | ||
}); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
@@ -26,7 +29,4 @@ if (mod && mod.__esModule) return mod; | ||
}; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.listHelper = exports.ContainerDriver = exports.ComponentDriver = void 0; | ||
exports.listHelper = exports.ListComponentDriver = exports.ContainerDriver = exports.ComponentDriver = void 0; | ||
var ComponentDriver_1 = require("./ComponentDriver"); | ||
@@ -36,4 +36,6 @@ Object.defineProperty(exports, "ComponentDriver", { enumerable: true, get: function () { return ComponentDriver_1.ComponentDriver; } }); | ||
Object.defineProperty(exports, "ContainerDriver", { enumerable: true, get: function () { return ContainerDriver_1.ContainerDriver; } }); | ||
var ListComponentDriver_1 = require("./ListComponentDriver"); | ||
Object.defineProperty(exports, "ListComponentDriver", { enumerable: true, get: function () { return ListComponentDriver_1.ListComponentDriver; } }); | ||
__exportStar(require("./WaitForOption"), exports); | ||
exports.listHelper = __importStar(require("./listHelper")); | ||
__exportStar(require("./WaitForOption"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -25,2 +25,3 @@ "use strict"; | ||
exports.getListItemIterator = exports.getListItemByIndex = void 0; | ||
const __1 = require(".."); | ||
const locators_1 = require("../locators"); | ||
@@ -41,2 +42,3 @@ const locatorUtil_1 = require("../utils/locatorUtil"); | ||
const itemLocator = (0, locatorUtil_1.append)(itemLocatorBase, nthLocator); | ||
const selector = yield __1.locatorUtil.toCssSelector(itemLocator, host.interactor); | ||
const exists = yield host.interactor.exists(itemLocator); | ||
@@ -43,0 +45,0 @@ if (exists) { |
import { Optional } from './dataTypes'; | ||
import { ComponentDriver } from './drivers/ComponentDriver'; | ||
import { ContainerDriver } from './drivers/ContainerDriver'; | ||
import { ListComponentDriver, ListComponentDriverSpecificOption } from './drivers/ListComponentDriver'; | ||
import { WaitForOption } from './drivers/WaitForOption'; | ||
@@ -37,3 +38,17 @@ import { Interactor } from './interactor'; | ||
} | ||
export type ScenePartDefinition = ComponentPartDefinition<any> | ContainerPartDefinition<any, any>; | ||
export interface ListComponentPartDefinition<ItemT extends ComponentDriver<any>> { | ||
/** | ||
* The locator of the part | ||
*/ | ||
locator: PartLocator; | ||
/** | ||
* The class of driver which is used to interact with the element | ||
*/ | ||
driver: typeof ListComponentDriver<ItemT> | (new (locator: PartLocator, interactor: Interactor, option: ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>) => ListComponentDriver<ItemT>); | ||
/** | ||
* Option for the driver | ||
*/ | ||
option: ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>; | ||
} | ||
export type ScenePartDefinition = ComponentPartDefinition<any> | ContainerPartDefinition<any, any> | ListComponentPartDefinition<any>; | ||
/** | ||
@@ -40,0 +55,0 @@ * Part name to driver definition map |
{ | ||
"name": "@atomic-testing/core", | ||
"version": "0.31.0", | ||
"version": "0.32.0", | ||
"description": "Core library for atomic-testing", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
export { ComponentDriver } from './ComponentDriver'; | ||
export { ContainerDriver } from './ContainerDriver'; | ||
export { ListComponentDriver } from './ListComponentDriver'; | ||
export type { ListComponentDriverOption, ListComponentDriverSpecificOption } from './ListComponentDriver'; | ||
export * from './WaitForOption'; | ||
export type { IClickableDriver, IFormFieldDriver, IInputDriver, IToggleDriver } from './driverTypes'; | ||
export * as listHelper from './listHelper'; | ||
export * from './WaitForOption'; |
@@ -0,1 +1,2 @@ | ||
import { locatorUtil } from '..'; | ||
import { byCssSelector, CssLocator, LocatorRelativePosition, PartLocator } from '../locators'; | ||
@@ -23,2 +24,3 @@ import { ComponentDriverClass } from '../partTypes'; | ||
const itemLocator = append(itemLocatorBase, nthLocator); | ||
const selector = await locatorUtil.toCssSelector(itemLocator, host.interactor); | ||
const exists = await host.interactor.exists(itemLocator); | ||
@@ -25,0 +27,0 @@ if (exists) { |
import { Optional } from './dataTypes'; | ||
import { ComponentDriver } from './drivers/ComponentDriver'; | ||
import { ContainerDriver } from './drivers/ContainerDriver'; | ||
import { ListComponentDriver, ListComponentDriverSpecificOption } from './drivers/ListComponentDriver'; | ||
import { WaitForOption } from './drivers/WaitForOption'; | ||
@@ -56,4 +57,30 @@ import { Interactor } from './interactor'; | ||
export type ScenePartDefinition = ComponentPartDefinition<any> | ContainerPartDefinition<any, any>; | ||
export interface ListComponentPartDefinition<ItemT extends ComponentDriver<any>> { | ||
/** | ||
* The locator of the part | ||
*/ | ||
locator: PartLocator; | ||
/** | ||
* The class of driver which is used to interact with the element | ||
*/ | ||
driver: | ||
| typeof ListComponentDriver<ItemT> | ||
| (new ( | ||
locator: PartLocator, | ||
interactor: Interactor, | ||
option: ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>, | ||
) => ListComponentDriver<ItemT>); | ||
/** | ||
* Option for the driver | ||
*/ | ||
option: ListComponentDriverSpecificOption<ItemT> & Partial<IComponentDriverOption<any>>; | ||
} | ||
export type ScenePartDefinition = | ||
| ComponentPartDefinition<any> | ||
| ContainerPartDefinition<any, any> | ||
| ListComponentPartDefinition<any>; | ||
/** | ||
@@ -60,0 +87,0 @@ * Part name to driver definition map |
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
182171
195
3534