Created
January 2, 2020 12:40
-
-
Save SergeyPirogov/28a3e51fd0a5d298094834b498235e2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun setToken() { | |
Selenide.open("/") | |
val token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJBdXRoZW50aWNhdGlvbiIsInJvbGUiOiJhZG1pbiIsImlzcyI6Imh0dHA6Ly9kcmlsbC00LWovIiwiaWQiOjEsImV4cCI6MTU3Njg1MzQ4NX0.qwV_dOwrsLo6lDJ8Fd-oWwM6RsPdCYXiBSfq9ML91PuKn6nwAxnlRTc2z2NeNETRa-bBG6D3XFTvWMr10u9CMg" | |
Selenide.executeJavaScript<Any>("window.localStorage.setItem('auth_token', '$token')") | |
} | |
private fun deleteToken() { | |
Selenide.open("/") | |
Selenide.executeJavaScript<Any>("window.localStorage.removeItem('auth_token')") | |
Selenide.refresh() | |
Thread.sleep(2000) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment