Exemple #1
0
        public void AddTask()
        {
            using (var todosDriver = new TodosDriver())
            {
                var todosPage = todosDriver.GotoTodosPage();

                todosPage.AddTask("New task");

                var taskRow = todosPage.TodosList.Last();
                Assert.AreEqual("New task", taskRow.TaskText);
            }
        }
Exemple #2
0
        public void MarkTaskCompleted()
        {
            using (var todosDriver = new TodosDriver())
            {
                var todosPage = todosDriver.GotoTodosPage();
                todosPage.AddTask("New Task");

                var task = todosPage.FindTask("New Task");
                task.MarkCompleted();

                Assert.IsTrue(task.IsCompleted);
            }
        }
Exemple #3
0
        public void DeleteTask()
        {
            using (var todosDriver = new TodosDriver())
            {
                var todosPage = todosDriver.GotoTodosPage();
                todosPage.AddTask("New Task");

                var taskRow = todosPage.TodosList.First(a => a.TaskText == "New Task");
                taskRow.DeleteTask();

                Assert.AreEqual(0, todosPage.TodosList.Count);
            }
        }
Exemple #4
0
        public void EditTask()
        {
            using (var todosDriver = new TodosDriver())
            {
                var todosPage = todosDriver.GotoTodosPage();
                todosPage.AddTask("New Task");

                var newTask = todosPage.TodosList.First(a => a.TaskText == "New Task");
                newTask.EditTask("New Name");

                Assert.AreEqual("New Name", newTask.TaskText);
            }
        }
Exemple #5
0
        public void ClearCompletedTasks()
        {
            using (var todosDriver = new TodosDriver())
            {
                var todosPage = todosDriver.GotoTodosPage();
                todosPage.AddTask("New Task");
                todosPage.AddTask("New Task2");
                todosPage.FindTask("New Task").MarkCompleted();
                todosPage.FindTask("New Task2").MarkCompleted();

                todosPage.ClearAllCompletedTasks();

                Assert.AreEqual(0, todosPage.TodosList.Count);
            }
        }
Exemple #6
0
        public void FilterCompletedTasksWillShowOnlyCompletedTasks()
        {
            using (var todosDriver = new TodosDriver())
            {
                var todosPage = todosDriver.GotoTodosPage();
                todosPage.AddTask("Active");
                todosPage.AddTask("Completed");
                todosPage.FindTask("Completed").MarkCompleted();

                todosPage.SelectCompletedTasksView();
                var allTasks = todosPage.TodosList;

                Assert.AreEqual(1, todosPage.TodosList.Count);
                Assert.IsTrue(allTasks.Any(a => a.TaskText == "Completed"));
            }
        }
Exemple #7
0
 public void GivenIAmInTheTodosPage() => todosPage = todosDriver.GotoTodosPage();