Let say I have a website with authentication username and password and the user has to change password every X months for security reason (so password expire after X months has been change and the user, next time he/she logs in, will be presented with a change password screen). Imagine there is a column LastChangeDate or NextChangeDate in user table.
Suppose it is a valid acceptance test in BDD, I should have something like
Given My password has expired
When I sign in
And I complete the change password form..
Then I can sign in with the new password
How should I implement the first "Given" step? Is creating a function that expire a user's password (for example going to user table and change LastChangeDate/NextChangeDate) a good practise? That would be just for the sake of testing.
I'm using C# and Selenium but I dont think it's (so) relevant. this is more like a question, how to simulate future events in BDD, but cannot find a proper answer.
What I ended up doing is to include as reference the library containing the repository and use the repository directly to change my user record.