Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Jul 12, 2024
1 parent b178ee8 commit 78e0e9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/gui/shared/scripts/helpers/SpaceHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_share_endpint():


def create_space(space_name):
body = json.dumps({"Name": space_name})
body = json.dumps({"name": space_name})
response = request.post(get_space_endpint(), body)
if response.status_code != 201:
raise Exception(
Expand Down
19 changes: 9 additions & 10 deletions test/gui/shared/scripts/pageObjects/EnterPassword.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import names
import squish
from helpers.WebUIHelper import authorize_via_webui
from helpers.ConfigHelper import get_config
from helpers.UserHelper import getPasswordForUser


class EnterPassword:
LOGIN_DIALOG = {
LOGIN_CONTAINER = {
"name": "LoginRequiredDialog",
"type": "OCC::LoginRequiredDialog",
"visible": 1,
Expand All @@ -14,37 +15,37 @@ class EnterPassword:
"name": "topLabel",
"type": "QLabel",
"visible": 1,
"window": LOGIN_DIALOG,
"window": LOGIN_CONTAINER,
}
USERNAME_BOX = {
"name": "usernameLineEdit",
"type": "QLineEdit",
"visible": 1,
"window": LOGIN_DIALOG,
"window": LOGIN_CONTAINER,
}
PASSWORD_BOX = {
"name": "passwordLineEdit",
"type": "QLineEdit",
"visible": 1,
"window": LOGIN_DIALOG,
"window": LOGIN_CONTAINER,
}
LOGIN_BUTTON = {
"text": "Log in",
"type": "QPushButton",
"visible": 1,
"window": LOGIN_DIALOG,
"window": names.stack_stackedWidget_QStackedWidget,
}
LOGOUT_BUTTON = {
"text": "Log out",
"type": "QPushButton",
"visible": 1,
"window": LOGIN_DIALOG,
"window": names.stack_stackedWidget_QStackedWidget,
}
COPY_URL_TO_CLIPBOARD_BUTTON = {
"name": "copyUrlToClipboardButton",
"type": "QPushButton",
"visible": 1,
"window": LOGIN_DIALOG,
"window": LOGIN_CONTAINER,
}
TLS_CERT_WINDOW = {
"name": "OCC__TlsErrorDialog",
Expand All @@ -59,9 +60,7 @@ class EnterPassword:
}

def __init__(self, occurrence=1):
if occurrence > 1 and not get_config('ocis'):
self.LOGIN_DIALOG.update({"occurrence": occurrence})
elif occurrence > 1 and get_config('ocis'):
if occurrence > 1 and get_config('ocis'):
self.TLS_CERT_WINDOW.update({"occurrence": occurrence})

def get_username(self):
Expand Down
2 changes: 2 additions & 0 deletions test/gui/shared/steps/spaces_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def step(context, user, space_name):
password = getPasswordForUser(user)
setUpClient(user, space_name)
enter_password = EnterPassword()
if get_config('ocis'):
enter_password.accept_certificate()
enter_password.loginAfterSetup(user, password)
# wait for files to sync
waitForInitialSyncToComplete(getResourcePath('/', user, space_name))
Expand Down

0 comments on commit 78e0e9e

Please sign in to comment.