Core Modules@serenity-js/assertionsExpectationsincludesexternalincludes Callableincludes(...answerableArguments: [expected: Answerable<string>]): Expectation<string>Creates an expectation that is met when the actual string value includes a substring of expected. Ensuring that a given string includes the expected substringimport { actorCalled } from '@serenity-js/core'import { Ensure, includes } from '@serenity-js/assertions'await actorCalled('Ester').attemptsTo( Ensure.that('Hello World!', includes('World')),) Ensuring that page URL includes the expected substringPage.current().url() returns a QuestionAdapter<URL> a proxy object around the standard Node.js URL class, offering access to string properties such as hostname, pathname, and so on. import { actorCalled } from '@serenity-js/core'import { Ensure, includes } from '@serenity-js/assertions'import { Navigate, Page } from '@serenity-js/web'await actorCalled('Ester').attemptsTo( Navigate.to('/handbook'), Ensure.that(Page.current().url().hostname, includes('serenity-js')), Ensure.that(Page.current().url().pathname, includes('book')),)Parametersexternalrest...answerableArguments: [expected: Answerable<string>]Returns Expectation<string>
Creates an expectation that is met when the actual
string
value includes a substring ofexpected
.Ensuring that a given string includes the expected substring
Ensuring that page URL includes the expected substring
Page.current().url()
returns aQuestionAdapter<URL>
a proxy object around the standard Node.js URL class, offering access tostring
properties such ashostname
,pathname
, and so on.