File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -333,7 +333,15 @@ export class TestingBehatRuntimeService {
333333 * @param locator Element locator.
334334 * @returns OK if successful, or ERROR: followed by message
335335 */
336- async press ( locator : TestingBehatElementLocator ) : Promise < string > {
336+ async press ( locator : TestingBehatElementLocator ) : Promise < string > ;
337+ async press ( text : string , nearText ?: string ) : Promise < string > ;
338+ async press ( locatorOrText : TestingBehatElementLocator | string , nearText ?: string ) : Promise < string > {
339+ const locator = typeof locatorOrText === 'string' ? { text : locatorOrText } : locatorOrText ;
340+
341+ if ( nearText ) {
342+ locator . near = { text : nearText } ;
343+ }
344+
337345 this . log ( 'Action - Press' , locator ) ;
338346
339347 try {
You can’t perform that action at this time.
0 commit comments