public static async Task TestOfficeCloudService(this ICommandAdapter commandAdapter, string serviceName)
        {
            commandAdapter.Execute(new NavigateCommand($"Cloud.{serviceName} Event"));
            var cloudCalendarOperation = "Cloud Calendar Operation";

            commandAdapter.Execute(new ActionCommand(cloudCalendarOperation, "New"), new WaitCommand(2500));
            await commandAdapter.Execute(() => {
                commandAdapter.Execute(new ActionCommand(Actions.Refresh));
                var checkListViewCommand = new CheckListViewCommand("Subject");
                checkListViewCommand.AddRows(new[] { $"{serviceName}-Cloud" });
                commandAdapter.Execute(checkListViewCommand);
            });

            commandAdapter.Execute(new ActionCommand(cloudCalendarOperation, "Update"), new WaitCommand(2500));
            await commandAdapter.Execute(() => {
                commandAdapter.Execute(new ActionCommand(Actions.Refresh));
                var checkListViewCommand = new CheckListViewCommand("Subject");
                checkListViewCommand.AddRows(new[] { $"{serviceName}-Cloud-Updated" });
                commandAdapter.Execute(checkListViewCommand);
            });

            commandAdapter.Execute(new ActionCommand(cloudCalendarOperation, "Delete"), new WaitCommand(2500));
            await commandAdapter.Execute(() => {
                commandAdapter.Execute(new ActionCommand(Actions.Refresh));
                commandAdapter.Execute(new CheckListViewCommand("", 0));
            });
        }
        public static async Task TestExecuteActionJob(this ICommandAdapter adapter)
        {
            adapter.Execute(new NavigateCommand("Default.Product"));
            adapter.Execute(new SelectObjectsCommand <Product>(product => product.ProductName, new [] { "ProductName0", "ProductName1" }));
            adapter.Execute(new ActionDeleteCommand());
            adapter.Execute(new ActionCommand(Actions.New));
            adapter.Execute(new FillObjectViewCommand <Product>((product => product.ProductName, "deleteme")));
            adapter.Execute(new ActionCommand(Actions.Save));

            adapter.Execute(new NavigateCommand("JobScheduler.Job"));
            adapter.Execute(new ActionCommand("New", nameof(ExecuteActionJob)));
            adapter.Execute(new FillObjectViewCommand <ExecuteActionJob>((job => job.Action, "Delete"),
                                                                         (job => job.Object, nameof(Product)), (job => job.View, $"{nameof(Product)}_ListView"),
                                                                         (job => job.Id, "executeDelete")));
            adapter.Execute(new FillObjectViewCommand <ExecuteActionJob>((job => job.SelectedObjectsCriteria,
                                                                          $"{nameof(Product.ProductName)}='deleteme'")));
            adapter.Execute(new ActionCommand(Actions.Save));
            adapter.Execute(new ActionCommand("Trigger"));
            adapter.Execute(new NavigateCommand("Default.Product"));

            await adapter.Execute(() => {
                adapter.Execute(new ActionCommand(Actions.Refresh));
                var checkListViewCommand = new CheckListViewCommand(nameof(Product.ProductName));
                checkListViewCommand.AddRows(new [] { "deleteme" });
                checkListViewCommand.ExpectException = true;
                adapter.Execute(checkListViewCommand);
            });
        }
Пример #3
0
        private static CheckListViewCommand CheckListViewCommand(int rowCount)
        {
            var checkListViewCommand = new CheckListViewCommand(nameof(Order.Product), nameof(Order.Accessory));

            checkListViewCommand.AddRows(Enumerable.Range(0, rowCount)
                                         .Select(i => new[] { $"{nameof(Product.ProductName)}{i}", $"{nameof(Accessory.AccessoryName)}{i}" }).ToArray());
            return(checkListViewCommand);
        }
Пример #4
0
        private static void CheckMoveUp(this ICommandAdapter adapter)
        {
            adapter.Execute(new ActionAvailableCommand(GetActionName(nameof(SwapPositionInListViewService.MoveObjectDown)))
            {
                ExpectException = true
            });
            adapter.Execute(new ActionCommand(GetActionName(nameof(SwapPositionInListViewService.MoveObjectUp))));
            adapter.Execute(new ActionCommand(GetActionName(nameof(SwapPositionInListViewService.MoveObjectUp))));
            adapter.Execute(new ActionAvailableCommand(GetActionName(nameof(SwapPositionInListViewService.MoveObjectDown))));
            adapter.Execute(new ActionAvailableCommand(GetActionName(nameof(SwapPositionInListViewService.MoveObjectUp)))
            {
                ExpectException = true
            });
            var checkListViewCommand = new CheckListViewCommand("Name", "IdVisible");

            checkListViewCommand.AddRows(true, new[] { "three", "1" });
            adapter.Execute(checkListViewCommand);
        }
        public static void TestBulkObjectUpdate(this ICommandAdapter adapter)
        {
            adapter.Execute(new NavigateCommand("Default.TestTask"));
            adapter.Execute(new ActionCommand(Actions.New));
            adapter.Execute(new FillObjectViewCommand <Task>((task => task.Subject, "1")));
            adapter.Execute(new ActionCommand(Actions.SaveAndClose));
            adapter.Execute(new ActionCommand(Actions.New));
            adapter.Execute(new FillObjectViewCommand <Task>((task => task.Subject, "2")));
            adapter.Execute(new ActionCommand(Actions.SaveAndClose));
            adapter.Execute(new SelectObjectsCommand(nameof(Task.Subject), new[] { "1", "2" }));
            adapter.Execute(
                new ActionCommand(nameof(Xpand.XAF.Modules.BulkObjectUpdate.BulkObjectUpdateService.BulkUpdate)));
            adapter.Execute(new FillObjectViewCommand <Task>((task => task.Status, nameof(TaskStatus.Deferred))));
            adapter.Execute(new ActionCommand(Actions.OK));
            adapter.Execute(new NavigateCommand("Default.User"));
            adapter.Execute(new NavigateCommand("Default.TestTask"));
            var checkListViewCommand = new CheckListViewCommand(new[] { nameof(Task.Subject), nameof(Task.Status) });

            checkListViewCommand.AddRows(new[] { "1", nameof(TaskStatus.Deferred) });
            checkListViewCommand.AddRows(true, new[] { "2", nameof(TaskStatus.Deferred) });
            adapter.Execute(checkListViewCommand);
            adapter.Execute(new SelectObjectsCommand(nameof(Task.Subject), new[] { "1", "2" }));
            adapter.Execute(new ActionDeleteObjectsCommand());
        }