diff --git a/SeleniumUiTests/.runsettings b/SeleniumUiTests/.runsettings deleted file mode 100644 index ed9f58f7..00000000 --- a/SeleniumUiTests/.runsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/SeleniumUiTests/EmployeesUiTests.cs b/SeleniumUiTests/EmployeesUiTests.cs deleted file mode 100644 index ed26cc92..00000000 --- a/SeleniumUiTests/EmployeesUiTests.cs +++ /dev/null @@ -1,80 +0,0 @@ - -using System; -using System.Drawing.Imaging; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; -using OpenQA.Selenium.Firefox; -using OpenQA.Selenium.IE; -using OpenQA.Selenium.Remote; -using OpenQA.Selenium.PhantomJS; - -namespace SeleniumUiTests -{ - [TestClass] - public class EmployeesUiTests - { - private string _websiteURL = "https://ignite-webapp-test-997.azurewebsites.net/"; - private RemoteWebDriver _browserDriver; - public TestContext TestContext { get; set; } - - [TestInitialize()] - public void PU_SearchTests_Initialize() - { - _websiteURL = (string) TestContext.Properties["webAppUrl"]; - } - - [TestMethod] - [TestCategory("Selenium")] - [DataRow("Adam John", "Marketing", "adam.john@email.com", "2423282992", "74 Avenue Tunis")] - [DataRow("Myriam Doe", "Sales", "myriam.doe@email.com", "2487678679", "89 Avenue Beja")] - [DataRow("Sam Yasser", "Engineering", "sam.yasser@email.com", "9627656254", "9 Rue Tabarka")] - public void CreateEmployee(string fullname, string department, string email, string phone, string address) - { - // Arrange - _browserDriver = new ChromeDriver(); - _browserDriver.Manage().Window.Maximize(); - _browserDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20)); - _browserDriver.Navigate().GoToUrl(_websiteURL + "Employees/Create"); - _browserDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20)); - - _browserDriver.FindElementById("Fullname").Clear(); - _browserDriver.FindElementById("Fullname").SendKeys(fullname); - - _browserDriver.FindElementById("Department").Clear(); - _browserDriver.FindElementById("Department").SendKeys(department); - - _browserDriver.FindElementById("Email").Clear(); - _browserDriver.FindElementById("Email").SendKeys(email); - - _browserDriver.FindElementById("Phone").Clear(); - _browserDriver.FindElementById("Phone").SendKeys(phone); - - _browserDriver.FindElementById("Address").Clear(); - _browserDriver.FindElementById("Address").SendKeys(address); - - var screenshot = _browserDriver.GetScreenshot(); - var fileName = $"{fullname}.jpg"; - screenshot.SaveAsFile(fileName, ImageFormat.Jpeg); - TestContext.AddResultFile(fileName); - - // Act - _browserDriver.FindElement(By.CssSelector("input.btn.btn-default")).Click(); - - // Assert - Assert.IsTrue(_browserDriver.PageSource.Contains(fullname)); - Assert.IsTrue(_browserDriver.PageSource.Contains(department)); - Assert.IsTrue(_browserDriver.PageSource.Contains(email)); - Assert.IsTrue(_browserDriver.PageSource.Contains(phone)); - Assert.IsTrue(_browserDriver.PageSource.Contains(address)); - } - - [TestCleanup()] - public void PU_SearchTests_Cleanup() - { - _browserDriver.Quit(); - } - - } -} diff --git a/SeleniumUiTests/Properties/AssemblyInfo.cs b/SeleniumUiTests/Properties/AssemblyInfo.cs deleted file mode 100644 index f0423c93..00000000 --- a/SeleniumUiTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("SeleniumUiTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SeleniumUiTests")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: ComVisible(false)] - -[assembly: Guid("655a2079-a99c-4539-99cc-fd772a0b10ba")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SeleniumUiTests/SeleniumUiTests.csproj b/SeleniumUiTests/SeleniumUiTests.csproj deleted file mode 100644 index 87dfa9f7..00000000 --- a/SeleniumUiTests/SeleniumUiTests.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - Debug - AnyCPU - {655A2079-A99C-4539-99CC-FD772A0B10BA} - Library - Properties - SeleniumUiTests - SeleniumUiTests - v4.6.1 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Selenium.WebDriver.PhantomJS.Xplatform.2.45.0.1\lib\net40\Ionic.Zip.dll - - - ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll - - - ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll - - - ..\packages\Selenium.WebDriver.PhantomJS.Xplatform.2.45.0.1\lib\net40\Newtonsoft.Json.dll - - - - - - ..\packages\Selenium.WebDriver.PhantomJS.Xplatform.2.45.0.1\lib\net40\WebDriver.dll - - - - - - - - - - - - PreserveNewest - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - \ No newline at end of file diff --git a/SeleniumUiTests/packages.config b/SeleniumUiTests/packages.config deleted file mode 100644 index 36af39bc..00000000 --- a/SeleniumUiTests/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/WebApp/Startup.cs b/WebApp/Startup.cs index 64148558..c83042fc 100644 --- a/WebApp/Startup.cs +++ b/WebApp/Startup.cs @@ -24,7 +24,7 @@ public Startup(IConfiguration configuration) public void ConfigureServices(IServiceCollection services) { services.AddMvc(); - + services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString("WebAppContext"))); } diff --git a/WebAppWithDatabase.sln b/WebAppWithDatabase.sln index 872fbd35..af5fabc8 100644 --- a/WebAppWithDatabase.sln +++ b/WebAppWithDatabase.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2018 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29911.84 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApp", "WebApp\WebApp.csproj", "{C253631B-C568-4219-AE1B-0F8FEDCFA39B}" EndProject @@ -11,8 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApp.UnitTest", "WebApp.U EndProject Project("{151D2E53-A2C4-4D7D-83FE-D05416EBD58E}") = "AzureResourceGroupDeployment", "AzureResourceGroupDeployment\AzureResourceGroupDeployment.deployproj", "{BFCF79CD-CFBD-4E44-A79F-B5C0E95F0F49}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeleniumUiTests", "SeleniumUiTests\SeleniumUiTests.csproj", "{655A2079-A99C-4539-99CC-FD772A0B10BA}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,10 +35,6 @@ Global {BFCF79CD-CFBD-4E44-A79F-B5C0E95F0F49}.Debug|Any CPU.Build.0 = Debug|Any CPU {BFCF79CD-CFBD-4E44-A79F-B5C0E95F0F49}.Release|Any CPU.ActiveCfg = Release|Any CPU {BFCF79CD-CFBD-4E44-A79F-B5C0E95F0F49}.Release|Any CPU.Build.0 = Release|Any CPU - {655A2079-A99C-4539-99CC-FD772A0B10BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {655A2079-A99C-4539-99CC-FD772A0B10BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {655A2079-A99C-4539-99CC-FD772A0B10BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {655A2079-A99C-4539-99CC-FD772A0B10BA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE