简体   繁体   中英

Is it possible to test flow using Protractor without login flow?

我想使用登录页面后出现的量角器来测试流程,在测试该流程时是否可以跳过或跳过或避免登录?

One option would be to instead of opening a fresh browser instance each test, you open Firefox loading the Firefox profile previously saved when you was logged in. Aside from many other things, the profile contains cookies, that are usually used for login session validation:

  • log in to your application via Firefox
  • open Help->Troubleshooting Information->Profile Folder->Show in Finder (for Mac OS)
  • copy the path to the profile
  • use setFirefoxProfile HowTo to learn how to load this profile every time you run your tests

You can always mock the login, where details will depend on how the login is implemented.

If it is the session or key returned by the server, you can mock the server response by supplying that key, that will be accepted by your front end code, as if there was successful login.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM