-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test to check e2e server test setup
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
- Loading branch information
1 parent
58baa39
commit b37fb17
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) by Claudio Cambra <claudio.cambra@nextcloud.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#include <QObject> | ||
#include <QTest> | ||
#include <QSignalSpy> | ||
|
||
#include "gui/accountstate.h" | ||
|
||
#include "endtoendtestutils.h" | ||
|
||
class E2eServerSetupTest : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
E2eServerSetupTest() = default; | ||
|
||
private: | ||
EndToEndTestHelper _helper; | ||
|
||
private slots: | ||
void initTestCase() | ||
{ | ||
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" |