コード例 #1
0
ファイル: SmokeTests.cs プロジェクト: pithas93/PobucaTests
 public void Can_Edit_Contact()
 {
     ContactCreator.CreateSimpleContact();
     ContactCreator.EditSimpleContact(ContactCreator.FirstContact);
     AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved successfully after edit");
     AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact field values where not saved correctly after edit");
 }
コード例 #2
0
        public void Assert_That_Page_Paths_Are_Correct()
        {
            VerifyThat.IsTrue(ContactsPage.IsAt, "Contact page path is not the expected one");

            ContactsPage.OpenFirstContact();
            VerifyThat.IsTrue(ContactViewPage.IsAt, "Contact view page path is not the expected one");

            EditContactPage.GoTo();
            VerifyThat.IsTrue(EditContactPage.IsAt, "Edit contact page path is not the expected one");

            EditContactPage.ClickSaveContactButton();
            VerifyThat.IsTrue(ContactViewPage.IsAt, "Contact view page path is not the expected one");

            LeftSideMenu.GoToContacts();
            NewContactPage.GoTo();
            VerifyThat.IsTrue(NewContactPage.IsAt, "New contact page path is not the expected one");

            ContactCreator.CreateSimpleContact();
            OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open();
            OrganizationViewPage.FindContactFromOrganizationContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open();
            VerifyThat.IsTrue(ContactViewPage.IsAtFromWithinOrganizationViewPage, "Contact view page path from within organization view page is not the expected one");

            EditContactPage.GoTo();
            VerifyThat.IsTrue(EditContactPage.IsAtFromWithinOrganizationViewPage, "Edit contact page path from within organization view page is not the expected one");

            EditContactPage.ClickSaveContactButton();
            VerifyThat.IsTrue(ContactViewPage.IsAtFromWithinOrganizationViewPage, "Contact view page path from within organization view page is not the expected one");

            OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open();
            OrganizationViewPage.CreateContact();
            VerifyThat.IsTrue(NewContactPage.IsAtFromWithinOrganizationViewPage, "Contact view page path from within organization view page is not the expected one");
        }
コード例 #3
0
 public void Organization_Name_Navigates_To_Organization_View()
 {
     ContactCreator.CreateSimpleContact();
     ContactViewPage.ClickOrganizationName();
     AssertThat.AreEqual(ContactCreator.FirstContact.OrganizationName, OrganizationViewPage.OrganizationName,
                         $"Browser should navigate to '{ContactCreator.FirstContact.OrganizationName}' organization view but, it did not");
 }
コード例 #4
0
        public void Add_Existing_No_Orphan_Contact_To_An_Organization()
        {
            ContactCreator.CreateSimpleContact();
            OrganizationCreator.CreateSimpleOrganization();

            OrganizationViewPage.AddContactsToContactList()
            .UncheckingOrphanCheckbox()
            .WithFirstName(ContactCreator.FirstContact.FirstName)
            .AndLastName(ContactCreator.FirstContact.LastName)
            .Add();

            AssertThat.IsTrue(
                OrganizationViewPage.FindContactFromOrganizationContactList()
                .WithFirstName(ContactCreator.FirstContact.FirstName)
                .AndLastName(ContactCreator.FirstContact.LastName)
                .Find(),
                $"Contact with name {ContactCreator.FirstContact.FullName} should be linked to organization {OrganizationViewPage.OrganizationName} but it is not."
                );

            OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open();
            AssertThat.IsFalse(
                OrganizationViewPage.FindContactFromOrganizationContactList()
                .WithFirstName(ContactCreator.FirstContact.FirstName)
                .AndLastName(ContactCreator.FirstContact.LastName)
                .Find(),
                $"Contact with name {ContactCreator.FirstContact.FullName} should not belong to organization {OrganizationViewPage.OrganizationName} but it is still linked with it."
                );
        }
コード例 #5
0
 public void Cannot_Assign_Invalid_Organization_After_Edit()
 {
     ContactCreator.CreateSimpleContact();
     ContactCreator.EditContactAssigningInvalidOrganization(ContactCreator.FirstContact);
     AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should.");
     AssertThat.AreEqual(ContactViewPage.OrganizationName, "", $"Organization ought to be null but it has value = '{ContactViewPage.OrganizationName}' which is invalid. Defect spotted!");
 }
コード例 #6
0
 public void Edit_Contact_And_Delete_Organization_Value()
 {
     ContactCreator.CreateSimpleContact();
     ContactCreator.EditContactRemovingOrganization(ContactCreator.FirstContact);
     AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should.");
     AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact fields have not the expected values after the edit.");
 }
コード例 #7
0
 public void Edit_Contact_And_Assign_Nonsense_Values()
 {
     ContactCreator.CreateSimpleContact();
     ContactCreator.EditContactAssigningNonsenseValues(ContactCreator.FirstContact);
     AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should.");
     AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact fields have not the expected values after the edit.");
 }
コード例 #8
0
 public void Duplicate_Contact_Indicator()
 {
     ContactCreator.CreateSimpleContact();
     LeftSideMenu.GoToContacts();
     NewContactPage.GoTo();
     NewContactPage.SetFirstName(ContactCreator.FirstContact.FirstName);
     NewContactPage.SetLastName(ContactCreator.FirstContact.LastName);
     AssertThat.IsTrue(NewContactPage.IsPossibleDuplicateAlertShown,
                       "There should be an alert at the top of the page that informs for the possibility of a duplicate contact");
 }
コード例 #9
0
        public void Edit_Contact_From_Within_Organization_Contact_List()
        {
            ContactCreator.CreateSimpleContact();
            OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open();
            OrganizationViewPage.FindContactFromOrganizationContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open();

            ContactCreator.EditSimpleContactWithOrganization(ContactCreator.FirstContact);
            AssertThat.IsTrue(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was not saved after edit but, it should.");
            AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact fields have not the expected values after the edit.");
        }
コード例 #10
0
        public void Remove_Contact_From_Organization_Contact_List()
        {
            ContactCreator.CreateSimpleContact();
            OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open();
            OrganizationViewPage.FindContactFromOrganizationContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Remove();

            OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open();
            AssertThat.IsFalse(
                OrganizationViewPage.
                FindContactFromOrganizationContactList()
                .WithFirstName(ContactCreator.FirstContact.FirstName)
                .AndLastName(ContactCreator.FirstContact.LastName)
                .Find(),
                $"Contact {ContactCreator.FirstContact.FullName} was supposed to be removed but is still a contact of organization {ContactCreator.FirstContact.OrganizationName}."
                );
        }
コード例 #11
0
        public void Make_A_Contact_Favorite()
        {
            ContactCreator.CreateSimpleContact();
            ContactViewPage.SetContactFavorite(false);
            AssertThat.IsFalse(ContactViewPage.IsContactFavorite, "Contact should have been set as un-favorite, but it is still favorite");

            LeftSideMenu.GoToContacts();
            ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).CheckFavorite();
            ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open();

            AssertThat.IsTrue(ContactViewPage.IsContactFavorite, "Contact should have been set as favorite, but it is still un-favorite");

            ContactViewPage.SetContactFavorite(false);

            LeftSideMenu.GoToContacts();
            ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open();
            AssertThat.IsFalse(ContactViewPage.IsContactFavorite, "Contact should have been set as favorite, but it is still un-favorite");
        }
コード例 #12
0
ファイル: SmokeTests.cs プロジェクト: pithas93/PobucaTests
 public void Can_Create_A_Simple_Contact()
 {
     ContactCreator.CreateSimpleContact();
     AssertThat.IsTrue(ContactCreator.FirstContact.IsContactCreatedSuccessfully, "Contact was not created successfully but it should");
     AssertThat.IsTrue(ContactCreator.FirstContact.AreContactFieldValuesSavedCorrectly, "Contact field values where not saved correctly");
 }
コード例 #13
0
 public void Cannot_Save_Contact_After_Assigning_OverFlown_Field_Values()
 {
     ContactCreator.CreateSimpleContact();
     ContactCreator.EditContactAssigningOverflowValues(ContactCreator.FirstContact);
     AssertThat.IsFalse(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was saved after edit but, it has values in first and last name that exceed the 50 character limit.");
 }
コード例 #14
0
 public void Cannot_Save_Contact_After_Leaving_Mandatory_Fields_Empty()
 {
     ContactCreator.CreateSimpleContact();
     ContactCreator.EditContactRemovingLastName(ContactCreator.FirstContact);
     AssertThat.IsFalse(ContactCreator.FirstContact.IsContactSavedAfterEdit, "Contact was saved after edit, without last name which is mandatory.");
 }