_after hook performed asynchronously
See original GitHub issueHi all!
I’m newbie in Js, but looks like the _after hook performed asynchronously when restart
option disabled. execute('localStorage.clear();')
completes after the test, but .deleteCookie()
after starting next test.
I have added console.log() to check it
test
> WebDriverIO._before
* I am on page "/404"
> [Url] https://bestsite.com/404/
√ OK in 9882ms
> WebDriverIO._after
> WebdriverCSS._after
> ForGame._after
> TestApi._after
> WebdriverIOExtra._after
> MobileResolution._after
> [Session] cleaning cookies and localStorage
Console log: deletestorage <- after test
test2
> WebDriverIO._before
Console log: deleteCookie <- during next test
* I am on page "/404"
√ OK in 9038ms
Look like we should use something like async in this situation…
BTW, it’s will be great, when restart
option disabled to close all tabs in the browser except for one, because if in tests you open new tab, you should mark in code to close it, if you don’t want to open 100+ tabs during the tests.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Performing Async Actions using Hooks - Level Up Coding
This simple hook gives us current state action to be performed and a function to perform the action. The body argument is in...
Read more >How to use async functions in useEffect (with examples)
Using asynchronous functions in a useEffect hook is quite common, notably for data fetching. Let's see several ways of going about it!
Read more >Using Async Await Inside React's useEffect() Hook
After the component mounts, we let a useEffect hook spin off a quick fetchUsers() call which returns us a Promise type, which we...
Read more >React Hooks: async function in the useEffect - DEV ...
Async functions always return a promise so you will not have the actual value until the Promise is fulfilled. Anti-Pattern: async function ...
Read more >How to go async with useEffect - Fernando Abolafio - Medium
1. Defining the async function inside the hook ... setLoading(true); } getData();},[]);. The code above is 100% correct and it will get the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DavertMik still facing this issue( Looks like _after hooks add proper tasks to recorder, but after adding we don’t wait when this tasks will be finished.
Here is trace from selenium:
but it should be like this
Maybe you can give me a tip where to look for the cause of the problem?
@DavertMik Any new about this issue?