Skip to main content
Source Link
A. K
  • 63
  • 1
  • 2
  • 7

Which Page Class (POM) to verify successful actions from?

I am working with Selenium WebDriver + Java and following the POM design pattern to create automated tests, one of which involves verifying successful logout of a user account from a webapp.

Does it make more sense for this verification method to be part of the page class where the logout method was called, or the page class of the new page that is navigated to? To provide more detail:

Currently, I have a homePage class where I am calling both logout() and verifyLogout(). After logout() is called, the driver navigates to a new page, and verifyLogout() works by searching the page source for the presence of a certain string. My intuition is to instead create a separate page class for this new page and call verifyLogout() from that instead, but considering that this page is not used for anything else, does this still make sense?