Danp2 / au3WebDriver

Web Driver UDF for AutoIt
MIT License
107 stars 23 forks source link

_WD_DebugSwitch #406

Closed mlipok closed 1 year ago

mlipok commented 1 year ago

Pull request

Proposed changes

This PR adds function _WD_DebugSwitch() which give an easy way to switch and switch back between $_WD_DEBUG levels.

Checklist

Types of changes

Please check x the type of change your PR introduces:

What is the current behavior?

When you want to switch to $_WD_DEBUG_Full and then back then you do not must remember which level was set previously.

What is the new behavior?

this following example shows new behavior:

_MAIN()

Func _Main()
    $_WD_DEBUG = $_WD_DEBUG_None ; presetting
    _1()
EndFunc

Func _1()
    _WD_DebugSwitch($_WD_DEBUG_Full) ; first usage - internally store current settings + switch to $_WD_DEBUG_Full
    ; do your stuff
    _2()
    _WD_DebugSwitch() ; switch back to prior DEBUG level .... $_WD_DEBUG_None
EndFunc

Func _2()
    _WD_DebugSwitch($_WD_DEBUG_Error) ; switch to $_WD_DEBUG_Error
    ; do your stuff
    _WD_DebugSwitch() ; switch back to prior DEBUG level .... $_WD_DEBUG_Full
EndFunc

Additional context

https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/?do=findComment&comment=1504312 This feature was discussed before here: https://github.com/Danp2/au3WebDriver/pull/340

System under test

not related

mlipok commented 1 year ago

wait

mlipok commented 1 year ago

wait

fixed here: fix $iResult