Skip to content

Commit

Permalink
add test step for logging in with incorrect password
Browse files Browse the repository at this point in the history
  • Loading branch information
Salipa-Gurung committed Oct 30, 2023
1 parent 751d9b8 commit ded0014
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/gui/shared/scripts/pageObjects/AccountSetting.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class AccountSetting:
"type": "OCC::LogBrowser",
"visible": 1,
}
LOGIN_DIALOG_LOGOUT_BUTTON = {
"text": "Log out",
"type": "QPushButton",
"unnamed": 1,
"visible": 1,
"window": names.loginRequiredDialog_OCC_LoginRequiredDialog,
}

@staticmethod
def accountAction(action):
Expand Down Expand Up @@ -72,6 +79,12 @@ def logout():
def login():
AccountSetting.accountAction("Log in")

@staticmethod
def logoutFromLoginRequiredDialog():
squish.clickButton(
squish.waitForObject(AccountSetting.LOGIN_DIALOG_LOGOUT_BUTTON)
)

@staticmethod
def getAccountConnectionLabel():
return str(
Expand Down
15 changes: 15 additions & 0 deletions test/gui/shared/steps/account_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ def step(context, username):
waitForInitialSyncToComplete(getResourcePath('/', username))


@When('user "|any|" opens login dialog')
def step(context, username):
AccountSetting.login()


@When('user "|any|" enters the password "|any|"')
def step(context, username, password):
EnterPassword.reLogin(username, password)


@Then('user "|any|" should be connect to the client-UI')
def step(context, username):
displayname = getDisplaynameForUser(username)
Expand Down Expand Up @@ -257,3 +267,8 @@ def step(context):
@Then("the sync folder should not be added")
def step(context):
test.vp("empty_sync_connection")


@When('user "|any|" logs out from the login required dialog')
def step(context, username):
AccountSetting.logoutFromLoginRequiredDialog()
10 changes: 10 additions & 0 deletions test/gui/tst_loginLogout/test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ Feature: Logout users
When user "Alice" logs in to the client-UI
Then user "Alice" should be connect to the client-UI

@skipOnOCIS
Scenario: login with incorrect and correct password after log out
Given user "Alice" has set up a client with default settings
And user "Alice" has logged out of the client-UI
When user "ALice" opens login dialog
And user "ALice" enters the password "invalid"
And user "Alice" logs out from the login required dialog
And user "Alice" logs in to the client-UI
Then user "Alice" should be connect to the client-UI

@skipOnOCIS
Scenario: login with oauth2 enabled
Given app "oauth2" has been "enabled" in the server
Expand Down

0 comments on commit ded0014

Please sign in to comment.