public void Edit()
        {
            var person = new People(this.Session).Extent().First;

            var allors        = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var firstEmployee = allors.ActiveEmployees.First();

            var before = new PhoneCommunications(this.Session).Extent().ToArray();

            this.people.Table.DefaultAction(person);
            var personOverview = new PersonOverviewComponent(this.people.Driver);

            var communicationEventOverview = personOverview.CommunicationeventOverviewPanel.Click();

            communicationEventOverview.Table.DefaultAction(this.editCommunicationEvent);

            var phoneCommunicationEditComponent = new PhoneCommunicationEditComponent(this.Driver);

            phoneCommunicationEditComponent
            .LeftVoiceMail.Set(false)
            .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed)
            .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry)
            .FromPhoneNumber.Select(this.anotherPhoneNumber.ContactMechanism)
            .Subject.Set("new subject")
            .FromParty.Select(firstEmployee)
            .ToParty.Select(person)
            .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24))
            .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 25))
            .Comment.Set("new comment")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PhoneCommunications(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            Assert.False(this.editCommunicationEvent.LeftVoiceMail);
            Assert.Equal(new CommunicationEventStates(this.Session).Completed, this.editCommunicationEvent.CommunicationEventState);
            Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, this.editCommunicationEvent.EventPurposes);
            Assert.Equal(firstEmployee, this.editCommunicationEvent.FromParty);
            Assert.Equal(person, this.editCommunicationEvent.ToParty);
            Assert.Equal(this.anotherPhoneNumber.ContactMechanism, this.editCommunicationEvent.PhoneNumber);
            Assert.Equal("new subject", this.editCommunicationEvent.Subject);
            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledStart);
            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledEnd.Value.Date);
            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualStart.Value.Date);
            // Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualEnd.Value.Date);
            Assert.Equal("new comment", this.editCommunicationEvent.Comment);
        }
Ejemplo n.º 2
0
        public void Create()
        {
            var allors   = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var employee = allors.ActiveEmployees.First;

            var before = new PhoneCommunications(this.Session).Extent().ToArray();

            var extent       = new Organisations(this.Session).Extent();
            var organisation = extent.First(v => v.PartyName.Equals("Acme0"));
            var contact      = organisation.CurrentContacts.First(v => v.FirstName.Equals("Jane0"));

            var organisationOverviewPage = this.organisations.Select(organisation);
            var page = organisationOverviewPage.NewPhoneCommunication();

            page.LeftVoiceMail.Set(true)
            .EventState.Set(new CommunicationEventStates(this.Session).Completed.Name)
            .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry.Name)
            .Subject.Set("subject")
            .FromParty.Set(contact.PartyName)
            .ToParty.Set(employee.PartyName)
            .PhoneNumber.Set("+1 123 456")
            .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .Comment.Set("comment")
            .Save.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PhoneCommunications(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var communicationEvent = after.Except(before).First();

            Assert.True(communicationEvent.LeftVoiceMail);
            Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState);
            Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, communicationEvent.EventPurposes);
            Assert.Equal(contact, communicationEvent.FromParty);
            Assert.Equal(employee, communicationEvent.ToParty);
            Assert.Equal(contact.GeneralPhoneNumber, communicationEvent.PhoneNumber);
            Assert.Equal("subject", communicationEvent.Subject);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date);
            Assert.Equal("comment", communicationEvent.Comment);
        }
        public void Create()
        {
            var allors   = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var employee = allors.ActiveEmployees.First;

            var before = new PhoneCommunications(this.Session).Extent().ToArray();

            var person = new People(this.Session).Extent().First;

            this.people.Table.DefaultAction(person);
            var communicationEventOverview = new PersonOverviewComponent(this.people.Driver).CommunicationeventOverviewPanel.Click();

            communicationEventOverview
            .CreatePhoneCommunication()
            .LeftVoiceMail.Set(true)
            .CommunicationEventState.Select(new CommunicationEventStates(this.Session).Completed)
            .EventPurposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry)
            .Subject.Set("subject")
            .FromParty.Select(person)
            .ToParty.Select(employee)
            .FromPhoneNumber.Select(person.GeneralPhoneNumber)
            .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 22))
            .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .Comment.Set("comment")
            .SAVE.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PhoneCommunications(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length + 1);

            var communicationEvent = after.Except(before).First();

            Assert.True(communicationEvent.LeftVoiceMail);
            Assert.Equal(new CommunicationEventStates(this.Session).Completed, communicationEvent.CommunicationEventState);
            Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, communicationEvent.EventPurposes);
            Assert.Equal(person, communicationEvent.FromParty);
            Assert.Equal(employee, communicationEvent.ToParty);
            Assert.Equal(person.GeneralPhoneNumber, communicationEvent.PhoneNumber);
            Assert.Equal("subject", communicationEvent.Subject);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledStart.Value.ToUniversalTime().Date);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 22).Date, communicationEvent.ScheduledEnd.Value.Date.ToUniversalTime().Date);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualStart.Value.Date.ToUniversalTime().Date);
            Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 23).Date, communicationEvent.ActualEnd.Value.Date.ToUniversalTime().Date);
            Assert.Equal("comment", communicationEvent.Comment);
        }
Ejemplo n.º 4
0
        public void Edit()
        {
            var extent       = new Organisations(this.Session).Extent();
            var organisation = extent.First(v => v.PartyName.Equals("Acme0"));

            var allors        = new Organisations(this.Session).FindBy(M.Organisation.Name, "Allors BVBA");
            var firstEmployee = allors.ActiveEmployees.First(v => v.FirstName.Equals("first"));

            var before = new PhoneCommunications(this.Session).Extent().ToArray();

            var personOverview = this.organisations.Select(organisation);

            var page = personOverview.SelectPhoneCommunication(this.editCommunicationEvent);

            page.LeftVoiceMail.Set(false)
            .EventState.Set(new CommunicationEventStates(this.Session).Completed.Name)
            .Purposes.Toggle(new CommunicationEventPurposes(this.Session).Inquiry.Name)
            .FromParty.Set(organisation.PartyName)
            .ToParty.Set(firstEmployee.PartyName)
            .PhoneNumber.Set("+1 111 222")
            .Subject.Set("new subject")
            .ScheduledStart.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .ScheduledEnd.Set(DateTimeFactory.CreateDate(2018, 12, 23))
            .ActualStart.Set(DateTimeFactory.CreateDate(2018, 12, 24))
            .ActualEnd.Set(DateTimeFactory.CreateDate(2018, 12, 25))
            .Comment.Set("new comment")
            .Save.Click();

            this.Driver.WaitForAngular();
            this.Session.Rollback();

            var after = new PhoneCommunications(this.Session).Extent().ToArray();

            Assert.Equal(after.Length, before.Length);

            Assert.False(this.editCommunicationEvent.LeftVoiceMail);
            Assert.Equal(new CommunicationEventStates(this.Session).Completed, this.editCommunicationEvent.CommunicationEventState);
            Assert.Contains(new CommunicationEventPurposes(this.Session).Inquiry, this.editCommunicationEvent.EventPurposes);
            Assert.Equal(organisation, this.editCommunicationEvent.FromParty);
            Assert.Equal(firstEmployee, this.editCommunicationEvent.ToParty);
            Assert.Equal(this.organisationPhoneNumber.ContactMechanism, this.editCommunicationEvent.PhoneNumber);
            Assert.Equal("new subject", this.editCommunicationEvent.Subject);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledStart);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ScheduledEnd.Value.Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualStart.Value.Date);
            //Assert.Equal(DateTimeFactory.CreateDate(2018, 12, 24).Date, communicationEvent.ActualEnd.Value.Date);
            Assert.Equal("new comment", this.editCommunicationEvent.Comment);
        }