Skip to content

Commit de5ffbc

Browse files
reins-chngbrown
authored andcommitted
🤖 Merge PR DefinitelyTyped#45772 [Nightwatch] Added startWith and endWith to Expect interface by @reins-ch
* Added startWith and endWith to Expect interface * Added test for startsWith and EndsWith * Fixed linting errors
1 parent 1b54abc commit de5ffbc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎types/nightwatch/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,10 @@ export interface Expect extends NightwatchLanguageChains, NightwatchBrowser {
552552
contain(value: string): this;
553553
contains(value: string): this;
554554
match(value: string | RegExp): this;
555+
startWith(value: string): this;
556+
startsWith(value: string): this;
557+
endWith(value: string): this;
558+
endsWith(value: string): this;
555559

556560
/**
557561
* Negates any of assertions following in the chain.

‎types/nightwatch/nightwatch-tests.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const testGeneral: NightwatchTests = {
2020
// expect element <body> to have attribute 'class' which contains text 'vasq'
2121
browser.expect.element('body').to.have.attribute('class').which.contains('vasq');
2222

23+
browser.expect.element('#hplogo').to.have.attribute('alt').which.startsWith('G').and.endsWith('oogle');
24+
2325
// expect element <#lst-ib> to be an input tag
2426
browser.expect.element('#lst-ib').to.be.an('input');
2527

0 commit comments

Comments
 (0)