Current filter:
                                You should refresh the page.
                                  • I've tried implementing How to write EasyTests in code . But the solution provided is in DevExpressVesrion 10.2.6 and I tried it in 18.2.3 and therefore it produced some errors.

                                    I'm attaching the upgraded project with this. Please have a look at the Utils folder in the  EasyTest.Tests  project for the following files

                                    1. TestWebAdapter

                                    2. WinEasyTestFixtureHelperBase

                                    3. WebEasyTestFixtureHelperBase

                                    There are constructor issues and some other problems too.

                                    Please have a look. Thank you.

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Mali,

                                The API you are using is private and not documented. The following is how you can resolve the issue with the current version. However, it's not guaranteed that this API won't be changed in the future.

                                1.

                                EasyTestViaNUnits\TestApplication.Web\Dialog.aspx.cs(6,48,6,73): error CS0535: 'DialogPage' does not implement interface member 'ILookupPopupFrameTemplate.FocusFindEditor()'
                                EasyTestViaNUnits\EasyTestViaNUnits\TestApplication.Web\NestedFrameControl.ascx.cs(10,86,10,118): error CS0535: 'NestedFrameControl' does not implement interface member 'ISupportActionsToolbarVisibility.SetVisible(bool)'

                                These are common C# errors. Now, the ILookupPopupFrameTemplate interface has the FocusFindEditor method and your DialogPage class should implement it. The ISupportActionsToolbarVisibility.ShowActionsToolBar property has been replaced with the SetVisible method and your NestedFrameControl class should also implement it.

                                2.

                                EasyTestViaNUnits\TestApplication.Web\DefaultVertical.aspx.cs(29,41,29,60): error CS0115: 'DefaultVertical.GetDefaultContainer()': no suitable method found to override
                                EasyTestViaNUnits\TestApplication.Web\Default.aspx.cs(21,38,21,57): error CS0115: 'Default.GetDefaultContainer()': no suitable method found to override

                                There is no GetDefaultContainer method in the BaseXafPage class now. The View action container is used by default. You don't need to override this method.

                                3.

                                EasyTestViaNUnits\TestApplication.Web\Login.aspx.cs(8,27,8,46): error CS1061: 'WebApplication' does not contain a definition for 'CreateLogonControls' and no accessible extension method 'CreateLogonControls' accepting a first argument of type 'WebApplication' could be found (are you missing a using directive or an assembly reference?)

                                There is not this method now. Use the following code instead:

                                [C#]
                                protected void Page_Load(object sender, EventArgs e) { WebApplication.CurrentRequestTemplateType = TemplateType.Logon; WebApplication.Instance.CreateControls(this); WebApplication.CurrentRequestTemplateType = TemplateType.Horizontal; }
                                4.

                                EasyTestViaNUnits\TestApplication.Web\Global.asax.cs(30,28,30,42): error CS0117: 'WebApplication' does not contain a definition for 'OldStyleLayout'
                                EasyTestViaNUnits\TestApplication.Web\Error.aspx.cs(71,13,71,32): error CS0117: 'WebWindow' does not contain a definition for 'PatchIEForPNGImages'

                                These methods are removed. Comment out these lines.

                                5.

                                EasyTestViaNUnits\TestApplication.Web\Error.aspx.cs(24,20,24,38): error CS1061: 'AboutInfo' does not contain a definition for 'GetAboutInfoString' and no accessible extension method 'GetAboutInfoString' accepting a first argument of type 'AboutInfo' could be found (are you missing a using directive or an assembly
                                reference?)
                                EasyTestViaNUnits\TestApplication.Web\Error.aspx.cs(23,29,23,38): error CS1729: 'AboutInfo' does not contain a constructor that takes 1 arguments

                                The AboutInfo class was changed. Use the following code now.

                                [C#]
                                private string GetApplicationInfoString() { AboutInfo aboutInfo = new AboutInfo(); aboutInfo.Init(WebApplication.Instance); return aboutInfo.AboutInfoString; }
                                6.

                                EasyTestViaNUnits\EasyTest.Tests\Utils\WebEasyTestFixtureHelperBase.cs(32,30,32,41): error CS1061: 'TestWebAdapter' does not contain a definition for 'WebBrowsers' and no accessible extension method 'WebBrowsers' accepting a first argument of type 'TestWebAdapter' could be found (are you missing a using directive or an assembly reference?)
                                EasyTestViaNUnits\EasyTest.Tests\Utils\WebEasyTestFixtureHelperBase.cs(33,28,33,39): error CS1061: 'TestWebAdapter' does not contain a definition for 'WebBrowsers' and no accessible extension method 'WebBrowsers' accepting a first argument of type 'TestWebAdapter' could be found (are you missing a using directive or an assembly reference?)
                                EasyTestViaNUnits\EasyTest.Tests\Utils\WebEasyTestFixtureHelperBase.cs(36,24,36,35): error CS1061: 'TestWebAdapter' does not contain a definition for 'WebBrowsers' and no accessible extension method 'WebBrowsers' accepting a first argument of type 'TestWebAdapter' could be found (are you missing a using directive or an assembly reference?)
                                EasyTestViaNUnits\EasyTest.Tests\Utils\WebEasyTestFixtureHelperBase.cs(39,24,39,35): error CS1061: 'TestWebAdapter' does not contain a definition for 'WebBrowsers' and no accessible extension method 'WebBrowsers' accepting a first argument of type 'TestWebAdapter' could be found (are you missing a using directive or an assembly reference?)

                                Now, it's just WebBrowser.

                                [C#]
                                public virtual void TearDown() { string urlParams = GetUrlOptions(); webAdapter.WebBrowser.Navigate(testWebApplicationRootUrl + urlParams + (urlParams.Contains("?") ? "&" : "?") + "Reset=true"); webAdapter.WebBrowser.Close(); } public virtual void TearDownFixture() { webAdapter.KillApplication(application, KillApplicationContext.TestAborted); }
                                7.

                                EasyTestViaNUnits\EasyTest.Tests\Utils\WebEasyTestFixtureHelperBase.cs(25,24,25,38): error CS7036: There is no argument given that corresponds to the required formal parameter 'connectionString' of 'WebAdapter.RunApplication(TestApplication, string)'
                                EasyTestViaNUnits\EasyTest.Tests\Utils\WinEasyTestFixtureHelperBase.cs(24,32,24,46): error CS1501: No overload for method 'RunApplication' takes 1 arguments

                                The RunApplication method needs the second parameter that is your connection string.

                                WinEasyTestFixtureHelperBase.SetUp:

                                [C#]
                                public void SetUp() { applicationAdapter = new WinAdapter(); applicationAdapter.RunApplication(application, InMemoryDataStoreProvider.ConnectionString); adapter = ((IApplicationAdapter)applicationAdapter).CreateCommandAdapter(); commandAdapter = new TestCommandAdapter(adapter); }

                                WebEasyTestFixtureHelperBase.SetupFixture:

                                [C#]
                                public virtual void SetupFixture() { webAdapter = new TestWebAdapter(); webAdapter.RunApplication(application, InMemoryDataStoreProvider.ConnectionString); }
                                8.

                                EasyTestViaNUnits\EasyTest.Tests\Utils\WinEasyTestFixtureHelperBase.cs(20,31,20,46): error CS1729: 'TestApplication' does not contain a constructor that takes 4 arguments
                                EasyTestViaNUnits\EasyTest.Tests\Utils\WinEasyTestFixtureHelperBase.cs(21,25,21,33): error CS1061: 'TestApplication' does not contain a definition for 'AddParam' and no accessible extension method 'AddParam' accepting a first argument of type 'TestApplication' could be found (are you missing a using directive or an assembly reference?)
                                EasyTestViaNUnits\EasyTest.Tests\Utils\WebEasyTestFixtureHelperBase.cs(18,31,18,46): error CS1729: 'TestApplication' does not contain a constructor that takes 4 arguments
                                EasyTestViaNUnits\EasyTest.Tests\Utils\WebEasyTestFixtureHelperBase.cs(19,25,19,33): error CS1061: 'TestApplication' does not contain a definition for 'AddParam' and no accessible extension method 'AddParam' accepting a first argument of type 'TestApplication' could be found (are you missing a using directive or an assembly reference?)

                                The TestApplication class constructor does not have parameters now. All parameters are passed via the AdditionalAttributes property.

                                WinEasyTestFixtureHelperBase.SetupFixture:

                                [C#]
                                public void SetupFixture() { application = new TestApplication(); List<XmlAttribute> additionalAttributes = new List<XmlAttribute>(); XmlDocument doc = new XmlDocument(); XmlAttribute entry = doc.CreateAttribute("FileName"); entry.Value = Path.GetFullPath(Path.Combine(@"..\..\..\" + applicationDirectoryName, @"Bin\EasyTest\" + applicationName)); additionalAttributes.Add(entry); entry = doc.CreateAttribute("CommunicationPort"); entry.Value = "4100"; additionalAttributes.Add(entry); application.AdditionalAttributes = additionalAttributes.ToArray(); }

                                WebEasyTestFixtureHelperBase.WebEasyTestFixtureHelperBase:

                                [C#]
                                public WebEasyTestFixtureHelperBase(string relativePathToWebApplication, string absolutePathToWebApplication) { string testApplicationDir = Path.Combine(Assembly.GetExecutingAssembly().Location, relativePathToWebApplication); if (!Directory.Exists(testApplicationDir)) testApplicationDir = absolutePathToWebApplication; application = new TestApplication(); List<XmlAttribute> additionalAttributes = new List<XmlAttribute>(); XmlDocument doc = new XmlDocument(); XmlAttribute entry = doc.CreateAttribute("PhysicalPath"); entry.Value = testApplicationDir; additionalAttributes.Add(entry); entry = doc.CreateAttribute("URL"); entry.Value = testWebApplicationRootUrl + GetUrlOptions(); additionalAttributes.Add(entry); entry = doc.CreateAttribute("SingleWebDev"); entry.Value = true.ToString(); additionalAttributes.Add(entry); application.AdditionalAttributes = additionalAttributes.ToArray(); }
                                9.

                                EasyTestViaNUnits\EasyTest.Tests\Utils\TestWebAdapter.cs(6,33,6,43): error CS0115: 'TestWebAdapter.RestartIIS()': no suitable method found to override

                                The RestartIIS method is private now. To prevent this method from being called, pass the DontRestartIIS parameter to the application again using the AdditionalAttributes properties.

                                [C#]
                                XmlAttribute entry = doc.CreateAttribute("DontRestartIIS"); entry.Value = true; additionalAttributes.Add(entry);

                                Please let me know if you have further difficulties.

                                • Manuel Grundner [DevExpress MVP] 08.08.2019

                                  @mali: For a working solution read my blog post on this topic.