public void UnlinkActionTest() { var departmentDetail = new ApplicationPageObject(Fixture) .NavigateToDepartment() .OpenRecordByTitle("Development Department"); departmentDetail .Positions() .Assert(p => { p.RowCount.ShouldBe(2); p.GetValues(0, "Title").ShouldBe(new Dictionary <string, string> { ["Title"] = "Developer" }); p.UnlinkAction.Enabled.ShouldBeFalse(); }) .SelectRow(0) .Assert(p => p.UnlinkAction.Enabled.ShouldBeTrue()) .ExecuteAction(p => p.UnlinkAction) .Assert(p => { p.RowCount.ShouldBe(1); p.GetValues(0, "Title").ShouldBe(new Dictionary <string, string> { ["Title"] = "Manager" }); }); departmentDetail .Contacts() .Assert(c => c.UnlinkAction.Enabled.ShouldBeFalse()) .SelectRow(0) .Assert(c => c.UnlinkAction.Enabled.ShouldBeTrue()); }
protected void ChangeContactNameTest_() { var contactList = new ApplicationPageObject(Fixture) .NavigateToContact() .Assert(d => { d.RowCount.ShouldBe(2); d.GetValues(0, "Full Name") .ShouldBe(new Dictionary <string, string>() { ["Full Name"] = "John Nilsen" }); d.GetValues(1, "Full Name") .ShouldBe(new Dictionary <string, string>() { ["Full Name"] = "Mary Tellitson" }); }); var contactDetail = contactList .OpenRecordByFullName("Mary Tellitson") .Assert(c => { c.FullName.ShouldBe("Mary Tellitson"); c.Department.ShouldBe("Development Department"); c.Position.ShouldBe("Manager"); }) .ExecuteActionIf(f => f.IsWeb, c => c.EditAction) .Do(c => { c.FirstName = "User_1"; c.LastName = "User_2"; c.Position = "Developer"; }) .ExecuteAction(c => c.SaveAction) .Assert(c => { c.FullName.ShouldBe("User_1 User_2"); c.Position.ShouldBe("Developer"); }) .ExecuteAction(c => c.SaveAndCloseAction); contactList.GetValues(1, "Full Name", "Position").ShouldBe(new Dictionary <string, string> { ["Full Name"] = "User_1 User_2", ["Position"] = "Developer" }); }
protected void ChangeContactNameAgainTest_() { var application = new ApplicationPageObject(Fixture); var contactList = application .NavigateToContact() .Assert(c => { c.GetValues(0, "Full Name").ShouldBe(new Dictionary <string, string> { ["Full Name"] = "John Nilsen" }); c.GetValues(1, "Full Name").ShouldBe(new Dictionary <string, string> { ["Full Name"] = "Mary Tellitson" }); }); var contactDetail = contactList .OpenRecordByFullName("Mary Tellitson") .ExecuteActionIf(f => f.IsWeb, c => c.EditAction) .Assert(c => { c.FullName.ShouldBe("Mary Tellitson"); c.Department.ShouldBe("Development Department"); }) .Do(c => { c.FirstName = "User_1"; c.LastName = "User_2"; }) .ExecuteAction(c => c.SaveAction); application .NavigateToContact() .Assert(c => { c.GetValues(0, "Full Name").ShouldBe(new Dictionary <string, string> { ["Full Name"] = "John Nilsen" }); c.GetValues(1, "Full Name").ShouldBe(new Dictionary <string, string> { ["Full Name"] = "User_1 User_2" }); }); }
protected void WorkingWithTasks_() { var taskDetail = new ApplicationPageObject(Fixture) .NavigateTo("Demo Task") .OpenRecord("Subject", "Fix breakfast"); taskDetail .List("Contacts") .Assert(c => c.RowCount.ShouldBe(0)) .ExecuteAction(c => c.LinkAction, f => new ListPageObject(f, "Contact"), contactsPopup => { contactsPopup .SelectRow(0) .ExecuteAction(x => x.Action("OK")); }) .Assert(c => { c.RowCount.ShouldBe(1); c.GetValues(0, "Full Name").ShouldBe(new Dictionary <string, string> { ["Full Name"] = "John Nilsen" }); }); }