File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export class References {
1919 }
2020
2121 async waitForReferencesCountInTitle ( count : number ) : Promise < void > {
22- await this . api . waitForText ( References . REFERENCES_TITLE_COUNT , void 0 , titleCount => {
22+ await this . api . waitForTextContent ( References . REFERENCES_TITLE_COUNT , void 0 , titleCount => {
2323 const matches = titleCount . match ( / \d + / ) ;
2424 return matches ? parseInt ( matches [ 0 ] ) === count : false ;
2525 } ) ;
@@ -30,7 +30,7 @@ export class References {
3030 }
3131
3232 async waitForFile ( file : string ) : Promise < void > {
33- await this . api . waitForText ( References . REFERENCES_TITLE_FILE_NAME , file ) ;
33+ await this . api . waitForTextContent ( References . REFERENCES_TITLE_FILE_NAME , file ) ;
3434 }
3535
3636 async close ( ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export class Explorer extends Viewlet {
2222 }
2323
2424 getOpenEditorsViewTitle ( ) : Promise < string > {
25- return this . api . waitForText ( Explorer . OPEN_EDITORS_VIEW ) ;
25+ return this . api . waitForTextContent ( Explorer . OPEN_EDITORS_VIEW ) ;
2626 }
2727
2828 async openFile ( fileName : string ) : Promise < any > {
Original file line number Diff line number Diff line change @@ -67,13 +67,13 @@ export function setup() {
6767 await app . workbench . scm . waitForChange ( 'app.js' , 'Index Modified' ) ;
6868
6969 await app . workbench . scm . commit ( 'first commit' ) ;
70- await app . client . waitForText ( SYNC_STATUSBAR , ' 0↓ 1↑' ) ;
70+ await app . client . waitForTextContent ( SYNC_STATUSBAR , ' 0↓ 1↑' ) ;
7171
7272 await app . workbench . runCommand ( 'Git: Stage All Changes' ) ;
7373 await app . workbench . scm . waitForChange ( 'index.jade' , 'Index Modified' ) ;
7474
7575 await app . workbench . scm . commit ( 'second commit' ) ;
76- await app . client . waitForText ( SYNC_STATUSBAR , ' 0↓ 2↑' ) ;
76+ await app . client . waitForTextContent ( SYNC_STATUSBAR , ' 0↓ 2↑' ) ;
7777
7878 cp . execSync ( 'git reset --hard origin/master' , { cwd : app . workspacePath } ) ;
7979 } ) ;
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export class QuickOpen {
8484 while ( ++ retries < 10 ) {
8585 await this . commands . runCommand ( 'workbench.action.gotoSymbol' ) ;
8686
87- const text = await this . api . waitForText ( 'div[aria-label="Quick Picker"] .monaco-tree-rows.show-twisties div.monaco-tree-row .quick-open-entry .monaco-icon-label .label-name .monaco-highlighted-label span' ) ;
87+ const text = await this . api . waitForTextContent ( 'div[aria-label="Quick Picker"] .monaco-tree-rows.show-twisties div.monaco-tree-row .quick-open-entry .monaco-icon-label .label-name .monaco-highlighted-label span' ) ;
8888
8989 if ( text !== 'No symbol information for the file' ) {
9090 return ;
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ export class Search extends Viewlet {
6161
6262 async removeFileMatch ( index : number ) : Promise < void > {
6363 await this . api . waitAndMoveToObject ( `${ VIEWLET } .results .monaco-tree-rows>:nth-child(${ index } ) .filematch` ) ;
64- const file = await this . api . waitForText ( `${ VIEWLET } .results .monaco-tree-rows>:nth-child(${ index } ) .filematch a.label-name` ) ;
64+ const file = await this . api . waitForTextContent ( `${ VIEWLET } .results .monaco-tree-rows>:nth-child(${ index } ) .filematch a.label-name` ) ;
6565 await this . api . waitAndClick ( `${ VIEWLET } .results .monaco-tree-rows>:nth-child(${ index } ) .filematch .action-label.icon.action-remove` ) ;
66- await this . api . waitForText ( `${ VIEWLET } .results .monaco-tree-rows>:nth-child(${ index } ) .filematch a.label-name` , void 0 , result => result !== file ) ;
66+ await this . api . waitForTextContent ( `${ VIEWLET } .results .monaco-tree-rows>:nth-child(${ index } ) .filematch a.label-name` , void 0 , result => result !== file ) ;
6767 }
6868
6969 async expandReplace ( ) : Promise < void > {
@@ -82,6 +82,6 @@ export class Search extends Viewlet {
8282 }
8383
8484 async waitForResultText ( text : string ) : Promise < void > {
85- await this . api . waitForText ( `${ VIEWLET } .messages[aria-hidden="false"] .message>p` , text ) ;
85+ await this . api . waitForTextContent ( `${ VIEWLET } .messages[aria-hidden="false"] .message>p` , text ) ;
8686 }
8787}
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ export class StatusBar {
3535 }
3636
3737 async waitForEOL ( eol : string ) : Promise < string > {
38- return this . api . waitForText ( this . getSelector ( StatusBarElement . EOL_STATUS ) , eol ) ;
38+ return this . api . waitForTextContent ( this . getSelector ( StatusBarElement . EOL_STATUS ) , eol ) ;
3939 }
4040
4141 async getStatusbarTextByTitle ( title : string ) : Promise < string > {
42- return await this . api . waitForText ( `${ this . mainSelector } span[title="smoke test"]` ) ;
42+ return await this . api . waitForTextContent ( `${ this . mainSelector } span[title="smoke test"]` ) ;
4343 }
4444
4545 private getSelector ( element : StatusBarElement ) : string {
Original file line number Diff line number Diff line change @@ -12,6 +12,6 @@ export abstract class Viewlet {
1212 }
1313
1414 async getTitle ( ) : Promise < string > {
15- return this . api . waitForText ( '.monaco-workbench-container .part.sidebar > .title > .title-label > span' ) ;
15+ return this . api . waitForTextContent ( '.monaco-workbench-container .part.sidebar > .title > .title-label > span' ) ;
1616 }
1717}
Original file line number Diff line number Diff line change @@ -33,11 +33,6 @@ export class API {
3333 return Promise . resolve ( ) ;
3434 }
3535
36- async waitForText ( selector : string , text ?: string , accept ?: ( result : string ) => boolean ) : Promise < string > {
37- accept = accept ? accept : result => text !== void 0 ? text === result : ! ! result ;
38- return this . waitFor ( ( ) => this . spectronClient . getText ( selector ) , accept , `getText with selector ${ selector } ` ) ;
39- }
40-
4136 async waitForTextContent ( selector : string , textContent ?: string , accept ?: ( result : string ) => boolean ) : Promise < string > {
4237 accept = accept ? accept : ( result => textContent !== void 0 ? textContent === result : ! ! result ) ;
4338 const fn = async ( ) => await this . spectronClient . selectorExecute ( selector , div => Array . isArray ( div ) ? div [ 0 ] . textContent : div . textContent ) ;
You can’t perform that action at this time.
0 commit comments