Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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"));
            }
        }
Esempio n. 7
0
 public TodosSteps(TodosDriver driver)
 {
     todosDriver = driver;
 }