import { Question, UsesAbilities } from '@serenity-js/core/lib/screenplay'; import { BrowseTheWeb } from '../abilities/browse_the_web'; export class Website { static title = (): Question> => new WebsiteTitle(); static url = (): Question> => new WebsiteUrl(); } class WebsiteTitle implements Question> { answeredBy(actor: UsesAbilities): PromiseLike { return BrowseTheWeb.as(actor).getTitle(); } toString = () => `the title of the current page`; } class WebsiteUrl implements Question> { answeredBy(actor: UsesAbilities): PromiseLike { return BrowseTheWeb.as(actor).getCurrentUrl(); } toString = () => `the url of the current page`; }