diff --git a/tests/features/cuke-steps.cpp b/tests/features/cuke-steps.cpp index 5c080892..d1a8a35c 100644 --- a/tests/features/cuke-steps.cpp +++ b/tests/features/cuke-steps.cpp @@ -1,903 +1,900 @@ /* This file is part of Zanshin Copyright 2014-2015 Kevin Ottens 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) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include "presentation/applicationmodel.h" #include "presentation/errorhandler.h" #include "presentation/querytreemodelbase.h" #include "akonadi/akonadimonitorimpl.h" #include "akonadi/akonadimessaginginterface.h" #include "utils/dependencymanager.h" #include "utils/jobhandler.h" #include "testlib/akonadifakedata.h" #include "testlib/akonadifakedataxmlloader.h" #include "testlib/monitorspy.h" #include "testlib/testsafety.h" static int argc = 1; static char *argv0 = "cuke-steps"; static QApplication app(argc, &argv0); namespace CukeSteps { void initializeAppDependencies(); } namespace cucumber { namespace internal { template<> inline QString fromString(const std::string& s) { return QString::fromUtf8(s.data()); } } } using namespace cucumber; class FakeErrorHandler : public Presentation::ErrorHandler { public: void doDisplayMessage(const QString &) { } }; class ZanshinContext : public QObject { Q_OBJECT public: explicit ZanshinContext(QObject *parent = Q_NULLPTR) : QObject(parent), app(), presentation(Q_NULLPTR), editor(Q_NULLPTR), proxyModel(new QSortFilterProxyModel(this)), m_model(Q_NULLPTR), m_sourceModel(Q_NULLPTR), monitorSpy(Q_NULLPTR) { qputenv("ZANSHIN_OVERRIDE_DATETIME", "2015-03-10"); static bool initializedDependencies = false; if (!initializedDependencies) { CukeSteps::initializeAppDependencies(); + MonitorSpy::setExpirationDelay(200); + initializedDependencies = true; + } - QString xmlFile = QString::fromLocal8Bit(qgetenv("ZANSHIN_USER_XMLDATA")); - if (!xmlFile.isEmpty()) { - auto searchCollection = Akonadi::Collection(1); - searchCollection.setParentCollection(Akonadi::Collection::root()); - searchCollection.setName(QStringLiteral("Search")); - m_data.createCollection(searchCollection); - - MonitorSpy::setExpirationDelay(200); - auto loader = Testlib::AkonadiFakeDataXmlLoader(&m_data); - loader.load(xmlFile); - - // Swap regular dependencies for the fake data ones - auto &deps = Utils::DependencyManager::globalInstance(); - deps.add( - [this] (Utils::DependencyManager *) { - return m_data.createMonitor(); - } - ); - deps.add( - [this] (Utils::DependencyManager *) { - return m_data.createStorage(); - } - ); - deps.add( - [this] (Utils::DependencyManager *) -> Akonadi::MessagingInterface* { - return Q_NULLPTR; - } - ); - } else if (!TestLib::TestSafety::checkTestIsIsolated()) { - qDebug() << "FATAL ERROR! SEE ABOVE\n\n"; - exit(1); - } + const auto xmlFile = QString::fromLocal8Bit(qgetenv("ZANSHIN_USER_XMLDATA")); + if (xmlFile.isEmpty()) { + qDebug() << "FATAL ERROR! ZANSHIN_USER_XMLDATA WAS NOT PROVIDED\n\n"; + exit(1); + } - initializedDependencies = true; + auto searchCollection = Akonadi::Collection(1); + searchCollection.setParentCollection(Akonadi::Collection::root()); + searchCollection.setName(QStringLiteral("Search")); + m_data.createCollection(searchCollection); + + auto loader = Testlib::AkonadiFakeDataXmlLoader(&m_data); + loader.load(xmlFile); + + // Swap regular dependencies for the fake data ones + auto &deps = Utils::DependencyManager::globalInstance(); + deps.add( + [this] (Utils::DependencyManager *) { + return m_data.createMonitor(); + } + ); + deps.add( + [this] (Utils::DependencyManager *) { + return m_data.createStorage(); } + ); + deps.add( + [this] (Utils::DependencyManager *) -> Akonadi::MessagingInterface* { + return Q_NULLPTR; + } + ); using namespace Presentation; proxyModel->setDynamicSortFilter(true); auto appModel = ApplicationModel::Ptr::create(); appModel->setErrorHandler(&m_errorHandler); app = appModel; auto monitor = Utils::DependencyManager::globalInstance().create(); monitorSpy = new MonitorSpy(monitor.data(), this); } ~ZanshinContext() { } // Note that setModel might invalidate the 'index' member variable, due to proxyModel->setSourceModel. void setModel(QAbstractItemModel *model) { if (m_sourceModel == model) return; m_sourceModel = model; if (!qobject_cast(model)) { proxyModel->setObjectName(QStringLiteral("m_proxyModel_in_ZanshinContext")); proxyModel->setSourceModel(model); proxyModel->setSortRole(Qt::DisplayRole); proxyModel->sort(0); m_model = proxyModel; } else { m_model = model; } } QAbstractItemModel *sourceModel() { return m_sourceModel; } QAbstractItemModel *model() { return m_model; } Domain::Artifact::Ptr currentArtifact() const { return index.data(Presentation::QueryTreeModelBase::ObjectRole) .value(); } void waitForEmptyJobQueue() { while (Utils::JobHandler::jobCount() != 0) { QTest::qWait(20); } } void waitForStableState() { waitForEmptyJobQueue(); monitorSpy->waitForStableState(); } QObjectPtr app; QList indices; QPersistentModelIndex index; QObject *presentation; QObject *editor; QList dragIndices; private: - static Testlib::AkonadiFakeData m_data; + Testlib::AkonadiFakeData m_data; QSortFilterProxyModel *proxyModel; QAbstractItemModel *m_model; QAbstractItemModel *m_sourceModel; MonitorSpy *monitorSpy; FakeErrorHandler m_errorHandler; }; -Testlib::AkonadiFakeData ZanshinContext::m_data = {}; - namespace Zanshin { QString indexString(const QModelIndex &index, int role = Qt::DisplayRole) { if (role != Qt::DisplayRole) return index.data(role).toString(); QString data = index.data(role).toString(); if (index.parent().isValid()) return indexString(index.parent(), role) + " / " + data; else return data; } QModelIndex findIndex(QAbstractItemModel *model, const QString &string, int role = Qt::DisplayRole, const QModelIndex &root = QModelIndex()) { for (int row = 0; row < model->rowCount(root); row++) { const QModelIndex index = model->index(row, 0, root); if (indexString(index, role) == string) return index; if (model->rowCount(index) > 0) { const QModelIndex found = findIndex(model, string, role, index); if (found.isValid()) return found; } } return QModelIndex(); } static void collectIndicesImpl(ZanshinContext *context, const QModelIndex &root = QModelIndex()) { QAbstractItemModel *model = context->model(); for (int row = 0; row < model->rowCount(root); row++) { const QModelIndex index = model->index(row, 0, root); context->indices << index; if (model->rowCount(index) > 0) collectIndicesImpl(context, index); } } static void collectIndices(ZanshinContext *context) { context->indices.clear(); collectIndicesImpl(context); } void dumpIndices(const QList &indices) { qDebug() << "Dumping list of size:" << indices.size(); for (int row = 0; row < indices.size(); row++) { qDebug() << row << indexString(indices.at(row)); } } inline bool verify(bool statement, const char *str, const char *file, int line) { if (statement) return true; qDebug() << "Statement" << str << "returned FALSE"; qDebug() << "Loc:" << file << line; return false; } template inline bool compare(T const &t1, T const &t2, const char *actual, const char *expected, const char *file, int line) { if (t1 == t2) return true; qDebug() << "Compared values are not the same"; qDebug() << "Actual (" << actual << ") :" << QTest::toString(t1); qDebug() << "Expected (" << expected << ") :" << QTest::toString(t2); qDebug() << "Loc:" << file << line; return false; } } // namespace Zanshin #define COMPARE(actual, expected) \ do {\ if (!Zanshin::compare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ BOOST_REQUIRE(false);\ } while (0) // Note: you should make sure that context->indices is filled in before calling this, // e.g. calling Zanshin::collectIndices(context.get()) if not already done. #define COMPARE_OR_DUMP(actual, expected) \ do {\ if (!Zanshin::compare(actual, expected, #actual, #expected, __FILE__, __LINE__)) {\ Zanshin::dumpIndices(context->indices); \ BOOST_REQUIRE(false);\ }\ } while (0) #define VERIFY(statement) \ do {\ if (!Zanshin::verify((statement), #statement, __FILE__, __LINE__))\ BOOST_REQUIRE(false);\ } while (0) // Note: you should make sure that context->indices is filled in before calling this, // e.g. calling Zanshin::collectIndices(context.get()) if not already done. #define VERIFY_OR_DUMP(statement) \ do {\ if (!Zanshin::verify((statement), #statement, __FILE__, __LINE__)) {\ Zanshin::dumpIndices(context->indices); \ BOOST_REQUIRE(false);\ }\ } while (0) #define VERIFY_OR_DO(statement, whatToDo) \ do {\ if (!Zanshin::verify((statement), #statement, __FILE__, __LINE__)) {\ whatToDo; \ BOOST_REQUIRE(false);\ }\ } while (0) GIVEN("^I display the available data sources$") { ScenarioScope context; auto availableSources = context->app->property("availableSources").value(); VERIFY(availableSources); auto sourceListModel = availableSources->property("sourceListModel").value(); VERIFY(sourceListModel); context->presentation = availableSources; context->setModel(sourceListModel); } GIVEN("^I display the available pages$") { ScenarioScope context; context->presentation = context->app->property("availablePages").value(); context->setModel(context->presentation->property("pageListModel").value()); } GIVEN("^I display the \"(.*)\" page$") { REGEX_PARAM(QString, pageName); ScenarioScope context; auto availablePages = context->app->property("availablePages").value(); VERIFY(availablePages); auto pageListModel = availablePages->property("pageListModel").value(); VERIFY(pageListModel); context->waitForEmptyJobQueue(); QModelIndex pageIndex = Zanshin::findIndex(pageListModel, pageName); VERIFY(pageIndex.isValid()); QObject *page = Q_NULLPTR; QMetaObject::invokeMethod(availablePages, "createPageForIndex", Q_RETURN_ARG(QObject*, page), Q_ARG(QModelIndex, pageIndex)); VERIFY(page); VERIFY(context->app->setProperty("currentPage", QVariant::fromValue(page))); context->presentation = context->app->property("currentPage").value(); } GIVEN("^there is an item named \"(.+)\" in the central list$") { REGEX_PARAM(QString, itemName); ScenarioScope context; auto model = context->presentation->property("centralListModel").value(); context->setModel(model); context->waitForEmptyJobQueue(); Zanshin::collectIndices(context.get()); context->index = Zanshin::findIndex(context->model(), itemName); VERIFY_OR_DUMP(context->index.isValid()); } GIVEN("^there is an item named \"(.+)\" in the available data sources$") { REGEX_PARAM(QString, itemName); ScenarioScope context; auto availableSources = context->app->property("availableSources").value(); VERIFY(availableSources); auto model = availableSources->property("sourceListModel").value(); VERIFY(model); context->waitForEmptyJobQueue(); context->setModel(model); Zanshin::collectIndices(context.get()); context->index = Zanshin::findIndex(context->model(), itemName); VERIFY_OR_DUMP(context->index.isValid()); } GIVEN("^the central list contains items named:") { TABLE_PARAM(tableParam); ScenarioScope context; context->dragIndices.clear(); auto model = context->presentation->property("centralListModel").value(); context->waitForEmptyJobQueue(); context->setModel(model); for (const auto &row : tableParam.hashes()) { for (const auto &it : row) { const QString itemName = QString::fromUtf8(it.second.data()); QModelIndex index = Zanshin::findIndex(context->model(), itemName); VERIFY_OR_DO(index.isValid(), Zanshin::dumpIndices(context->dragIndices)); context->dragIndices << index; } } } WHEN("^I look at the central list$") { ScenarioScope context; auto model = context->presentation->property("centralListModel").value(); context->setModel(model); context->waitForStableState(); } WHEN("^I check the item$") { ScenarioScope context; VERIFY(context->model()->setData(context->index, Qt::Checked, Qt::CheckStateRole)); context->waitForStableState(); } WHEN("^I uncheck the item$") { ScenarioScope context; VERIFY(context->model()->setData(context->index, Qt::Unchecked, Qt::CheckStateRole)); context->waitForStableState(); } WHEN("^I remove the item$") { ScenarioScope context; VERIFY(QMetaObject::invokeMethod(context->presentation, "removeItem", Q_ARG(QModelIndex, context->index))); context->waitForStableState(); } WHEN("^I promote the item$") { ScenarioScope context; VERIFY(QMetaObject::invokeMethod(context->presentation, "promoteItem", Q_ARG(QModelIndex, context->index))); context->waitForStableState(); } WHEN("^I add a project named \"(.*)\" in the source named \"(.*)\"$") { REGEX_PARAM(QString, projectName); REGEX_PARAM(QString, sourceName); ScenarioScope context; auto availableSources = context->app->property("availableSources").value(); VERIFY(availableSources); auto sourceList = availableSources->property("sourceListModel").value(); VERIFY(sourceList); context->waitForStableState(); QModelIndex index = Zanshin::findIndex(sourceList, sourceName); VERIFY(index.isValid()); auto source = index.data(Presentation::QueryTreeModelBase::ObjectRole) .value(); VERIFY(source); VERIFY(QMetaObject::invokeMethod(context->presentation, "addProject", Q_ARG(QString, projectName), Q_ARG(Domain::DataSource::Ptr, source))); context->waitForStableState(); } WHEN("^I rename a \"(.*)\" named \"(.*)\" to \"(.*)\"$") { REGEX_PARAM(QString, objectType); REGEX_PARAM(QString, oldName); REGEX_PARAM(QString, newName); const QString pageNodeName = (objectType == QStringLiteral("project")) ? QStringLiteral("Projects / ") : (objectType == QStringLiteral("context")) ? QStringLiteral("Contexts / ") : QString(); VERIFY(!pageNodeName.isEmpty()); ScenarioScope context; auto availablePages = context->app->property("availablePages").value(); VERIFY(availablePages); auto pageListModel = availablePages->property("pageListModel").value(); VERIFY(pageListModel); context->waitForStableState(); QModelIndex pageIndex = Zanshin::findIndex(pageListModel, pageNodeName + oldName); VERIFY(pageIndex.isValid()); pageListModel->setData(pageIndex, newName); context->waitForStableState(); } WHEN("^I remove a \"(.*)\" named \"(.*)\"$") { REGEX_PARAM(QString, objectType); REGEX_PARAM(QString, objectName); const QString pageNodeName = (objectType == QStringLiteral("project")) ? QStringLiteral("Projects / ") : (objectType == QStringLiteral("context")) ? QStringLiteral("Contexts / ") : (objectType == QStringLiteral("tag")) ? QStringLiteral("Tags / ") : QString(); VERIFY(!pageNodeName.isEmpty()); ScenarioScope context; auto availablePages = context->app->property("availablePages").value(); VERIFY(availablePages); auto pageListModel = availablePages->property("pageListModel").value(); VERIFY(pageListModel); context->waitForStableState(); QModelIndex pageIndex = Zanshin::findIndex(pageListModel, pageNodeName + objectName); VERIFY(pageIndex.isValid()); VERIFY(QMetaObject::invokeMethod(availablePages, "removeItem", Q_ARG(QModelIndex, pageIndex))); context->waitForStableState(); } WHEN("^I add a \"(.*)\" named \"(.+)\"$") { REGEX_PARAM(QString, objectType); REGEX_PARAM(QString, objectName); QByteArray actionName = (objectType == QStringLiteral("context")) ? "addContext" : (objectType == QStringLiteral("note")) ? "addItem" : (objectType == QStringLiteral("task")) ? "addItem" : (objectType == QStringLiteral("tag")) ? "addTag" : QByteArray(); VERIFY(!actionName.isEmpty()); ScenarioScope context; context->waitForStableState(); VERIFY(QMetaObject::invokeMethod(context->presentation, actionName.data(), Q_ARG(QString, objectName))); context->waitForStableState(); } WHEN("^I add a child named \"(.+)\" under the task named \"(.+)\"$") { REGEX_PARAM(QString, childName); REGEX_PARAM(QString, parentName); ScenarioScope context; context->waitForStableState(); auto parentIndex = QModelIndex(); for (int row = 0; row < context->indices.size(); row++) { auto index = context->indices.at(row); if (Zanshin::indexString(index) == parentName) { parentIndex = index; break; } } VERIFY_OR_DUMP(parentIndex.isValid()); VERIFY(QMetaObject::invokeMethod(context->presentation, "addItem", Q_ARG(QString, childName), Q_ARG(QModelIndex, parentIndex))); context->waitForStableState(); } WHEN("^I list the items$") { ScenarioScope context; context->waitForStableState(); Zanshin::collectIndices(context.get()); context->waitForStableState(); } WHEN("^I open the item in the editor$") { ScenarioScope context; auto artifact = context->currentArtifact(); VERIFY(artifact); context->editor = context->app->property("editor").value(); VERIFY(context->editor); VERIFY(context->editor->setProperty("artifact", QVariant::fromValue(artifact))); } WHEN("^I mark it done in the editor$") { ScenarioScope context; VERIFY(context->editor->setProperty("done", true)); } WHEN("^I change the editor (.*) to \"(.*)\"$") { REGEX_PARAM(QString, field); REGEX_PARAM(QString, string); const QVariant value = (field == QStringLiteral("text")) ? string : (field == QStringLiteral("title")) ? string : (field == QStringLiteral("start date")) ? QDateTime::fromString(string, Qt::ISODate) : (field == QStringLiteral("due date")) ? QDateTime::fromString(string, Qt::ISODate) : QVariant(); const QByteArray property = (field == QStringLiteral("text")) ? field.toUtf8() : (field == QStringLiteral("title")) ? field.toUtf8() : (field == QStringLiteral("start date")) ? "startDate" : (field == QStringLiteral("due date")) ? "dueDate" : QByteArray(); VERIFY(value.isValid()); VERIFY(!property.isEmpty()); ScenarioScope context; VERIFY(context->editor->setProperty("editingInProgress", true)); VERIFY(context->editor->setProperty(property, value)); } WHEN("^I rename the item to \"(.+)\"$") { REGEX_PARAM(QString, title); ScenarioScope context; VERIFY(context->editor->setProperty("editingInProgress", false)); VERIFY(context->model()->setData(context->index, title, Qt::EditRole)); context->waitForStableState(); } WHEN("^I open the item in the editor again$") { ScenarioScope context; auto artifact = context->currentArtifact(); VERIFY(artifact); VERIFY(context->editor->setProperty("artifact", QVariant::fromValue(Domain::Artifact::Ptr()))); VERIFY(context->editor->setProperty("artifact", QVariant::fromValue(artifact))); context->waitForStableState(); } WHEN("^I drop the item on \"(.*)\" in the central list") { REGEX_PARAM(QString, itemName); ScenarioScope context; VERIFY(context->index.isValid()); const QMimeData *data = context->model()->mimeData(QModelIndexList() << context->index); QAbstractItemModel *destModel = context->model(); QModelIndex dropIndex = Zanshin::findIndex(destModel, itemName); VERIFY(dropIndex.isValid()); VERIFY(destModel->dropMimeData(data, Qt::MoveAction, -1, -1, dropIndex)); context->waitForStableState(); } WHEN("^I drop the item on the blank area of the central list") { ScenarioScope context; VERIFY(context->index.isValid()); const QMimeData *data = context->model()->mimeData(QModelIndexList() << context->index); QAbstractItemModel *destModel = context->model(); VERIFY(destModel->dropMimeData(data, Qt::MoveAction, -1, -1, QModelIndex())); context->waitForStableState(); } WHEN("^I drop items on \"(.*)\" in the central list") { REGEX_PARAM(QString, itemName); ScenarioScope context; VERIFY(!context->dragIndices.isEmpty()); QModelIndexList indexes; std::transform(context->dragIndices.constBegin(), context->dragIndices.constEnd(), std::back_inserter(indexes), [] (const QPersistentModelIndex &index) { VERIFY(index.isValid()); return index; }); const QMimeData *data = context->model()->mimeData(indexes); QAbstractItemModel *destModel = context->model(); QModelIndex dropIndex = Zanshin::findIndex(destModel, itemName); VERIFY(dropIndex.isValid()); VERIFY(destModel->dropMimeData(data, Qt::MoveAction, -1, -1, dropIndex)); context->waitForStableState(); } WHEN("^I drop the item on \"(.*)\" in the page list") { REGEX_PARAM(QString, itemName); ScenarioScope context; VERIFY(context->index.isValid()); const QMimeData *data = context->model()->mimeData(QModelIndexList() << context->index); auto availablePages = context->app->property("availablePages").value(); VERIFY(availablePages); auto destModel = availablePages->property("pageListModel").value(); VERIFY(destModel); context->waitForStableState(); QModelIndex dropIndex = Zanshin::findIndex(destModel, itemName); VERIFY(dropIndex.isValid()); VERIFY(destModel->dropMimeData(data, Qt::MoveAction, -1, -1, dropIndex)); context->waitForStableState(); } WHEN("^I drop items on \"(.*)\" in the page list") { REGEX_PARAM(QString, itemName); ScenarioScope context; VERIFY(!context->dragIndices.isEmpty()); QModelIndexList indexes; std::transform(context->dragIndices.constBegin(), context->dragIndices.constEnd(), std::back_inserter(indexes), [] (const QPersistentModelIndex &index) { VERIFY(index.isValid()); return index; }); const QMimeData *data = context->model()->mimeData(indexes); auto availablePages = context->app->property("availablePages").value(); VERIFY(availablePages); auto destModel = availablePages->property("pageListModel").value(); VERIFY(destModel); context->waitForStableState(); QModelIndex dropIndex = Zanshin::findIndex(destModel, itemName); VERIFY(dropIndex.isValid()); VERIFY(destModel->dropMimeData(data, Qt::MoveAction, -1, -1, dropIndex)); context->waitForStableState(); } WHEN("^the setting key (\\S+) changes to (\\d+)$") { REGEX_PARAM(QString, keyName); REGEX_PARAM(qint64, id); ScenarioScope context; KConfigGroup config(KSharedConfig::openConfig(), "General"); config.writeEntry(keyName, id); } WHEN("^the user changes the default data source to \"(.*)\"$") { REGEX_PARAM(QString, sourceName); ScenarioScope context; context->waitForStableState(); auto sourceIndex = Zanshin::findIndex(context->model(), sourceName); auto availableSources = context->app->property("availableSources").value(); VERIFY(availableSources); VERIFY(QMetaObject::invokeMethod(availableSources, "setDefaultItem", Q_ARG(QModelIndex, sourceIndex))); context->waitForStableState(); } THEN("^the list is") { TABLE_PARAM(tableParam); ScenarioScope context; auto roleNames = context->model()->roleNames(); QSet usedRoles; QStandardItemModel inputModel; for (const auto &row : tableParam.hashes()) { QStandardItem *item = new QStandardItem; for (const auto &it : row) { const QByteArray roleName = it.first.data(); const QString value = QString::fromUtf8(it.second.data()); const int role = roleNames.key(roleName, -1); VERIFY_OR_DUMP(role != -1); item->setData(value, role); usedRoles.insert(role); } inputModel.appendRow(item); } QSortFilterProxyModel proxy; QAbstractItemModel *referenceModel; if (!qobject_cast(context->sourceModel())) { referenceModel = &proxy; proxy.setSourceModel(&inputModel); proxy.setSortRole(Qt::DisplayRole); proxy.sort(0); proxy.setObjectName(QStringLiteral("the_list_is_proxy")); } else { referenceModel = &inputModel; } for (int row = 0; row < context->indices.size(); row++) { QModelIndex expectedIndex = referenceModel->index(row, 0); QModelIndex resultIndex = context->indices.at(row); foreach (const auto &role, usedRoles) { COMPARE_OR_DUMP(Zanshin::indexString(resultIndex, role), Zanshin::indexString(expectedIndex, role)); } } COMPARE_OR_DUMP(context->indices.size(), referenceModel->rowCount()); } THEN("^the list contains \"(.+)\"$") { REGEX_PARAM(QString, itemName); ScenarioScope context; for (int row = 0; row < context->indices.size(); row++) { if (Zanshin::indexString(context->indices.at(row)) == itemName) return; } VERIFY_OR_DUMP(false); } THEN("^the list does not contain \"(.+)\"$") { REGEX_PARAM(QString, itemName); ScenarioScope context; for (int row = 0; row < context->indices.size(); row++) { VERIFY_OR_DUMP(Zanshin::indexString(context->indices.at(row)) != itemName); } } THEN("^the task corresponding to the item is done$") { ScenarioScope context; auto artifact = context->currentArtifact(); VERIFY(artifact); auto task = artifact.dynamicCast(); VERIFY(task); VERIFY(task->isDone()); } THEN("^the editor shows the task as done$") { ScenarioScope context; VERIFY(context->editor->property("done").toBool()); } THEN("^the editor shows \"(.*)\" as (.*)$") { REGEX_PARAM(QString, string); REGEX_PARAM(QString, field); const QVariant value = (field == QStringLiteral("text")) ? string : (field == QStringLiteral("title")) ? string : (field == QStringLiteral("delegate")) ? string : (field == QStringLiteral("start date")) ? QDateTime::fromString(string, Qt::ISODate) : (field == QStringLiteral("due date")) ? QDateTime::fromString(string, Qt::ISODate) : QVariant(); const QByteArray property = (field == QStringLiteral("text")) ? field.toUtf8() : (field == QStringLiteral("title")) ? field.toUtf8() : (field == QStringLiteral("delegate")) ? "delegateText" : (field == QStringLiteral("start date")) ? "startDate" : (field == QStringLiteral("due date")) ? "dueDate" : QByteArray(); VERIFY(value.isValid()); VERIFY(!property.isEmpty()); ScenarioScope context; COMPARE(context->editor->property(property), value); } THEN("^the default data source is \"(.*)\"$") { REGEX_PARAM(QString, expectedName); ScenarioScope context; context->waitForStableState(); auto expectedIndex = Zanshin::findIndex(context->model(), expectedName); VERIFY(expectedIndex.isValid()); auto defaultRole = context->model()->roleNames().key("default", -1); VERIFY(expectedIndex.data(defaultRole).toBool()); } THEN("^the setting key (\\S+) is (\\d+)$") { REGEX_PARAM(QString, keyName); REGEX_PARAM(qint64, expectedId); KConfigGroup config(KSharedConfig::openConfig(), "General"); const qint64 id = config.readEntry(keyName, -1); COMPARE(id, expectedId); } #include "cuke-steps.moc" diff --git a/tests/features/renku/features/editing/editing-note.feature b/tests/features/renku/features/editing/editing-note.feature index 99f179b5..0a7e7175 100644 --- a/tests/features/renku/features/editing/editing-note.feature +++ b/tests/features/renku/features/editing/editing-note.feature @@ -1,12 +1,12 @@ Feature: Editing notes As an organized person I can edit a previously created note In order to improve it, logging more ideas Scenario: Editing a note text Given I display the "Inbox" page - And there is an item named "A page of diary" in the central list + And there is an item named "A note about nothing interesting" in the central list When I open the item in the editor - And I change the editor text to "More on my day" + And I change the editor text to "This is a boring note" And I open the item in the editor again - Then the editor shows "More on my day" as text + Then the editor shows "This is a boring note" as text diff --git a/tests/features/renku/features/editing/removing-note.feature b/tests/features/renku/features/editing/removing-note.feature index 6a81ac59..84a08d60 100644 --- a/tests/features/renku/features/editing/removing-note.feature +++ b/tests/features/renku/features/editing/removing-note.feature @@ -1,17 +1,17 @@ Feature: Removing notes As a note junkie I can delete a note so it is removed In order to clean up the old junk I accumulated Scenario Outline: Removing a note from a page Given I display the "" page And there is an item named "" in the central list When I remove the item And I list the items Then the list does not contain "<title>" Examples: - | page | title | - | Inbox | A page of diary | - | Tags / Philosophy | A random note on life | + | page | title | + | Inbox | A note about nothing interesting | + | Tags / Philosophy | A note about philosophy | diff --git a/tests/features/renku/features/inbox/inbox-display.feature b/tests/features/renku/features/inbox/inbox-display.feature index 7e70b1c9..5d111ba1 100644 --- a/tests/features/renku/features/inbox/inbox-display.feature +++ b/tests/features/renku/features/inbox/inbox-display.feature @@ -1,13 +1,12 @@ Feature: Inbox content As someone collecting notes I can display the Inbox In order to see the notes (e.g. any note not associated to tag) Scenario: Unorganized notes appear in the inbox Given I display the "Inbox" page And I look at the central list When I list the items Then the list is: | display | | A note about nothing interesting | - | A random note on life | diff --git a/tests/features/renku/features/tags/tag-note-add.feature b/tests/features/renku/features/tags/tag-note-add.feature index 51106c52..72893a40 100644 --- a/tests/features/renku/features/tags/tag-note-add.feature +++ b/tests/features/renku/features/tags/tag-note-add.feature @@ -1,15 +1,14 @@ Feature: Note creation from a tag As someone collecting notes I can add a note directly associated to a tag In order to give my note some semantic Scenario: Note added from a tag appear in its list Given I display the "Tags / Physics" page When I add a "note" named "Studies in fluid mechanics" And I look at the central list When I list the items Then the list is: | display | | A note about physics | - | A note about nothing interesting | | Studies in fluid mechanics | diff --git a/tests/features/renku/features/tags/tag-note-reset.feature b/tests/features/renku/features/tags/tag-note-reset.feature index 433af34e..38919e5a 100644 --- a/tests/features/renku/features/tags/tag-note-reset.feature +++ b/tests/features/renku/features/tags/tag-note-reset.feature @@ -1,20 +1,19 @@ Feature: Tag reset As someone using notes I can reset a note from all its tags In order to maintain the semantic Scenario: Resetting a note dissociate it from all its tags Given I display the "Tags / Physics" page - And there is an item named "A note about nothing interesting" in the central list + And there is an item named "A note about physics" in the central list When I drop the item on "Inbox" in the page list And I list the items - And the list does not contain "A note about nothing interesting" + And the list does not contain "A note about physics" And I display the "Inbox" page And I look at the central list And I list the items Then the list is: | display | | A note about nothing interesting | - | A note about philosophy | - | A random note on life | + | A note about physics | diff --git a/tests/features/renku/features/tags/tag-remove.feature b/tests/features/renku/features/tags/tag-remove.feature index bf1da1d3..af24a594 100644 --- a/tests/features/renku/features/tags/tag-remove.feature +++ b/tests/features/renku/features/tags/tag-remove.feature @@ -1,15 +1,14 @@ Feature: Tag removal As someone using notes I can remove a tag In order to maintain their semantic Scenario: Removed tag disappear from the list Given I display the available pages - When I remove a "tag" named "Optional" + When I remove a "tag" named "Physics" And I list the items Then the list is: | display | icon | | Inbox | mail-folder-inbox | | Tags | folder | | Tags / Philosophy | view-pim-tasks | - | Tags / Physics | view-pim-tasks | diff --git a/tests/features/zanshin/features/contexts/context-drag-and-drop.feature b/tests/features/zanshin/features/contexts/context-drag-and-drop.feature index a7032b54..b9f5e66b 100644 --- a/tests/features/zanshin/features/contexts/context-drag-and-drop.feature +++ b/tests/features/zanshin/features/contexts/context-drag-and-drop.feature @@ -1,29 +1,29 @@ Feature: Context task association As someone collecting tasks I can associate tasks to a context In order to describe the tasks resources Scenario: Dropping a task on a context from the inbox Given I display the "Inbox" page And there is an item named "Buy rutabagas" in the central list When I drop the item on "Contexts / Errands" in the page list And I display the "Contexts / Errands" page And I look at the central list And I list the items Then the list is: | display | | Buy kiwis | | Buy rutabagas | Scenario: Dropping a task on a context from the project central list Given I display the "Projects / Prepare talk about TDD" page And there is an item named "Create examples and exercices" in the central list - When I drop the item on "Contexts / Internet" in the page list - And I display the "Contexts / Internet" page + When I drop the item on "Contexts / Online" in the page list + And I display the "Contexts / Online" page And I look at the central list And I list the items Then the list is: | display | | Create examples and exercices | | Create examples and exercices / Train for the FizzBuzz kata | | Create examples and exercices / Train for the Gilded Rose kata | diff --git a/tests/features/zanshin/features/contexts/context-edit.feature b/tests/features/zanshin/features/contexts/context-edit.feature index d1f02da3..af2f336a 100644 --- a/tests/features/zanshin/features/contexts/context-edit.feature +++ b/tests/features/zanshin/features/contexts/context-edit.feature @@ -1,21 +1,20 @@ Feature: Context rename As someone collecting tasks I can rename a context In order to refine my tasks organization Scenario: Renamed context appear in the list Given I display the available pages When I rename a "context" named "Errands" to "Chores" And I list the items Then the list is: | display | icon | | Inbox | mail-folder-inbox | | Workday | go-jump-today | | Projects | folder | | Projects / Backlog | view-pim-tasks | | Projects / Prepare talk about TDD | view-pim-tasks | | Projects / Read List | view-pim-tasks | | Contexts | folder | | Contexts / Chores | view-pim-notes | - | Contexts / Internet | view-pim-notes | | Contexts / Online | view-pim-notes | diff --git a/tests/features/zanshin/features/contexts/context-task-remove.feature b/tests/features/zanshin/features/contexts/context-task-remove.feature index 518ac8fb..a096436a 100644 --- a/tests/features/zanshin/features/contexts/context-task-remove.feature +++ b/tests/features/zanshin/features/contexts/context-task-remove.feature @@ -1,28 +1,29 @@ Feature: Context task dissociation As someone collecting tasks I can delete a task related to a context In order to keep my context meaningful Scenario: Removing a task from a context keeps it in the project page it's linked to Given I display the "Projects / Prepare talk about TDD" page And there is an item named "Create examples and exercices" in the central list - And I display the "Contexts / Internet" page + And I drop the item on "Contexts / Online" in the page list + And I display the "Contexts / Online" page And there is an item named "Create examples and exercices" in the central list When I remove the item And I look at the central list Then the list does not contain "Create examples and exercices" And I display the "Projects / Prepare talk about TDD" page Then there is an item named "Create examples and exercices" in the central list Scenario: Removing a task linked only to a context moves it back to the inbox Given I display the "Inbox" page And I look at the central list Then the list is: | display | - And I display the "Contexts / Chores" page - And there is an item named "Buy rutabagas" in the central list + And I display the "Contexts / Errands" page + And there is an item named "Buy kiwis" in the central list When I remove the item And I look at the central list - Then the list does not contain "Buy rutabagas" + Then the list does not contain "Buy kiwis" And I display the "Inbox" page - Then there is an item named "Buy rutabagas" in the central list + Then there is an item named "Buy kiwis" in the central list diff --git a/tests/features/zanshin/features/datasource/datasource-selection.feature b/tests/features/zanshin/features/datasource/datasource-selection.feature index 42136f62..99e50109 100644 --- a/tests/features/zanshin/features/datasource/datasource-selection.feature +++ b/tests/features/zanshin/features/datasource/datasource-selection.feature @@ -1,67 +1,65 @@ Feature: Data sources selection As an advanced user I can select or deselect sources In order to see more or less content Scenario: Unchecking impacts the inbox Given I display the "Inbox" page And there is an item named "TestData / Calendar1" in the available data sources When I uncheck the item And I look at the central list And I list the items Then the list is: | display | | Buy apples | | Buy pears | | Errands | Scenario: Checking impacts the inbox Given I display the "Inbox" page And there is an item named "TestData / Calendar1" in the available data sources When I check the item And I look at the central list And I list the items Then the list is: | display | | "Capital in the Twenty-First Century" by Thomas Piketty | | "The Pragmatic Programmer" by Hunt and Thomas | | Buy cheese | | Buy kiwis | | Buy apples | | Buy pears | | Errands | | Buy rutabagas | Scenario: Unchecking impacts project list Given there is an item named "TestData / Calendar1" in the available data sources When I uncheck the item And I display the available pages And I list the items Then the list is: | display | | Inbox | | Workday | | Projects | | Projects / Backlog | | Contexts | - | Contexts / Chores | - | Contexts / Internet | + | Contexts / Errands | | Contexts / Online | Scenario: Checking impacts project list Given there is an item named "TestData / Calendar1" in the available data sources When I check the item And I display the available pages And I list the items Then the list is: | display | | Inbox | | Workday | | Projects | | Projects / Backlog | | Projects / Prepare talk about TDD | | Projects / Read List | | Contexts | - | Contexts / Chores | - | Contexts / Internet | + | Contexts / Errands | | Contexts / Online | diff --git a/tests/features/zanshin/features/editing/adding-task.feature b/tests/features/zanshin/features/editing/adding-task.feature index f91cd716..5a71cc06 100644 --- a/tests/features/zanshin/features/editing/adding-task.feature +++ b/tests/features/zanshin/features/editing/adding-task.feature @@ -1,29 +1,30 @@ Feature: Adding tasks As a task junkie I can create task by giving a title In order to collect ideas while reflecting on my life Scenario Outline: Adding a task in a page Given I display the "<page>" page And I look at the central list When I add a "task" named "<title>" And I list the items Then the list contains "<title>" Examples: | page | title | | Inbox | Buy a book | | Projects / Backlog | Setup a release party | Scenario Outline: Adding a task as a child of another task in a page Given I display the "<page>" page + And I add a "task" named "<parent>" And I look at the central list And I list the items When I add a child named "<title>" under the task named "<parent>" And I list the items Then the list contains "<parent> / <title>" Examples: | page | parent | title | | Inbox | Buy a book | Make sure it is a good book | | Projects / Backlog | Setup a release party | Make sure there was a release | diff --git a/tests/features/zanshin/features/editing/editing-task.feature b/tests/features/zanshin/features/editing/editing-task.feature index 56e27d36..05de8149 100644 --- a/tests/features/zanshin/features/editing/editing-task.feature +++ b/tests/features/zanshin/features/editing/editing-task.feature @@ -1,61 +1,46 @@ Feature: Editing tasks As an organized person I can edit a previously created task In order to refine its definition and react to change Scenario: Editing a task text Given I display the "Inbox" page - And there is an item named "Buy a book" in the central list + And there is an item named "Buy cheese" in the central list When I open the item in the editor And I change the editor text to "More information" And I open the item in the editor again Then the editor shows "More information" as text - And the editor shows "Buy a book" as title + And the editor shows "Buy cheese" as title Scenario: Editing a task title using the editor Given I display the "Inbox" page - And there is an item named "Buy a book" in the central list + And there is an item named "Buy cheese" in the central list When I open the item in the editor - And I change the editor title to "Borrow a book" + And I change the editor title to "Borrow cheese" And I open the item in the editor again - Then the editor shows "Borrow a book" as title - And there is an item named "Borrow a book" in the central list - - Scenario: Restoring the task title using the editor - Given I display the "Inbox" page - And there is an item named "Borrow a book" in the central list - When I open the item in the editor - And I change the editor title to "Buy a book" - And I open the item in the editor again - Then the editor shows "Buy a book" as title + Then the editor shows "Borrow cheese" as title + And there is an item named "Borrow cheese" in the central list Scenario: Editing a task title in the central list Given I display the "Inbox" page - And there is an item named "Buy a book" in the central list - When I open the item in the editor - And I rename the item to "Buy a better book" - Then the editor shows "Buy a better book" as title - - Scenario: Restoring the task title using the central list - Given I display the "Inbox" page - And there is an item named "Buy a better book" in the central list + And there is an item named "Buy cheese" in the central list When I open the item in the editor - And I rename the item to "Buy a book" - Then the editor shows "Buy a book" as title + And I rename the item to "Buy better cheese" + Then the editor shows "Buy better cheese" as title Scenario: Editing a task start date Given I display the "Inbox" page - And there is an item named "Buy a book" in the central list + And there is an item named "Buy cheese" in the central list When I open the item in the editor And I change the editor start date to "2014-06-20" And I open the item in the editor again Then the editor shows "2014-06-20" as start date Scenario: Editing a task due date Given I display the "Inbox" page - And there is an item named "Buy a book" in the central list + And there is an item named "Buy cheese" in the central list When I open the item in the editor And I change the editor due date to "2014-07-20" And I open the item in the editor again Then the editor shows "2014-07-20" as due date diff --git a/tests/features/zanshin/features/editing/removing-task.feature b/tests/features/zanshin/features/editing/removing-task.feature index a4c60f13..e450dc0d 100644 --- a/tests/features/zanshin/features/editing/removing-task.feature +++ b/tests/features/zanshin/features/editing/removing-task.feature @@ -1,17 +1,17 @@ Feature: Removing tasks As a task junkie I can delete a task so it is removed In order to clean up the old junk I accumulated Scenario Outline: Removing a simple task from a page Given I display the "<page>" page And there is an item named "<title>" in the central list When I remove the item And I list the items Then the list does not contain "<title>" Examples: - | page | title | - | Inbox | Buy a book | - | Projects / Backlog | Setup a release party | + | page | title | + | Inbox | Buy cheese | + | Projects / Read List | "Domain Driven Design" by Eric Evans | diff --git a/tests/features/zanshin/features/inbox/inbox-drag-and-drop.feature b/tests/features/zanshin/features/inbox/inbox-drag-and-drop.feature index fb3d3f4b..67b8a529 100644 --- a/tests/features/zanshin/features/inbox/inbox-drag-and-drop.feature +++ b/tests/features/zanshin/features/inbox/inbox-drag-and-drop.feature @@ -1,135 +1,129 @@ Feature: Inbox task association As someone collecting tasks I can associate a task to another one In order to deal with complex tasks requiring several steps Scenario: Dropping a task on another one makes it a child Given I display the "Inbox" page And there is an item named "Buy apples" in the central list When I drop the item on "Errands" in the central list And I list the items Then the list is: | display | | Errands | | Errands / Buy apples | | "Capital in the Twenty-First Century" by Thomas Piketty | | "The Pragmatic Programmer" by Hunt and Thomas | | Buy cheese | | Buy kiwis | | Buy pears | | Buy rutabagas | Scenario: Dropping a child task on the inbox makes it top-level Given I display the "Inbox" page + And there is an item named "Buy apples" in the central list + And I drop the item on "Errands" in the central list And there is an item named "Errands / Buy apples" in the central list When I drop the item on "Inbox" in the page list And I list the items Then the list is: | display | | Errands | | Buy apples | | "Capital in the Twenty-First Century" by Thomas Piketty | | "The Pragmatic Programmer" by Hunt and Thomas | | Buy cheese | | Buy kiwis | | Buy pears | | Buy rutabagas | Scenario: Dropping two tasks on another one makes them children Given I display the "Inbox" page And the central list contains items named: | display | | Buy apples | | Buy pears | When I drop items on "Errands" in the central list And I list the items Then the list is: | display | | Errands | | Errands / Buy apples | | Errands / Buy pears | | "Capital in the Twenty-First Century" by Thomas Piketty | | "The Pragmatic Programmer" by Hunt and Thomas | | Buy cheese | | Buy kiwis | | Buy rutabagas | Scenario: Dropping two child tasks on the inbox makes them top-level Given I display the "Inbox" page + And the central list contains items named: + | display | + | Buy apples | + | Buy pears | + And I drop items on "Errands" in the central list And the central list contains items named: | display | | Errands / Buy apples | | Errands / Buy pears | When I drop items on "Inbox" in the page list And I list the items Then the list is: | display | | Errands | | Buy apples | | "Capital in the Twenty-First Century" by Thomas Piketty | | "The Pragmatic Programmer" by Hunt and Thomas | | Buy cheese | | Buy kiwis | | Buy pears | | Buy rutabagas | Scenario: Dropping a task on the inbox removes it from it's associated project Given I display the "Projects / Prepare talk about TDD" page And there is an item named "Create Sozi SVG" in the central list When I drop the item on "Inbox" in the page list And I display the "Inbox" page And I look at the central list And I list the items Then the list is: | display | | Errands | | Buy apples | | "Capital in the Twenty-First Century" by Thomas Piketty | | "The Pragmatic Programmer" by Hunt and Thomas | | Buy cheese | | Buy kiwis | | Buy pears | | Buy rutabagas | | Create Sozi SVG | Scenario: Deparenting a task by dropping on the central list's blank area Given I display the "Inbox" page And I look at the central list And there is an item named "Buy apples" in the central list And I drop the item on "Errands" in the central list And I look at the central list And there is an item named "Errands / Buy apples" in the central list When I drop the item on the blank area of the central list And I list the items Then the list is: | display | | Errands | | Buy apples | | "Capital in the Twenty-First Century" by Thomas Piketty | | "The Pragmatic Programmer" by Hunt and Thomas | | Buy cheese | | Buy kiwis | | Buy pears | | Buy rutabagas | - | Create Sozi SVG | - @wip Scenario: Dropping a task on the inbox removes it from all it's contexts - Given I display the "Contexts / Chores" page + Given I display the "Contexts / Errands" page And there is an item named "Buy kiwis" in the central list When I drop the item on "Inbox" in the page list - And I display the "Inbox" page + And I display the "Contexts / Errands" page And I look at the central list - And I list the items - Then the list is: - | display | - | Errands | - | Buy apples | - | "Capital in the Twenty-First Century" by Thomas Piketty | - | "The Pragmatic Programmer" by Hunt and Thomas | - | Buy cheese | - | Buy kiwis | - | Buy pears | - | Buy rutabagas | - | Create Sozi SVG | - | Buy kiwis | + Then the list does not contain "Buy kiwis" + diff --git a/tests/features/zanshin/features/pages/pages-display.feature b/tests/features/zanshin/features/pages/pages-display.feature index ba99e0a9..45c37414 100644 --- a/tests/features/zanshin/features/pages/pages-display.feature +++ b/tests/features/zanshin/features/pages/pages-display.feature @@ -1,21 +1,20 @@ Feature: Available pages content As someone collecting tasks I can see all the pages available to me In order to display them and add tasks to them Scenario: Inbox, projects, contexts and tags appear in the list Given I display the available pages When I list the items Then the list is: | display | icon | | Inbox | mail-folder-inbox | | Workday | go-jump-today | | Projects | folder | | Projects / Backlog | view-pim-tasks | | Projects / Prepare talk about TDD | view-pim-tasks | | Projects / Read List | view-pim-tasks | | Contexts | folder | - | Contexts / Chores | view-pim-notes | - | Contexts / Internet | view-pim-notes | + | Contexts / Errands | view-pim-notes | | Contexts / Online | view-pim-notes | diff --git a/tests/features/zanshin/features/projects/project-add.feature b/tests/features/zanshin/features/projects/project-add.feature index 7a62eb75..bd2d50fd 100644 --- a/tests/features/zanshin/features/projects/project-add.feature +++ b/tests/features/zanshin/features/projects/project-add.feature @@ -1,22 +1,21 @@ Feature: Project creation As someone collecting tasks I can create a project In order to organize my tasks Scenario: New projects appear in the list Given I display the available pages When I add a project named "Birthday" in the source named "TestData / Calendar1" And I list the items Then the list is: | display | icon | | Inbox | mail-folder-inbox | | Workday | go-jump-today | | Projects | folder | | Projects / Backlog | view-pim-tasks | | Projects / Birthday | view-pim-tasks | | Projects / Prepare talk about TDD | view-pim-tasks | | Projects / Read List | view-pim-tasks | | Contexts | folder | - | Contexts / Chores | view-pim-notes | - | Contexts / Internet | view-pim-notes | + | Contexts / Errands | view-pim-notes | | Contexts / Online | view-pim-notes | diff --git a/tests/features/zanshin/features/projects/project-drag-and-drop.feature b/tests/features/zanshin/features/projects/project-drag-and-drop.feature index a7c8dd6d..77fbbb9b 100644 --- a/tests/features/zanshin/features/projects/project-drag-and-drop.feature +++ b/tests/features/zanshin/features/projects/project-drag-and-drop.feature @@ -1,28 +1,28 @@ Feature: Project task association As someone collecting tasks I can associate a task to a project In order to organize my work Scenario: Dropping a task on a project Given I display the "Inbox" page And there is an item named ""The Pragmatic Programmer" by Hunt and Thomas" in the central list When I drop the item on "Projects / Read List" in the page list And I display the "Projects / Read List" page And I look at the central list And I list the items Then the list is: | display | | "Clean Code" by Robert C Martin | | "Domain Driven Design" by Eric Evans | | "The Pragmatic Programmer" by Hunt and Thomas | Scenario: Dropping a task on a project from context central list - Given I display the "Contexts / Chores" page + Given I display the "Contexts / Errands" page And there is an item named "Buy kiwis" in the central list - When I drop the item on "Projects / Birthday" in the page list - And I display the "Projects / Birthday" page + When I drop the item on "Projects / Backlog" in the page list + And I display the "Projects / Backlog" page And I look at the central list And I list the items Then the list is: | display | | Buy kiwis | diff --git a/tests/features/zanshin/features/projects/project-edit.feature b/tests/features/zanshin/features/projects/project-edit.feature index 40fb5cca..1d936c8e 100644 --- a/tests/features/zanshin/features/projects/project-edit.feature +++ b/tests/features/zanshin/features/projects/project-edit.feature @@ -1,22 +1,20 @@ Feature: Project rename As someone collecting tasks I can rename a project In order to refine my tasks organization Scenario: Renamed projects appear in the list Given I display the available pages - When I rename a "project" named "Birthday" to "Party" + When I rename a "project" named "Backlog" to "Party" And I list the items Then the list is: | display | icon | | Inbox | mail-folder-inbox | | Workday | go-jump-today | | Projects | folder | - | Projects / Backlog | view-pim-tasks | | Projects / Party | view-pim-tasks | | Projects / Prepare talk about TDD | view-pim-tasks | | Projects / Read List | view-pim-tasks | | Contexts | folder | - | Contexts / Chores | view-pim-notes | - | Contexts / Internet | view-pim-notes | + | Contexts / Errands | view-pim-notes | | Contexts / Online | view-pim-notes | diff --git a/tests/features/zanshin/features/projects/project-remove.feature b/tests/features/zanshin/features/projects/project-remove.feature index 3b773953..bbbebd59 100644 --- a/tests/features/zanshin/features/projects/project-remove.feature +++ b/tests/features/zanshin/features/projects/project-remove.feature @@ -1,21 +1,19 @@ Feature: Project destruction As someone collecting tasks I can delete a project In order to clean my tasks Scenario: Removing a simple project from the list Given I display the available pages When I remove a "project" named "Prepare talk about TDD" And I list the items Then the list is: | display | icon | | Inbox | mail-folder-inbox | | Workday | go-jump-today | | Projects | folder | | Projects / Backlog | view-pim-tasks | - | Projects / Party | view-pim-tasks | | Projects / Read List | view-pim-tasks | | Contexts | folder | - | Contexts / Chores | view-pim-notes | - | Contexts / Internet | view-pim-notes | + | Contexts / Errands | view-pim-notes | | Contexts / Online | view-pim-notes | diff --git a/tests/features/zanshin/features/projects/project-task-add.feature b/tests/features/zanshin/features/projects/project-task-add.feature index f466dfd1..1dd4fe62 100644 --- a/tests/features/zanshin/features/projects/project-task-add.feature +++ b/tests/features/zanshin/features/projects/project-task-add.feature @@ -1,14 +1,15 @@ Feature: Task creation from a project As someone collecting tasks I can add a task directly inside a project In order to organize my tasks Scenario: Task added from a project appear in its list - Given I display the "Projects / Party" page + Given I display the "Projects / Backlog" page When I add a "task" named "Buy a cake" + And I add a "task" named "Buy a present" And I look at the central list When I list the items Then the list is: | display | | Buy a cake | - | Buy kiwis | + | Buy a present | diff --git a/tests/features/zanshin/features/projects/project-task-promote.feature b/tests/features/zanshin/features/projects/project-task-promote.feature index 1a728eef..3e31d50e 100644 --- a/tests/features/zanshin/features/projects/project-task-promote.feature +++ b/tests/features/zanshin/features/projects/project-task-promote.feature @@ -1,27 +1,26 @@ Feature: Task promotion As someone collecting tasks I can promote a task into a project In order to organize my tasks Scenario: Task promoted into a project appears in the list - Given I display the "Projects / Party" page + Given I display the "Projects / Backlog" page And I add a "task" named "Design a present" And I look at the central list And there is an item named "Design a present" in the central list When I promote the item And I display the available pages And I list the items Then the list is: | display | icon | | Inbox | mail-folder-inbox | | Workday | go-jump-today | | Projects | folder | | Projects / Backlog | view-pim-tasks | | Projects / Design a present | view-pim-tasks | - | Projects / Party | view-pim-tasks | + | Projects / Prepare talk about TDD | view-pim-tasks | | Projects / Read List | view-pim-tasks | | Contexts | folder | - | Contexts / Chores | view-pim-notes | - | Contexts / Internet | view-pim-notes | + | Contexts / Errands | view-pim-notes | | Contexts / Online | view-pim-notes | diff --git a/tests/features/zanshin/features/workday/workday-display-completed.feature b/tests/features/zanshin/features/workday/workday-display-completed.feature index 1f31f1ba..714e7030 100644 --- a/tests/features/zanshin/features/workday/workday-display-completed.feature +++ b/tests/features/zanshin/features/workday/workday-display-completed.feature @@ -1,13 +1,13 @@ Feature: Display completed tasks in Workday list As someone using tasks I can display the Workday list In order to know which tasks I’ve completed today (e.g. if done date is today) Scenario: The tasks that have been done today appear in the Workday list Given I display the "Inbox" page - And there is an item named "Create Sozi SVG" in the central list + And there is an item named "Buy rutabagas" in the central list When I check the item And I display the "Workday" page And I look at the central list And I list the items - Then the list contains "Create Sozi SVG" + Then the list contains "Buy rutabagas" diff --git a/tests/features/zanshin/features/workday/workday-display.feature b/tests/features/zanshin/features/workday/workday-display.feature index ab6076ae..989f5ece 100644 --- a/tests/features/zanshin/features/workday/workday-display.feature +++ b/tests/features/zanshin/features/workday/workday-display.feature @@ -1,18 +1,15 @@ Feature: Workday content As someone using tasks I can display the Workday list In order to know which tasks should be completed today (e.g. if start date or due date is today or in the past) Scenario: The tasks that need to be done today appear in the Workday list Given I display the "Workday" page And I look at the central list When I list the items Then the list is : | display | | "Clean Code" by Robert C Martin | | Buy kiwis | | Buy pears | | Errands | - | Buy apples | - | Buy cheese | - | Create Sozi SVG | diff --git a/tests/features/zanshin/features/workday/workday-startdate-edit.feature b/tests/features/zanshin/features/workday/workday-startdate-edit.feature index 0d5b8103..77a20237 100644 --- a/tests/features/zanshin/features/workday/workday-startdate-edit.feature +++ b/tests/features/zanshin/features/workday/workday-startdate-edit.feature @@ -1,28 +1,28 @@ Feature: Modifying a task's start date As someone using tasks I can modify the start date of tasks to today In order to have them plan from today Scenario: Setting a date's start date to today makes it appear in the workday view Given I display the "Inbox" page - And there is an item named "Create Sozi SVG" in the central list + And there is an item named "Buy rutabagas" in the central list When I open the item in the editor And I change the editor start date to "2015-03-10" And I display the "Workday" page And I look at the central list And I list the items - Then the list contains "Create Sozi SVG" + Then the list contains "Buy rutabagas" Scenario: Setting a date's start date to a date in the past makes it appear in the workday view Given I display the "Workday" page And I look at the central list And I list the items - And the list does not contain "Buy kiwis" - And I display the "Projects / Party" page - And there is an item named "Buy kiwis" in the central list + And the list does not contain "Buy rutabagas" + And I display the "Inbox" page + And there is an item named "Buy rutabagas" in the central list When I open the item in the editor And I change the editor start date to "2014-03-10" And I display the "Workday" page And I look at the central list And I list the items - Then the list contains "Buy kiwis" + Then the list contains "Buy rutabagas"