Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit d278a003 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Extend tests

CCBUG: 370906
parent 3210e138
......@@ -12,6 +12,7 @@ if(BUILD_DummyBackend)
add_test(NAME wrongInput COMMAND Plasma::Discover --test "${CMAKE_CURRENT_SOURCE_DIR}/wrongInput.qml" "CMakeLists.txt")
add_test(NAME packageArgument COMMAND Plasma::Discover --test "${CMAKE_CURRENT_SOURCE_DIR}/packageArgument.qml"
--local-filename "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
add_test(NAME updateandinstall COMMAND Plasma::Discover --test "${CMAKE_CURRENT_SOURCE_DIR}/updateandinstall.qml")
# Just make sure they exit successfully
add_test(NAME listbackends COMMAND Plasma::Discover --listbackends)
......
import QtQuick 2.0
import org.kde.discover.app 1.0
import QtTest 1.1
DiscoverTest
{
function test_openResource() {
app.openMode("Update");
{// we start an upate
var updatePage = appRoot.stack.currentItem;
compare(typeName(updatePage), "UpdatesPage")
compare(updatePage.state, "has-updates", "to update")
var button = findChild(updatePage, "Button")
verify(button);
button.clicked();
compare(updatePage.state, "has-updates", "updating")
}
{//we start installing a resource
app.openApplication("dummy://dummy.1");
var appsList = appRoot.stack.currentItem.flickable;
appsList.currentIndex = 0
waitForSignal(appsList, "countChanged")
var item = appsList.currentItem
verify(item)
item.clicked()
var button = findChild(appRoot.stack.currentItem, "InstallApplicationButton")
verify(!button.isActive)
button.click()
}
app.openMode("Update");
{
var updatePage = appRoot.stack.currentItem;
compare(typeName(updatePage), "UpdatesPage")
compare(updatePage.state, "progressing", "to update")
var button = findChild(updatePage, "Button")
verify(!button.isActive)
while(updatePage.state != "now-uptodate")
waitForSignal(updatePage, "stateChanged")
appRoot.close()
}
}
}
......@@ -109,6 +109,15 @@ private Q_SLOTS:
rum->updateAll();
QVERIFY(spy.wait());
QCOMPARE(rum->isProgressing(), true);
QTest::qWait(20);
QScopedPointer<ResourcesUpdatesModel> rum2(new ResourcesUpdatesModel(this));
new ModelTest(rum2.data(), rum2.data());
QScopedPointer<UpdateModel> m2(new UpdateModel(this));
new ModelTest(m2.data(), m2.data());
m->setBackend(rum2.data());
QVERIFY(spy.wait());
QCOMPARE(rum->isProgressing(), false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment