@atomic-testing/core
Advanced tools
Comparing version 0.17.0 to 0.18.0
@@ -11,3 +11,4 @@ export { ComponentDriver } from './ComponentDriver'; | ||
export * as domUtil from './utils/domUtil'; | ||
export * as escapeUtil from './utils/escapeUtil'; | ||
export * as locatorUtil from './utils/locatorUtil'; | ||
export * as timingUtil from './utils/timingUtil'; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.timingUtil = exports.locatorUtil = exports.domUtil = exports.collectionUtil = exports.TestEngine = exports.TooManyMatchingElementErrorId = exports.TooManyMatchingElementError = exports.defaultStep = exports.defaultOnFinishUpdate = exports.ComponentDriver = void 0; | ||
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"); | ||
@@ -45,4 +45,5 @@ Object.defineProperty(exports, "ComponentDriver", { enumerable: true, get: function () { return ComponentDriver_1.ComponentDriver; } }); | ||
exports.domUtil = __importStar(require("./utils/domUtil")); | ||
exports.escapeUtil = __importStar(require("./utils/escapeUtil")); | ||
exports.locatorUtil = __importStar(require("./utils/locatorUtil")); | ||
exports.timingUtil = __importStar(require("./utils/timingUtil")); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.byAttribute = void 0; | ||
const escapeUtil_1 = require("../utils/escapeUtil"); | ||
const PartLocatorType_1 = require("./PartLocatorType"); | ||
function byAttribute(name, value, relativeTo = PartLocatorType_1.LocatorRelativePosition.Descendent) { | ||
const selector = `[${name}="${encodeURIComponent(value)}"]`; | ||
const selector = `[${(0, escapeUtil_1.escapeName)(name)}="${(0, escapeUtil_1.escapeValue)(value)}"]`; | ||
return { | ||
@@ -8,0 +9,0 @@ type: PartLocatorType_1.LocatorType.Css, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.byCssClass = void 0; | ||
const escapeUtil_1 = require("../utils/escapeUtil"); | ||
const PartLocatorType_1 = require("./PartLocatorType"); | ||
function byCssClass(className, relativeTo = PartLocatorType_1.LocatorRelativePosition.Descendent) { | ||
const classNames = Array.isArray(className) ? className : [className]; | ||
const selector = classNames.map((cls) => `.${cls}`).join(''); | ||
const selector = classNames.map((cls) => `.${(0, escapeUtil_1.escapeCssClassName)(cls)}`).join(''); | ||
return { | ||
@@ -9,0 +10,0 @@ type: PartLocatorType_1.LocatorType.Css, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.byDataTestId = void 0; | ||
const escapeUtil_1 = require("../utils/escapeUtil"); | ||
const PartLocatorType_1 = require("./PartLocatorType"); | ||
function byDataTestId(id, relativeTo = PartLocatorType_1.LocatorRelativePosition.Descendent) { | ||
const ids = Array.isArray(id) ? id : [id]; | ||
const selector = ids.map((idVal) => `[data-testid="${idVal}"]`).join(' '); | ||
const selector = ids.map((idVal) => `[data-testid="${(0, escapeUtil_1.escapeValue)(idVal)}"]`).join(' '); | ||
return { | ||
@@ -9,0 +10,0 @@ type: PartLocatorType_1.LocatorType.Css, |
@@ -5,6 +5,7 @@ "use strict"; | ||
exports.byInputType = void 0; | ||
const escapeUtil_1 = require("../utils/escapeUtil"); | ||
const PartLocatorType_1 = require("./PartLocatorType"); | ||
// to implementation other than CSS selector | ||
function byInputType(type, relative = PartLocatorType_1.LocatorRelativePosition.Descendent) { | ||
const selector = `input[type=${type}]`; | ||
const selector = `input[type=${(0, escapeUtil_1.escapeValue)(type)}]`; | ||
return { | ||
@@ -11,0 +12,0 @@ type: PartLocatorType_1.LocatorType.Css, |
@@ -1,3 +0,2 @@ | ||
import 'css.escape'; | ||
import { LocatorRelativePosition, PartLocatorType } from './PartLocatorType'; | ||
export declare function byName(value: string, relative?: LocatorRelativePosition): PartLocatorType; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.byName = void 0; | ||
require("css.escape"); | ||
const escapeUtil_1 = require("../utils/escapeUtil"); | ||
const PartLocatorType_1 = require("./PartLocatorType"); | ||
function byName(value, relative = PartLocatorType_1.LocatorRelativePosition.Descendent) { | ||
const sanitized = CSS.escape(value); | ||
const sanitized = (0, escapeUtil_1.escapeValue)(value); | ||
return { | ||
@@ -9,0 +9,0 @@ type: PartLocatorType_1.LocatorType.Css, |
@@ -1,3 +0,2 @@ | ||
import 'css.escape'; | ||
import { LocatorRelativePosition, PartLocatorType } from './PartLocatorType'; | ||
export declare function byRole(value: string, relative?: LocatorRelativePosition): PartLocatorType; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.byRole = void 0; | ||
require("css.escape"); | ||
const escapeUtil_1 = require("../utils/escapeUtil"); | ||
const PartLocatorType_1 = require("./PartLocatorType"); | ||
function byRole(value, relative = PartLocatorType_1.LocatorRelativePosition.Descendent) { | ||
const sanitized = value; | ||
const sanitized = (0, escapeUtil_1.escapeValue)(value); | ||
return { | ||
@@ -9,0 +9,0 @@ type: PartLocatorType_1.LocatorType.Css, |
@@ -1,3 +0,2 @@ | ||
import 'css.escape'; | ||
import { LocatorRelativePosition, PartLocatorType } from './PartLocatorType'; | ||
export declare function byValue(value: string, relative?: LocatorRelativePosition): PartLocatorType; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.byValue = void 0; | ||
require("css.escape"); | ||
const escapeUtil_1 = require("../utils/escapeUtil"); | ||
const PartLocatorType_1 = require("./PartLocatorType"); | ||
function byValue(value, relative = PartLocatorType_1.LocatorRelativePosition.Descendent) { | ||
const sanitized = value; | ||
const sanitized = (0, escapeUtil_1.escapeValue)(value); | ||
return { | ||
@@ -9,0 +9,0 @@ type: PartLocatorType_1.LocatorType.Css, |
{ | ||
"name": "@atomic-testing/core", | ||
"version": "0.17.0", | ||
"version": "0.18.0", | ||
"description": "Core library for atomic-testing", | ||
@@ -18,3 +18,2 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/css.escape": "^1.5.0", | ||
"@types/node": "^16.0.0", | ||
@@ -26,5 +25,3 @@ "jest": "^29.2.0", | ||
}, | ||
"dependencies": { | ||
"css.escape": "^1.5.0" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": {}, | ||
@@ -31,0 +28,0 @@ "scripts": { |
@@ -22,3 +22,4 @@ export { ComponentDriver } from './ComponentDriver'; | ||
export * as domUtil from './utils/domUtil'; | ||
export * as escapeUtil from './utils/escapeUtil'; | ||
export * as locatorUtil from './utils/locatorUtil'; | ||
export * as timingUtil from './utils/timingUtil'; |
@@ -0,1 +1,2 @@ | ||
import { escapeName, escapeValue } from '../utils/escapeUtil'; | ||
import { LocatorRelativePosition, LocatorType, PartLocatorType } from './PartLocatorType'; | ||
@@ -8,3 +9,3 @@ | ||
): PartLocatorType { | ||
const selector = `[${name}="${encodeURIComponent(value)}"]`; | ||
const selector = `[${escapeName(name)}="${escapeValue(value)}"]`; | ||
@@ -11,0 +12,0 @@ return { |
@@ -0,1 +1,2 @@ | ||
import { escapeCssClassName } from '../utils/escapeUtil'; | ||
import { LocatorRelativePosition, LocatorType, PartLocatorType } from './PartLocatorType'; | ||
@@ -8,3 +9,3 @@ | ||
const classNames = Array.isArray(className) ? className : [className]; | ||
const selector = classNames.map((cls) => `.${cls}`).join(''); | ||
const selector = classNames.map((cls) => `.${escapeCssClassName(cls)}`).join(''); | ||
@@ -11,0 +12,0 @@ return { |
@@ -0,1 +1,2 @@ | ||
import { escapeValue } from '../utils/escapeUtil'; | ||
import { LocatorRelativePosition, LocatorType, PartLocatorType } from './PartLocatorType'; | ||
@@ -8,3 +9,3 @@ | ||
const ids = Array.isArray(id) ? id : [id]; | ||
const selector = ids.map((idVal) => `[data-testid="${idVal}"]`).join(' '); | ||
const selector = ids.map((idVal) => `[data-testid="${escapeValue(idVal)}"]`).join(' '); | ||
@@ -11,0 +12,0 @@ return { |
// TODO: Use descriptive selector instead of css selector so the selector can be reintepreted | ||
import { escapeValue } from '../utils/escapeUtil'; | ||
import { LocatorRelativePosition, LocatorType, PartLocatorType } from './PartLocatorType'; | ||
@@ -10,3 +11,3 @@ | ||
): PartLocatorType { | ||
const selector = `input[type=${type}]`; | ||
const selector = `input[type=${escapeValue(type)}]`; | ||
return { | ||
@@ -13,0 +14,0 @@ type: LocatorType.Css, |
@@ -1,3 +0,2 @@ | ||
import 'css.escape'; | ||
import { escapeValue } from '../utils/escapeUtil'; | ||
import { LocatorRelativePosition, LocatorType, PartLocatorType } from './PartLocatorType'; | ||
@@ -9,3 +8,3 @@ | ||
): PartLocatorType { | ||
const sanitized = CSS.escape(value); | ||
const sanitized = escapeValue(value); | ||
return { | ||
@@ -12,0 +11,0 @@ type: LocatorType.Css, |
@@ -1,3 +0,2 @@ | ||
import 'css.escape'; | ||
import { escapeValue } from '../utils/escapeUtil'; | ||
import { LocatorRelativePosition, LocatorType, PartLocatorType } from './PartLocatorType'; | ||
@@ -9,3 +8,3 @@ | ||
): PartLocatorType { | ||
const sanitized = value; | ||
const sanitized = escapeValue(value); | ||
return { | ||
@@ -12,0 +11,0 @@ type: LocatorType.Css, |
@@ -1,3 +0,2 @@ | ||
import 'css.escape'; | ||
import { escapeValue } from '../utils/escapeUtil'; | ||
import { LocatorRelativePosition, LocatorType, PartLocatorType } from './PartLocatorType'; | ||
@@ -9,3 +8,3 @@ | ||
): PartLocatorType { | ||
const sanitized = value; | ||
const sanitized = escapeValue(value); | ||
return { | ||
@@ -12,0 +11,0 @@ type: LocatorType.Css, |
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
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
71587
0
5
103
1389
- Removedcss.escape@^1.5.0
- Removedcss.escape@1.5.1(transitive)