@@ -72,7 +72,6 @@ const webRoot = 'body'
7272 * @prop {object } [timeouts] [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
7373 * @prop {boolean } [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
7474 * @prop {string } [logLevel=silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
75- * @prop {boolean } [devtoolsProtocol=false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
7675 */
7776const config = { }
7877
@@ -643,10 +642,6 @@ class WebDriver extends Helper {
643642 this . browser . capabilities . platformName = this . browser . capabilities . platformName . toLowerCase ( )
644643 }
645644
646- // @TODO Remove for "test"
647- // this.puppeteerBrowser = await this.browser.getPuppeteer()
648- // this.page = (await this.puppeteerBrowser.pages())[0]
649-
650645 return this . browser
651646 }
652647
@@ -2717,32 +2712,6 @@ class WebDriver extends Helper {
27172712 return this . executeScript ( getScrollPosition )
27182713 }
27192714
2720- /**
2721- * This method is **deprecated**.
2722- *
2723- *
2724- * {{> setGeoLocation }}
2725- */
2726- async setGeoLocation ( latitude , longitude ) {
2727- this . geoLocation = { latitude, longitude }
2728-
2729- await this . browser . call ( async ( ) => {
2730- const pages = await this . puppeteerBrowser . pages ( )
2731- await pages [ 0 ] . setGeolocation ( { latitude, longitude } )
2732- } )
2733- }
2734-
2735- /**
2736- * This method is **deprecated**.
2737- *
2738- * {{> grabGeoLocation }}
2739- *
2740- */
2741- async grabGeoLocation ( ) {
2742- if ( ! this . geoLocation ) return 'No GeoLocation is set!'
2743- return this . geoLocation
2744- }
2745-
27462715 /**
27472716 * {{> grabElementBoundingRect }}
27482717 */
@@ -2781,91 +2750,6 @@ class WebDriver extends Helper {
27812750 runInWeb ( fn ) {
27822751 return fn ( )
27832752 }
2784-
2785- /**
2786- *
2787- * _Note:_ Only works when devtoolsProtocol is enabled.
2788- *
2789- * {{> flushNetworkTraffics }}
2790- */
2791- flushNetworkTraffics ( ) {
2792- this . requests = [ ]
2793- }
2794-
2795- /**
2796- *
2797- * _Note:_ Only works when devtoolsProtocol is enabled.
2798- *
2799- * {{> stopRecordingTraffic }}
2800- */
2801- stopRecordingTraffic ( ) {
2802- this . page . removeAllListeners ( 'request' )
2803- this . recording = false
2804- }
2805-
2806- /**
2807- *
2808- * _Note:_ Only works when devtoolsProtocol is enabled.
2809- *
2810- * {{> startRecordingTraffic }}
2811- *
2812- */
2813- async startRecordingTraffic ( ) {
2814- this . flushNetworkTraffics ( )
2815- this . recording = true
2816- this . recordedAtLeastOnce = true
2817-
2818- await this . page . setRequestInterception ( true )
2819-
2820- this . page . on ( 'request' , ( request ) => {
2821- const information = {
2822- url : request . url ( ) ,
2823- method : request . method ( ) ,
2824- requestHeaders : request . headers ( ) ,
2825- requestPostData : request . postData ( ) ,
2826- response : request . response ( ) ,
2827- }
2828-
2829- this . debugSection ( 'REQUEST: ' , JSON . stringify ( information ) )
2830-
2831- if ( typeof information . requestPostData === 'object' ) {
2832- information . requestPostData = JSON . parse ( information . requestPostData )
2833- }
2834- request . continue ( )
2835- this . requests . push ( information )
2836- } )
2837- }
2838-
2839- /**
2840- *
2841- * _Note:_ Only works when devtoolsProtocol is enabled.
2842- *
2843- * {{> grabRecordedNetworkTraffics }}
2844- */
2845- async grabRecordedNetworkTraffics ( ) {
2846- return grabRecordedNetworkTraffics . call ( this )
2847- }
2848-
2849- /**
2850- *
2851- * _Note:_ Only works when devtoolsProtocol is enabled.
2852- *
2853- * {{> seeTraffic }}
2854- */
2855- async seeTraffic ( { name, url, parameters, requestPostData, timeout = 10 } ) {
2856- await seeTraffic . call ( this , ...arguments )
2857- }
2858-
2859- /**
2860- *
2861- * _Note:_ Only works when devtoolsProtocol is enabled.
2862- *
2863- * {{> dontSeeTraffic }}
2864- *
2865- */
2866- dontSeeTraffic ( { name, url } ) {
2867- dontSeeTraffic . call ( this , ...arguments )
2868- }
28692753}
28702754
28712755async function proceedSee ( assertType , text , context , strict = false ) {
0 commit comments