@serenity-js/web
Advanced tools
Comparing version 3.0.0-rc.40 to 3.0.0-rc.41
@@ -6,2 +6,20 @@ # Change Log | ||
# [3.0.0-rc.41](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.40...v3.0.0-rc.41) (2023-02-07) | ||
### Bug Fixes | ||
* **core:** introduced ExpectationDetails to provide more accurate info re failed expectations ([02b8f33](https://github.com/serenity-js/serenity-js/commit/02b8f33732341a9391192fc52a59ea8a8f5f19f0)), closes [#1102](https://github.com/serenity-js/serenity-js/issues/1102) | ||
* **web:** renamed internal function `inspector` to `inspected` ([4d2b147](https://github.com/serenity-js/serenity-js/commit/4d2b14750ee2bfa3794cd0d5eba993689f1bc8b5)) | ||
### Features | ||
* **core:** assertion errors include precise information about unmet expectations and improved diffs ([1eb09b1](https://github.com/serenity-js/serenity-js/commit/1eb09b1c1c8fb059b53bd7fcefab660581abc7bc)), closes [#1102](https://github.com/serenity-js/serenity-js/issues/1102) | ||
* **core:** overridable abilities ([03966cc](https://github.com/serenity-js/serenity-js/commit/03966ccae40d102b7dbca1125beb90ceda8fbc50)) | ||
# [3.0.0-rc.40](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.39...v3.0.0-rc.40) (2023-01-06) | ||
@@ -8,0 +26,0 @@ |
@@ -1,2 +0,1 @@ | ||
export * from './ElementExpectation'; | ||
export * from './isActive'; | ||
@@ -3,0 +2,0 @@ export * from './isClickable'; |
@@ -17,3 +17,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./ElementExpectation"), exports); | ||
__exportStar(require("./isActive"), exports); | ||
@@ -20,0 +19,0 @@ __exportStar(require("./isClickable"), exports); |
@@ -6,3 +6,3 @@ "use strict"; | ||
const core_1 = require("@serenity-js/core"); | ||
const ElementExpectation_1 = require("./ElementExpectation"); | ||
const isElementActive = core_1.Expectation.define('isActive', 'become active', (actual) => actual.isActive()); | ||
/** | ||
@@ -26,5 +26,5 @@ * {@apilink Expectation} that an element is "active", which means it resolves to `true` when: | ||
function isActive() { | ||
return core_1.Expectation.to('become active').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), ElementExpectation_1.ElementExpectation.forElementTo('become active', actual => actual.isActive()))); | ||
return core_1.Expectation.to('become active').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), isElementActive())); | ||
} | ||
exports.isActive = isActive; | ||
//# sourceMappingURL=isActive.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
const core_1 = require("@serenity-js/core"); | ||
const ElementExpectation_1 = require("./ElementExpectation"); | ||
const isElementClickable = core_1.Expectation.define('isClickable', 'become clickable', (actual) => actual.isClickable()); | ||
/** | ||
@@ -26,5 +26,5 @@ * {@apilink Expectation} that an element is clickable, which means it resolves to `true` when: | ||
function isClickable() { | ||
return core_1.Expectation.to('become clickable').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), ElementExpectation_1.ElementExpectation.forElementTo('become clickable', actual => actual.isClickable()))); | ||
return core_1.Expectation.to('become clickable').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), isElementClickable())); | ||
} | ||
exports.isClickable = isClickable; | ||
//# sourceMappingURL=isClickable.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
const core_1 = require("@serenity-js/core"); | ||
const ElementExpectation_1 = require("./ElementExpectation"); | ||
const isElementEnabled = core_1.Expectation.define('isEnabled', 'become enabled', (actual) => actual.isEnabled()); | ||
/** | ||
@@ -26,5 +26,5 @@ * {@apilink Expectation} that an element is enabled, which means it resolves to `true` when: | ||
function isEnabled() { | ||
return core_1.Expectation.to('become enabled').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), ElementExpectation_1.ElementExpectation.forElementTo('become enabled', actual => actual.isEnabled()))); | ||
return core_1.Expectation.to('become enabled').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), isElementEnabled())); | ||
} | ||
exports.isEnabled = isEnabled; | ||
//# sourceMappingURL=isEnabled.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
const core_1 = require("@serenity-js/core"); | ||
const ElementExpectation_1 = require("./ElementExpectation"); | ||
const isElementSelected = core_1.Expectation.define('isSelected', 'become selected', (actual) => actual.isSelected()); | ||
/** | ||
@@ -26,5 +26,5 @@ * {@apilink Expectation} that an `<option>` or `<input>` element is selected, which means it resolves to `true` when: | ||
function isSelected() { | ||
return core_1.Expectation.to('become selected').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), ElementExpectation_1.ElementExpectation.forElementTo('become selected', actual => actual.isSelected()))); | ||
return core_1.Expectation.to('become selected').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), isElementSelected())); | ||
} | ||
exports.isSelected = isSelected; | ||
//# sourceMappingURL=isSelected.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
const core_1 = require("@serenity-js/core"); | ||
const ElementExpectation_1 = require("./ElementExpectation"); | ||
const isElementVisible = core_1.Expectation.define('isVisible', 'become visible', (actual) => actual.isVisible()); | ||
/** | ||
@@ -26,5 +26,5 @@ * {@apilink Expectation} that an element is visible, which means it resolves to `true` when: | ||
function isVisible() { | ||
return core_1.Expectation.to('become visible').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), ElementExpectation_1.ElementExpectation.forElementTo('become visible', actual => actual.isVisible()))); | ||
return core_1.Expectation.to('become visible').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), isElementVisible())); | ||
} | ||
exports.isVisible = isVisible; | ||
//# sourceMappingURL=isVisible.js.map |
@@ -1,2 +0,2 @@ | ||
import { Ability, UsesAbilities } from '@serenity-js/core'; | ||
import { Ability } from '@serenity-js/core'; | ||
import { BrowserCapabilities, BrowsingSession, Page } from '../models'; | ||
@@ -79,14 +79,6 @@ /** | ||
*/ | ||
export declare abstract class BrowseTheWeb<Native_Element_Type = any> implements Ability { | ||
export declare abstract class BrowseTheWeb<Native_Element_Type = any> extends Ability { | ||
protected readonly session: BrowsingSession<Page<Native_Element_Type>>; | ||
constructor(session: BrowsingSession<Page<Native_Element_Type>>); | ||
/** | ||
* Used to access the {@apilink Actor}'s {@apilink Ability|ability} to {@apilink BrowseTheWeb} | ||
* from within the {@apilink Interaction|interactions}, such as {@apilink Click}, | ||
* and {@apilink Question|questions}, such as {@apilink Attribute}. | ||
* | ||
* @param actor | ||
*/ | ||
static as<NET = any>(actor: UsesAbilities): BrowseTheWeb<NET>; | ||
protected constructor(session: BrowsingSession<Page<Native_Element_Type>>); | ||
/** | ||
* Returns {@apilink BrowserCapabilities|basic meta-data} about the browser associated with this ability. | ||
@@ -93,0 +85,0 @@ */ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BrowseTheWeb = void 0; | ||
const core_1 = require("@serenity-js/core"); | ||
/** | ||
@@ -80,14 +81,5 @@ * The {@apilink Ability|ability} to `BrowseTheWeb` enables an {@apilink Actor|actor} | ||
*/ | ||
class BrowseTheWeb { | ||
/** | ||
* Used to access the {@apilink Actor}'s {@apilink Ability|ability} to {@apilink BrowseTheWeb} | ||
* from within the {@apilink Interaction|interactions}, such as {@apilink Click}, | ||
* and {@apilink Question|questions}, such as {@apilink Attribute}. | ||
* | ||
* @param actor | ||
*/ | ||
static as(actor) { | ||
return actor.abilityTo(BrowseTheWeb); | ||
} | ||
class BrowseTheWeb extends core_1.Ability { | ||
constructor(session) { | ||
super(); | ||
this.session = session; | ||
@@ -94,0 +86,0 @@ } |
@@ -223,3 +223,3 @@ "use strict"; | ||
return new ExecuteAsynchronousScript(args.length > 0 | ||
? (0, core_1.d) `#actor executes an asynchronous script with arguments: ${args}` | ||
? (0, core_1.f) `#actor executes an asynchronous script with arguments: ${args}` | ||
: this.toString(), this.script, args); | ||
@@ -240,3 +240,3 @@ } | ||
constructor(sourceUrl) { | ||
super((0, core_1.d) `#actor executes a script from ${sourceUrl}`); | ||
super((0, core_1.f) `#actor executes a script from ${sourceUrl}`); | ||
this.sourceUrl = sourceUrl; | ||
@@ -283,3 +283,3 @@ } | ||
return new ExecuteSynchronousScript(args.length > 0 | ||
? (0, core_1.d) `#actor executes a synchronous script with arguments: ${args}` | ||
? (0, core_1.f) `#actor executes a synchronous script with arguments: ${args}` | ||
: this.toString(), this.script, args); | ||
@@ -286,0 +286,0 @@ } |
@@ -6,3 +6,3 @@ "use strict"; | ||
const io_1 = require("@serenity-js/core/lib/io"); | ||
const inspected_1 = require("@serenity-js/core/lib/io/inspected"); | ||
const stringified_1 = require("@serenity-js/core/lib/io/stringified"); | ||
const screenplay_1 = require("@serenity-js/core/lib/screenplay"); | ||
@@ -133,3 +133,3 @@ const models_1 = require("../models"); | ||
return { | ||
from: (pageElement) => screenplay_1.Interaction.where(`#actor selects values ${(0, io_1.commaSeparated)(values.flat(), item => (0, inspected_1.inspected)(item, { inline: true }))} from ${(0, inspected_1.inspected)(pageElement, { inline: true })}`, async (actor) => { | ||
from: (pageElement) => screenplay_1.Interaction.where(`#actor selects values ${(0, io_1.commaSeparated)(values.flat(), item => (0, stringified_1.stringified)(item, { inline: true }))} from ${(0, stringified_1.stringified)(pageElement, { inline: true })}`, async (actor) => { | ||
const answers = await (0, io_1.asyncMap)(values, value => actor.answer(value)); | ||
@@ -260,3 +260,3 @@ const desiredValues = answers.flat(); | ||
return { | ||
from: (pageElement) => screenplay_1.Interaction.where(`#actor selects ${(0, io_1.commaSeparated)(values.flat(), item => (0, inspected_1.inspected)(item, { inline: true }))} from ${(0, inspected_1.inspected)(pageElement, { inline: true })}`, async (actor) => { | ||
from: (pageElement) => screenplay_1.Interaction.where(`#actor selects ${(0, io_1.commaSeparated)(values.flat(), item => (0, stringified_1.stringified)(item, { inline: true }))} from ${(0, stringified_1.stringified)(pageElement, { inline: true })}`, async (actor) => { | ||
const answers = await (0, io_1.asyncMap)(values, value => actor.answer(value)); | ||
@@ -263,0 +263,0 @@ const desiredLabels = answers.flat(); |
@@ -0,1 +1,3 @@ | ||
/// <reference types="node" /> | ||
import * as util from 'util'; | ||
import { PageElement } from './PageElement'; | ||
@@ -31,3 +33,4 @@ import { RootLocator } from './RootLocator'; | ||
toString(): string; | ||
[util.inspect.custom]: (depth: number, options: util.InspectOptionsStylized, inspect: typeof util.inspect) => string; | ||
} | ||
//# sourceMappingURL=Locator.d.ts.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var _a; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Locator = void 0; | ||
const io_1 = require("@serenity-js/core/lib/io"); | ||
const util = __importStar(require("util")); // eslint-disable-line unicorn/import-style | ||
const RootLocator_1 = require("./RootLocator"); | ||
@@ -22,2 +48,3 @@ /** | ||
this.selector = selector; | ||
this[_a] = (0, io_1.inspectedObject)(this, ['parent', 'selector']); | ||
} | ||
@@ -38,2 +65,3 @@ async switchToFrame(element) { | ||
exports.Locator = Locator; | ||
_a = util.inspect.custom; | ||
//# sourceMappingURL=Locator.js.map |
@@ -0,2 +1,4 @@ | ||
/// <reference types="node" /> | ||
import { Optional } from '@serenity-js/core'; | ||
import * as util from 'util'; | ||
/** | ||
@@ -21,3 +23,4 @@ * {@apilink RootLocator} represents the context in which {@apilink Locator} looks for {@apilink PageElement} or {@apilink PageElements}. | ||
toString(): string; | ||
[util.inspect.custom]: (depth: number, options: util.InspectOptionsStylized, inspect: typeof util.inspect) => string; | ||
} | ||
//# sourceMappingURL=RootLocator.d.ts.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var _a; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RootLocator = void 0; | ||
const io_1 = require("@serenity-js/core/lib/io"); | ||
const util = __importStar(require("util")); // eslint-disable-line unicorn/import-style | ||
/** | ||
@@ -17,2 +43,5 @@ * {@apilink RootLocator} represents the context in which {@apilink Locator} looks for {@apilink PageElement} or {@apilink PageElements}. | ||
class RootLocator { | ||
constructor() { | ||
this[_a] = (0, io_1.inspectedObject)(this, []); | ||
} | ||
toString() { | ||
@@ -23,2 +52,3 @@ return 'root locator'; | ||
exports.RootLocator = RootLocator; | ||
_a = util.inspect.custom; | ||
//# sourceMappingURL=RootLocator.js.map |
{ | ||
"name": "@serenity-js/web", | ||
"version": "3.0.0-rc.40", | ||
"version": "3.0.0-rc.41", | ||
"description": "Serenity/JS Screenplay Pattern APIs for the Web", | ||
@@ -47,4 +47,4 @@ "author": { | ||
"dependencies": { | ||
"@serenity-js/assertions": "3.0.0-rc.40", | ||
"@serenity-js/core": "3.0.0-rc.40", | ||
"@serenity-js/assertions": "3.0.0-rc.41", | ||
"@serenity-js/core": "3.0.0-rc.41", | ||
"tiny-types": "^1.19.0" | ||
@@ -61,3 +61,3 @@ }, | ||
}, | ||
"gitHead": "94e7c72355737fe8bf1ad005c1677af13aa8e872" | ||
"gitHead": "e74f8f4989f18fe37edde3f8500b2084289d385b" | ||
} |
@@ -1,2 +0,1 @@ | ||
export * from './ElementExpectation'; | ||
export * from './isActive'; | ||
@@ -3,0 +2,0 @@ export * from './isClickable'; |
@@ -5,4 +5,8 @@ import { and, isPresent } from '@serenity-js/assertions'; | ||
import { PageElement } from '../screenplay'; | ||
import { ElementExpectation } from './ElementExpectation'; | ||
const isElementActive = Expectation.define( | ||
'isActive', 'become active', | ||
(actual: PageElement) => actual.isActive(), | ||
); | ||
/** | ||
@@ -26,6 +30,6 @@ * {@apilink Expectation} that an element is "active", which means it resolves to `true` when: | ||
export function isActive(): Expectation<PageElement> { | ||
return Expectation.to<boolean, PageElement>('become active').soThatActual(and( | ||
return Expectation.to<PageElement>('become active').soThatActual(and( | ||
isPresent(), | ||
ElementExpectation.forElementTo('become active', actual => actual.isActive()), | ||
isElementActive(), | ||
)); | ||
} |
@@ -5,4 +5,8 @@ import { and, isPresent } from '@serenity-js/assertions'; | ||
import { PageElement } from '../screenplay'; | ||
import { ElementExpectation } from './ElementExpectation'; | ||
const isElementClickable = Expectation.define( | ||
'isClickable', 'become clickable', | ||
(actual: PageElement) => actual.isClickable(), | ||
); | ||
/** | ||
@@ -26,6 +30,6 @@ * {@apilink Expectation} that an element is clickable, which means it resolves to `true` when: | ||
export function isClickable(): Expectation<PageElement> { | ||
return Expectation.to<boolean, PageElement>('become clickable').soThatActual(and( | ||
return Expectation.to<PageElement>('become clickable').soThatActual(and( | ||
isPresent(), | ||
ElementExpectation.forElementTo('become clickable', actual => actual.isClickable()) | ||
isElementClickable(), | ||
)); | ||
} |
@@ -5,4 +5,8 @@ import { and, isPresent } from '@serenity-js/assertions'; | ||
import { PageElement } from '../screenplay'; | ||
import { ElementExpectation } from './ElementExpectation'; | ||
const isElementEnabled = Expectation.define( | ||
'isEnabled', 'become enabled', | ||
(actual: PageElement) => actual.isEnabled(), | ||
); | ||
/** | ||
@@ -26,6 +30,6 @@ * {@apilink Expectation} that an element is enabled, which means it resolves to `true` when: | ||
export function isEnabled(): Expectation<PageElement> { | ||
return Expectation.to<boolean, PageElement>('become enabled').soThatActual(and( | ||
return Expectation.to<PageElement>('become enabled').soThatActual(and( | ||
isPresent(), | ||
ElementExpectation.forElementTo('become enabled', actual => actual.isEnabled()) | ||
isElementEnabled(), | ||
)); | ||
} |
@@ -5,4 +5,8 @@ import { and, isPresent } from '@serenity-js/assertions'; | ||
import { PageElement } from '../screenplay'; | ||
import { ElementExpectation } from './ElementExpectation'; | ||
const isElementSelected = Expectation.define( | ||
'isSelected', 'become selected', | ||
(actual: PageElement) => actual.isSelected(), | ||
); | ||
/** | ||
@@ -26,6 +30,6 @@ * {@apilink Expectation} that an `<option>` or `<input>` element is selected, which means it resolves to `true` when: | ||
export function isSelected(): Expectation<PageElement> { | ||
return Expectation.to<boolean, PageElement>('become selected').soThatActual(and( | ||
return Expectation.to<PageElement>('become selected').soThatActual(and( | ||
isPresent(), | ||
ElementExpectation.forElementTo('become selected', actual => actual.isSelected()), | ||
isElementSelected(), | ||
)); | ||
} |
@@ -5,4 +5,8 @@ import { and, isPresent } from '@serenity-js/assertions'; | ||
import { PageElement } from '../screenplay'; | ||
import { ElementExpectation } from './ElementExpectation'; | ||
const isElementVisible = Expectation.define( | ||
'isVisible', 'become visible', | ||
(actual: PageElement) => actual.isVisible(), | ||
); | ||
/** | ||
@@ -26,6 +30,6 @@ * {@apilink Expectation} that an element is visible, which means it resolves to `true` when: | ||
export function isVisible(): Expectation<PageElement> { | ||
return Expectation.to<boolean, PageElement>('become visible').soThatActual(and( | ||
return Expectation.to<PageElement>('become visible').soThatActual(and( | ||
isPresent(), | ||
ElementExpectation.forElementTo('become visible', actual => actual.isVisible()), | ||
isElementVisible(), | ||
)); | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Ability, UsesAbilities } from '@serenity-js/core'; | ||
import { Ability } from '@serenity-js/core'; | ||
@@ -81,18 +81,8 @@ import { BrowserCapabilities, BrowsingSession, Page } from '../models'; | ||
*/ | ||
export abstract class BrowseTheWeb<Native_Element_Type = any> implements Ability { | ||
export abstract class BrowseTheWeb<Native_Element_Type = any> extends Ability { | ||
/** | ||
* Used to access the {@apilink Actor}'s {@apilink Ability|ability} to {@apilink BrowseTheWeb} | ||
* from within the {@apilink Interaction|interactions}, such as {@apilink Click}, | ||
* and {@apilink Question|questions}, such as {@apilink Attribute}. | ||
* | ||
* @param actor | ||
*/ | ||
static as<NET = any>(actor: UsesAbilities): BrowseTheWeb<NET> { | ||
return actor.abilityTo(BrowseTheWeb) as BrowseTheWeb<NET>; | ||
constructor(protected readonly session: BrowsingSession<Page<Native_Element_Type>>) { | ||
super(); | ||
} | ||
protected constructor(protected readonly session: BrowsingSession<Page<Native_Element_Type>>) { | ||
} | ||
/** | ||
@@ -99,0 +89,0 @@ * Returns {@apilink BrowserCapabilities|basic meta-data} about the browser associated with this ability. |
@@ -1,2 +0,2 @@ | ||
import { Answerable, AnswersQuestions, CollectsArtifacts, d, Interaction, LogicError, UsesAbilities } from '@serenity-js/core'; | ||
import { Answerable, AnswersQuestions, CollectsArtifacts, f, Interaction, LogicError, UsesAbilities } from '@serenity-js/core'; | ||
import { asyncMap } from '@serenity-js/core/lib/io'; | ||
@@ -250,3 +250,3 @@ import { Name, TextData } from '@serenity-js/core/lib/model'; | ||
args.length > 0 | ||
? d `#actor executes an asynchronous script with arguments: ${ args }` | ||
? f `#actor executes an asynchronous script with arguments: ${ args }` | ||
: this.toString(), | ||
@@ -272,3 +272,3 @@ this.script, | ||
constructor(private readonly sourceUrl: Answerable<string>) { | ||
super(d`#actor executes a script from ${ sourceUrl }`); | ||
super(f`#actor executes a script from ${ sourceUrl }`); | ||
} | ||
@@ -324,3 +324,3 @@ | ||
args.length > 0 | ||
? d `#actor executes a synchronous script with arguments: ${ args }` | ||
? f `#actor executes a synchronous script with arguments: ${ args }` | ||
: this.toString(), | ||
@@ -327,0 +327,0 @@ this.script, |
import { Answerable, d } from '@serenity-js/core'; | ||
import { asyncMap, commaSeparated } from '@serenity-js/core/lib/io'; | ||
import { inspected } from '@serenity-js/core/lib/io/inspected'; | ||
import { stringified } from '@serenity-js/core/lib/io/stringified'; | ||
import { Interaction } from '@serenity-js/core/lib/screenplay'; | ||
@@ -136,3 +136,3 @@ | ||
from: (pageElement: Answerable<PageElement>): Interaction => | ||
Interaction.where(`#actor selects values ${ commaSeparated(values.flat(), item => inspected(item, { inline: true })) } from ${ inspected(pageElement, { inline: true }) }`, async actor => { | ||
Interaction.where(`#actor selects values ${ commaSeparated(values.flat(), item => stringified(item, { inline: true })) } from ${ stringified(pageElement, { inline: true }) }`, async actor => { | ||
@@ -271,3 +271,3 @@ const answers = await asyncMap(values, value => actor.answer(value)); | ||
from: (pageElement: Answerable<PageElement>): Interaction => | ||
Interaction.where(`#actor selects ${ commaSeparated(values.flat(), item => inspected(item, { inline: true })) } from ${ inspected(pageElement, { inline: true }) }`, async actor => { | ||
Interaction.where(`#actor selects ${ commaSeparated(values.flat(), item => stringified(item, { inline: true })) } from ${ stringified(pageElement, { inline: true }) }`, async actor => { | ||
@@ -274,0 +274,0 @@ const answers = await asyncMap(values, value => actor.answer(value)); |
@@ -0,1 +1,4 @@ | ||
import { inspectedObject } from '@serenity-js/core/lib/io'; | ||
import * as util from 'util'; // eslint-disable-line unicorn/import-style | ||
import { PageElement } from './PageElement'; | ||
@@ -54,2 +57,4 @@ import { RootLocator } from './RootLocator'; | ||
} | ||
[util.inspect.custom] = inspectedObject(this, [ 'parent' as keyof this, 'selector' ]); | ||
} |
@@ -235,3 +235,3 @@ import { Expectation, ExpectationMet, ExpectationOutcome, LogicError, Optional, Question, QuestionAdapter } from '@serenity-js/core'; | ||
private static async findMatchingPage(expectationDescription: string, pages: Page[], matcher: (page: Page) => Promise<ExpectationOutcome<any, any>>): Promise<Page> { | ||
private static async findMatchingPage(expectationDescription: string, pages: Page[], matcher: (page: Page) => Promise<ExpectationOutcome>): Promise<Page> { | ||
for (const page of pages) { | ||
@@ -238,0 +238,0 @@ const outcome = await matcher(page); |
@@ -27,3 +27,3 @@ import { Answerable, d, MetaQuestion, Optional, Question, QuestionAdapter } from '@serenity-js/core'; | ||
const bySelector = await actor.answer(selector); | ||
const currentPage = await BrowseTheWeb.as<NET>(actor).currentPage(); | ||
const currentPage = await BrowseTheWeb.as<BrowseTheWeb<NET>>(actor).currentPage(); | ||
@@ -30,0 +30,0 @@ return currentPage.locate(bySelector); |
@@ -46,4 +46,5 @@ import { Answerable, List, MetaQuestion, Question } from '@serenity-js/core'; | ||
return Question.about(String(selector), async actor => { | ||
const bySelector = await actor.answer(selector); | ||
const currentPage = await BrowseTheWeb.as(actor).currentPage(); | ||
const bySelector = await actor.answer(selector); | ||
const currentPage = await BrowseTheWeb.as<BrowseTheWeb<Native_Element_Type>>(actor).currentPage(); | ||
return currentPage.locate(bySelector).locator; | ||
@@ -50,0 +51,0 @@ }); |
import { Optional } from '@serenity-js/core'; | ||
import { inspectedObject } from '@serenity-js/core/lib/io'; | ||
import * as util from 'util'; // eslint-disable-line unicorn/import-style | ||
@@ -26,2 +28,4 @@ /** | ||
} | ||
[util.inspect.custom] = inspectedObject(this, [ ]) | ||
} |
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
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
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
671200
386
14593
+ Added@serenity-js/assertions@3.0.0-rc.41(transitive)
+ Added@serenity-js/core@3.0.0-rc.41(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removed@serenity-js/assertions@3.0.0-rc.40(transitive)
- Removed@serenity-js/core@3.0.0-rc.40(transitive)