Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
ddb0f283
Commit
ddb0f283
authored
8 years ago
by
Florian Thöni
Browse files
Options
Downloads
Patches
Plain Diff
Specific helper for certification
To avoid regression on tests for connection_cfg
parent
3c3013b8
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!684
READY:Test helpers : Message box, click yes vs enter
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/functional/test_certification_dialog.py
+2
-2
2 additions, 2 deletions
tests/functional/test_certification_dialog.py
tests/helpers.py
+8
-1
8 additions, 1 deletion
tests/helpers.py
with
10 additions
and
3 deletions
tests/functional/test_certification_dialog.py
+
2
−
2
View file @
ddb0f283
...
...
@@ -5,7 +5,7 @@ from PyQt5.QtCore import QLocale, Qt, QEvent
from
PyQt5.QtTest
import
QTest
from
PyQt5.QtWidgets
import
QDialogButtonBox
from
sakia.gui.sub.certification.controller
import
CertificationController
from
..helpers
import
click
_on_top_message_box
from
..helpers
import
yes
_on_top_message_box
@pytest.mark.asyncio
...
...
@@ -43,7 +43,7 @@ async def test_certification_init_community(application_with_one_connection, fak
assert
certification_dialog
.
view
.
button_box
.
button
(
QDialogButtonBox
.
Ok
).
isEnabled
()
QTest
.
mouseClick
(
certification_dialog
.
view
.
button_box
.
button
(
QDialogButtonBox
.
Ok
),
Qt
.
LeftButton
)
await
asyncio
.
sleep
(
0.1
)
click
_on_top_message_box
()
yes
_on_top_message_box
()
await
asyncio
.
sleep
(
0.2
)
assert
isinstance
(
fake_server_with_blockchain
.
forge
.
pool
[
0
],
Certification
)
...
...
This diff is collapsed.
Click to expand it.
tests/helpers.py
+
8
−
1
View file @
ddb0f283
...
...
@@ -7,10 +7,17 @@ def click_on_top_message_box():
topWidgets
=
QApplication
.
topLevelWidgets
()
for
w
in
topWidgets
:
if
isinstance
(
w
,
QMessageBox
):
QTest
.
mouse
Click
(
w
.
button
(
QMessageBox
.
Yes
),
Qt
.
LeftButton
)
QTest
.
key
Click
(
w
,
Qt
.
Key_Enter
)
elif
isinstance
(
w
,
QDialog
)
and
w
.
windowTitle
()
==
"
Registration
"
:
QTest
.
keyClick
(
w
,
Qt
.
Key_Enter
)
def
yes_on_top_message_box
():
topWidgets
=
QApplication
.
topLevelWidgets
()
for
w
in
topWidgets
:
if
isinstance
(
w
,
QMessageBox
):
QTest
.
mouseClick
(
w
.
button
(
QMessageBox
.
Yes
),
Qt
.
LeftButton
)
def
select_file_dialog
(
filename
):
topWidgets
=
QApplication
.
topLevelWidgets
()
for
w
in
topWidgets
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment