Ejemplo n.º 1
0
        public void DragDropFileToFileTest()
        {
            using (var app = new PythonVisualStudioApp()) {
                app.OpenProject(@"TestData\DragDropTest.sln");

                app.OpenSolutionExplorer();
                var window = app.SolutionExplorerTreeView;

                var folder = window.FindItem("Solution 'DragDropTest' (1 project)", "DragDropTest", "TestFolder", "SubItem2.py");
                var point  = folder.GetClickablePoint();
                Mouse.MoveTo(point);
                Mouse.Down(MouseButton.Left);

                var project = window.FindItem("Solution 'DragDropTest' (1 project)", "DragDropTest", "TestFolder", "SubItem3.py");
                point = project.GetClickablePoint();
                Mouse.MoveTo(point);
                Mouse.Up(MouseButton.Left);

                Assert.IsNotNull(window.WaitForItem("Solution 'DragDropTest' (1 project)", "DragDropTest", "TestFolder", "SubItem2.py"));
                Assert.IsNotNull(window.WaitForItem("Solution 'DragDropTest' (1 project)", "DragDropTest", "TestFolder", "SubItem3.py"));
            }
        }
Ejemplo n.º 2
0
        public void DragDropTest()
        {
            using (var app = new VisualStudioApp()) {
                app.OpenProject(@"TestData\NodejsProjectData\DragDropTest.sln");

                using (new NodejsOptionHolder(NodejsPackage.Instance.GeneralOptionsPage, "ShowBrowserAndNodeLabels", false)) {
                    var window = app.OpenSolutionExplorer();

                    var folder = window.WaitForItem("Solution 'DragDropTest' (1 project)", "DragDropTest", "TestFolder", "SubItem.js");
                    var point  = folder.GetClickablePoint();
                    Mouse.MoveTo(point);
                    Mouse.Down(MouseButton.Left);

                    var project = window.FindItem("Solution 'DragDropTest' (1 project)", "DragDropTest");
                    point = project.GetClickablePoint();
                    Mouse.MoveTo(point);
                    Mouse.Up(MouseButton.Left);

                    Assert.AreNotEqual(null, window.WaitForItem("Solution 'DragDropTest' (1 project)", "DragDropTest", "SubItem.js"));
                }
            }
        }
Ejemplo n.º 3
0
        public void DragLeaveFolderTest()
        {
            using (var app = new PythonVisualStudioApp()) {
                var project = app.OpenProject(@"TestData\DragDropTest.sln");
                var window  = app.OpenSolutionExplorer();

                // click on SubItem.py
                var point = window.FindChildOfProject(project, "TestFolder2", "SubFolder").Element.GetClickablePoint();
                Mouse.MoveTo(point);
                Mouse.Down(MouseButton.Left);

                // move to project and hover
                Mouse.MoveTo(window.FindChildOfProject(project).Element.GetClickablePoint());
                System.Threading.Thread.Sleep(500);

                // move back and release
                Mouse.MoveTo(point);
                Mouse.Up(MouseButton.Left);

                window.WaitForChildOfProject(project, "TestFolder2", "SubFolder");
            }
        }
Ejemplo n.º 4
0
        public void DjangoMultiSelectContextMenu()
        {
            using (var app = new PythonVisualStudioApp()) {
                app.OpenProject(@"TestData\DjangoApplication.sln");

                app.OpenSolutionExplorer();
                var window = app.SolutionExplorerTreeView;

                var manageNode = window.FindItem("Solution 'DjangoApplication' (1 project)", "DjangoApplication", "manage.py");
                Mouse.MoveTo(manageNode.GetClickablePoint());
                Mouse.Click(MouseButton.Left);

                Keyboard.Press(Key.LeftShift);
                Keyboard.PressAndRelease(Key.Down);
                Keyboard.Release(Key.LeftShift);

                Mouse.MoveTo(manageNode.GetClickablePoint());
                Mouse.Click(MouseButton.Right);

                Keyboard.Type("j"); // Exclude from Project
                Assert.IsNull(window.WaitForItemRemoved("Solution 'DjangoApplication' (1 project)", "DjangoApplication", "manage.py"));
            }
        }
Ejemplo n.º 5
0
        public void DragDropRelocatedTest(VisualStudioApp app)
        {
            var sln    = app.CopyProjectForTest(@"TestData\DragDropRelocatedTest.sln");
            var slnDir = PathUtils.GetParent(sln);

            FileUtils.CopyDirectory(TestData.GetPath("TestData", "DragDropRelocatedTest"), Path.Combine(slnDir, "DragDropRelocatedTest"));
            app.OpenProject(sln);

            app.OpenSolutionExplorer();
            var window = app.SolutionExplorerTreeView;

            var folder = window.FindItem("Solution 'DragDropRelocatedTest' (1 project)", "DragDropTest", "TestFolder", "SubItem.py");
            var point  = folder.GetClickablePoint();

            Mouse.MoveTo(point);
            Mouse.Down(MouseButton.Left);

            var projectItem = window.FindItem("Solution 'DragDropRelocatedTest' (1 project)", "DragDropTest");

            point = projectItem.GetClickablePoint();
            Mouse.MoveTo(point);
            Mouse.Up(MouseButton.Left);

            using (var dlg = AutomationDialog.WaitForDialog(app)) {
                dlg.OK();
            }
            Assert.IsNotNull(window.WaitForItem("Solution 'DragDropRelocatedTest' (1 project)", "DragDropTest", "SubItem.py"));

            app.Dte.Solution.Close(true);
            // Ensure file was moved and the path was updated correctly.
            var project = app.OpenProject(sln);

            foreach (var item in project.ProjectItems.OfType <OAFileItem>())
            {
                Assert.IsTrue(File.Exists((string)item.Properties.Item("FullPath").Value), (string)item.Properties.Item("FullPath").Value);
            }
        }