SatelliteQE / airgun

AirGun is a Python library that is built over Widgetastic and navmazing to make Satellite 6 UI testing easier.
GNU General Public License v3.0
20 stars 66 forks source link

Login: Entity or NavigateStep? #20

Open abalakh opened 6 years ago

abalakh commented 6 years ago

Currently we do have Login as entity with methods like login and logout. Session calls those methods in __enter__() and __exit__() accordingly. That's basically the approach robottelo is using.

CFME and navmazing use different one though - Login and Logout are NavigateSteps, so navigator handles logging in and logging out if necessary.

Question is - do cfme's way introduce some valuable benefits or that's basically just another equal approach? Should we use it or stay with what we have?

I was thinking about that and couldn't highlight any serious benefits of either approach. The only thing is cfme's way will allow us to ensure we're logged in before proceeding with navigation to desired page. On the other hand it introduces extra prerequisite for top-level navigate steps. And since Satellite6 doesn't have any actions which could lead user to appear accidentally logged out of application there's not much value in it, more than that - if some action will close user's session i'd like to catch such bug and not to hide it with navmazing.

@oshtaier @mfalesni @jhutar let's discuss.

mfalesni commented 6 years ago

Okay, so, you only need LoginPage and then let's say LoggedInPage nav steps. Nothing more. When you test logging in and logging out, you can have helper methods that log in and log out on the views, you just do login_view = navigate_to(session, 'LoginPage') and then you can have a method on the view to log in certain way. Same with the logged in page. You are logged in and then you use a method on the view to log out.

jhutar commented 6 years ago

@mfalesni , by implementing that, would navigation module hide potential issue when some action (for some reason I can not imagine) logs me out during the test as @abalakh mentions above?