public async Task GoToParentDirectoryTest()
    {
        var window = AvaloniaApp.GetMainWindow();
        await FocusFilePanelStep.FocusFilePanelAsync(window);

        CreateNewTabStep.CreateNewTab(window);
        var filesPanelViewModel = ActiveFilePanelProvider.GetActiveFilePanelViewModel(window);
        var currentDirectory    = filesPanelViewModel.CurrentDirectory;

        GoToParentDirectoryStep.GoToParentDirectoryViaFilePanel(window);

        var isParentDirectoryOpened = await DirectoryOpenedCondition.CheckIfParentDirectoryIsOpenedAsync(window, currentDirectory);

        Assert.True(isParentDirectoryOpened);
    }
示例#2
0
    public async Task GoToParentDirectoryAndBackTest()
    {
        var window = AvaloniaApp.GetMainWindow();

        await FocusFilePanelStep.FocusFilePanelAsync(window);

        CreateNewTabStep.CreateNewTab(window);
        var viewModel = ActiveFilePanelProvider.GetActiveFilePanelViewModel(window);

        _directoryFullPath = viewModel.CurrentDirectory;

        for (var i = 0; i < 10; i++)
        {
            GoToPreviousDirectoryStep.GoToPreviousDirectory(window);
            var isCurrentDirectoryStillOpened = await DirectoryOpenedCondition.CheckIfDirectoryIsOpenedAsync(window, _directoryFullPath);

            Assert.True(isCurrentDirectoryStillOpened);
        }

        GoToParentDirectoryStep.GoToParentDirectoryViaFilePanel(window);
        var isParentDirectoryOpened = await DirectoryOpenedCondition.CheckIfParentDirectoryIsOpenedAsync(window, _directoryFullPath);

        Assert.True(isParentDirectoryOpened);

        GoToPreviousDirectoryStep.GoToPreviousDirectory(window);
        var isChildDirectoryOpened = await DirectoryOpenedCondition.CheckIfDirectoryIsOpenedAsync(window, _directoryFullPath);

        Assert.True(isChildDirectoryOpened);

        for (var i = 0; i < 10; i++)
        {
            GoToNextDirectoryStep.GoToNextDirectory(window);
            var parentDirectoryWasReopened = await DirectoryOpenedCondition.CheckIfParentDirectoryIsOpenedAsync(window,
                                                                                                                _directoryFullPath);

            Assert.True(parentDirectoryWasReopened);
        }

        for (var i = 0; i < 10; i++)
        {
            GoToPreviousDirectoryStep.GoToPreviousDirectory(window);
            var isCurrentDirectoryStillOpened = await DirectoryOpenedCondition.CheckIfDirectoryIsOpenedAsync(window, _directoryFullPath);

            Assert.True(isCurrentDirectoryStillOpened);
        }
    }