Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
e52b6f60
Commit
e52b6f60
authored
Aug 09, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tests): init each GUI test correctly
parent
55153d72
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
6 deletions
+24
-6
TestUtils.hpp
src/tests/TestUtils.hpp
+7
-0
AssistantViewTest.cpp
src/tests/assistant-view/AssistantViewTest.cpp
+6
-5
AssistantViewTest.hpp
src/tests/assistant-view/AssistantViewTest.hpp
+2
-0
MainViewTest.cpp
src/tests/main-view/MainViewTest.cpp
+6
-0
MainViewTest.hpp
src/tests/main-view/MainViewTest.hpp
+2
-0
linphone-utils.js
ui/scripts/LinphoneUtils/linphone-utils.js
+1
-1
No files found.
src/tests/TestUtils.hpp
View file @
e52b6f60
...
...
@@ -36,6 +36,13 @@
QCOMPARE(virtualWindowContent->objectName(), QStringLiteral(NAME)); \
} while (0)
#define INIT_GUI_TEST() \
QQuickWindow * mainWindow = App::getInstance()->getMainWindow(); \
App::smartShowWindow(mainWindow); \
QQuickItem *contentLoader = mainWindow->findChild<QQuickItem *>("__contentLoader"); \
QVERIFY(contentLoader); \
QTest::mouseClick(mainWindow, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(110, 100));
namespace
TestUtils
{
void
executeKeySequence
(
QQuickWindow
*
window
,
QKeySequence
sequence
);
...
...
src/tests/assistant-view/AssistantViewTest.cpp
View file @
e52b6f60
...
...
@@ -21,27 +21,28 @@
*/
#include <QQmlProperty>
#include <QQuickItem>
#include <QSignalSpy>
#include <QTest>
#include "../../app/App.hpp"
#include "../TestUtils.hpp"
#include "AssistantViewTest.hpp"
// =============================================================================
void
AssistantViewTest
::
init
()
{
INIT_GUI_TEST
();
}
void
AssistantViewTest
::
showAssistantView
()
{
QQuickWindow
*
mainWindow
=
App
::
getInstance
()
->
getMainWindow
();
// Ensure home view is selected.
QQuickItem
*
contentLoader
=
mainWindow
->
findChild
<
QQuickItem
*>
(
"__contentLoader"
);
QVERIFY
(
contentLoader
);
QTest
::
mouseClick
(
mainWindow
,
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
110
,
100
));
// Show assistant view.
QSignalSpy
spyLoaderReady
(
contentLoader
,
SIGNAL
(
loaded
()));
QTest
::
mouseClick
(
mainWindow
,
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
705
,
485
));
QVERIFY
(
spyLoaderReady
.
count
()
==
1
);
QCOMPARE
(
QQmlProperty
::
read
(
contentLoader
,
"source"
).
toString
(),
...
...
src/tests/assistant-view/AssistantViewTest.hpp
View file @
e52b6f60
...
...
@@ -35,6 +35,8 @@ public:
~
AssistantViewTest
()
=
default
;
private
slots
:
void
init
();
void
showAssistantView
();
};
...
...
src/tests/main-view/MainViewTest.cpp
View file @
e52b6f60
...
...
@@ -31,6 +31,12 @@
// =============================================================================
void
MainViewTest
::
init
()
{
INIT_GUI_TEST
();
}
// -----------------------------------------------------------------------------
void
MainViewTest
::
showAboutPopup
()
{
QQuickWindow
*
mainWindow
=
App
::
getInstance
()
->
getMainWindow
();
...
...
src/tests/main-view/MainViewTest.hpp
View file @
e52b6f60
...
...
@@ -35,6 +35,8 @@ public:
~
MainViewTest
()
=
default
;
private
slots
:
void
init
();
void
showAboutPopup
();
void
showManageAccountsPopup
();
void
showSettingsWindow
();
...
...
ui/scripts/LinphoneUtils/linphone-utils.js
View file @
e52b6f60
...
...
@@ -37,7 +37,7 @@ function _getDisplayName (str) {
return
name
}
return
_getDisplayNameFromString
(
str
)
return
_getDisplayNameFromString
(
str
)
}
// -----------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment