public void SaveExecutedTestToCodeHistory() { UITest(() => { var logInPage = header.GoToLogInPage(); logInPage.SignIn("*****@*****.**", Constants.STUDENT_PASSWORD); sideBar = ConstructPage <SideBar>(); var courseManagment = sideBar.GoToCourseManagementPage(); var coursesBlocks = courseManagment.GetBlocks(); var courseItem = coursesBlocks.FirstOrDefault(x => x.GetCourseName().Equals("C# Essential", StringComparison.OrdinalIgnoreCase)); courseItem.ClickCourseLink(); var ListOfTasks = ConstructPage <TasksPage>(); string TaskName = "Indexers"; string nameOfExecutedTask = ""; var blocks = ListOfTasks.GetBlocks(); if (blocks != null) { var firstblock = blocks.FirstOrDefault(x => x.GetName().Equals(TaskName, StringComparison.OrdinalIgnoreCase)); nameOfExecutedTask = firstblock.GetName(); firstblock.ClickOnTasksButton(); var TaskView = ConstructPage <TaskViewPage>(); TaskView.ClickOnStartButton(); var Code = ConstructPage <SolutionCodePage>(); Code.ClickOnExecuteButton("Total"); } var historyPage = sideBar.GoToCodeHistoryPage(); var blocksHistory = historyPage.GetHistoryBlocks(); bool blockOfExecutedCode = false; foreach (var block in blocksHistory) { if (block.GetTitle() == nameOfExecutedTask) { blockOfExecutedCode = true; break; } } Assert.True(blockOfExecutedCode); }); }