1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
/*
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <QObject>
#include <QTest>
#include <QSignalSpy>
#include "gui/accountstate.h"
#include "logger.h"
#include "endtoendtestutils.h"
#include <QStandardPaths>
class E2eServerSetupTest : public QObject
{
Q_OBJECT
public:
E2eServerSetupTest() = default;
private:
EndToEndTestHelper _helper;
private slots:
void initTestCase()
{
OCC::Logger::instance()->setLogFlush(true);
OCC::Logger::instance()->setLogDebug(true);
QStandardPaths::setTestModeEnabled(true);
QSignalSpy accountReady(&_helper, &EndToEndTestHelper::accountReady);
_helper.startAccountConfig();
QVERIFY(accountReady.wait(3000));
const auto accountState = _helper.accountState();
QSignalSpy accountConnected(accountState.data(), &OCC::AccountState::isConnectedChanged);
QVERIFY(accountConnected.wait(30000));
}
void testBasicPropfind()
{
const auto account = _helper.account();
auto job = new OCC::PropfindJob(account, "/", this);
QSignalSpy result(job, &OCC::PropfindJob::result);
job->setProperties(QList<QByteArray>() << "getlastmodified");
job->start();
QVERIFY(result.wait(10000));
}
};
QTEST_MAIN(E2eServerSetupTest)
#include "teste2eserversetup.moc"
|