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
29b90408
Commit
29b90408
authored
Jul 19, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(tests/main-view): add a `testMainMenuEntries` method
parent
62e9a393
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
MainViewTest.cpp
src/tests/main-view/MainViewTest.cpp
+32
-0
MainViewTest.hpp
src/tests/main-view/MainViewTest.hpp
+3
-0
MainWindow.qml
ui/views/App/Main/MainWindow.qml
+2
-0
No files found.
src/tests/main-view/MainViewTest.cpp
View file @
29b90408
...
...
@@ -20,6 +20,8 @@
* Author: Ronan Abhamon
*/
#include <QQmlProperty>
#include <QSignalSpy>
#include <QTest>
#include "../../app/App.hpp"
...
...
@@ -42,6 +44,8 @@ void MainViewTest::showAboutPopup () {
QVERIFY
(
!
TestUtils
::
getVirtualWindowContent
(
mainWindow
));
}
// -----------------------------------------------------------------------------
void
MainViewTest
::
showManageAccountsPopup
()
{
QQuickWindow
*
mainWindow
=
App
::
getInstance
()
->
getMainWindow
();
...
...
@@ -55,6 +59,8 @@ void MainViewTest::showManageAccountsPopup () {
QVERIFY
(
!
TestUtils
::
getVirtualWindowContent
(
mainWindow
));
}
// -----------------------------------------------------------------------------
void
MainViewTest
::
showSettingsWindow
()
{
App
*
app
=
App
::
getInstance
();
...
...
@@ -68,3 +74,29 @@ void MainViewTest::showSettingsWindow () {
TestUtils
::
executeKeySequence
(
settingsWindow
,
QKeySequence
::
Close
);
QVERIFY
(
!
settingsWindow
->
isVisible
());
}
// -----------------------------------------------------------------------------
void
MainViewTest
::
testMainMenuEntries_data
()
{
QTest
::
addColumn
<
int
>
(
"y"
);
QTest
::
addColumn
<
QString
>
(
"source"
);
QTest
::
newRow
(
"home view 1"
)
<<
100
<<
"qrc:/ui/views/App/Main/Home.qml"
;
QTest
::
newRow
(
"contacts view 1"
)
<<
150
<<
"qrc:/ui/views/App/Main/Contacts.qml"
;
QTest
::
newRow
(
"home view 2"
)
<<
100
<<
"qrc:/ui/views/App/Main/Home.qml"
;
QTest
::
newRow
(
"contacts view 2"
)
<<
150
<<
"qrc:/ui/views/App/Main/Contacts.qml"
;
}
void
MainViewTest
::
testMainMenuEntries
()
{
QQuickItem
*
contentLoader
=
App
::
getInstance
()
->
getMainWindow
()
->
findChild
<
QQuickItem
*>
(
"__contentLoader"
);
QVERIFY
(
contentLoader
);
QSignalSpy
spyLoaderReady
(
contentLoader
,
SIGNAL
(
loaded
()));
QFETCH
(
int
,
y
);
QTest
::
mouseClick
(
App
::
getInstance
()
->
getMainWindow
(),
Qt
::
LeftButton
,
Qt
::
KeyboardModifiers
(),
QPoint
(
110
,
y
));
QVERIFY
(
spyLoaderReady
.
count
()
==
1
);
QFETCH
(
QString
,
source
);
QCOMPARE
(
QQmlProperty
::
read
(
contentLoader
,
"source"
).
toString
(),
source
);
}
src/tests/main-view/MainViewTest.hpp
View file @
29b90408
...
...
@@ -35,4 +35,7 @@ private slots:
void
showAboutPopup
();
void
showManageAccountsPopup
();
void
showSettingsWindow
();
void
testMainMenuEntries_data
();
void
testMainMenuEntries
();
};
ui/views/App/Main/MainWindow.qml
View file @
29b90408
...
...
@@ -231,6 +231,8 @@ ApplicationWindow {
Loader
{
id
:
contentLoader
objectName
:
'
__contentLoader
'
Layout.fillHeight
:
true
Layout.fillWidth
:
true
...
...
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