From 4f1d3bc875cd3695e6d975dbfb1eae4ec68f8f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Daniela=20Varela=20Cordero?= <116319948+varela13dani@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:34:37 -0600 Subject: [PATCH 1/9] Set up CI with Azure Pipelines CI para aplicaciones de DIMAJ [skip ci] --- azure-pipelines.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..356825c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,21 @@ +trigger: + branches: + include: + - main + +pool: + vmImage: 'windows-latest' + +steps: +- task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '8.0.x' + +- script: | + dotnet restore StudentApp/StudentApp.sln + dotnet build StudentApp/StudentApp.sln --configuration Release + displayName: 'Build StudentApp' + +- script: dotnet test StudentApp/ --no-restore --verbosity normal + displayName: 'Run Tests for StudentApp' From 46b22df7992a5f5241a69793fb1b56ff8311342f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Daniela=20Varela=20Cordero?= <116319948+varela13dani@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:59:36 -0600 Subject: [PATCH 2/9] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 356825c..5354315 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ trigger: - main pool: - vmImage: 'windows-latest' + name: 'Default' steps: - task: UseDotNet@2 From c48a9c70ad1129804adf28ef284f1b35c20e5fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Daniela=20Varela=20Cordero?= <116319948+varela13dani@users.noreply.github.com> Date: Wed, 19 Feb 2025 18:15:13 -0600 Subject: [PATCH 3/9] Fix paths for build and test in Azure Pipelines --- azure-pipelines.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5354315..13463c3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,9 +13,10 @@ steps: version: '8.0.x' - script: | - dotnet restore StudentApp/StudentApp.sln - dotnet build StudentApp/StudentApp.sln --configuration Release + dotnet restore StudentApp.sln + dotnet build StudentApp/StudentApp.csproj --configuration Release displayName: 'Build StudentApp' -- script: dotnet test StudentApp/ --no-restore --verbosity normal +- script: | + dotnet test StudentApp/StudentApp.csproj --no-restore --verbosity normal displayName: 'Run Tests for StudentApp' From f71dbdf8d42338753407b79f06745f883a395b27 Mon Sep 17 00:00:00 2001 From: varela13dani Date: Wed, 19 Feb 2025 23:41:02 -0600 Subject: [PATCH 4/9] =?UTF-8?q?=1B[200~git=20add=20.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StudentApp.Tests/StudentApp.Tests.csproj | 27 ++++++ StudentApp.Tests/UnitTest1.cs | 30 +++++++ StudentApp.sln | 9 ++ .../Debug/net8.0/StudentApp.AssemblyInfo.cs | 12 +-- .../StudentApp.AssemblyInfoInputs.cache | 2 +- ....GeneratedMSBuildEditorConfig.editorconfig | 36 ++++---- .../obj/Debug/net8.0/StudentApp.assets.cache | Bin 27685 -> 27440 bytes .../obj/StudentApp.csproj.nuget.dgspec.json | 14 +-- .../obj/StudentApp.csproj.nuget.g.props | 4 +- StudentApp/obj/project.assets.json | 12 +-- StudentApp/obj/project.nuget.cache | 82 +++++++++--------- 11 files changed, 147 insertions(+), 81 deletions(-) create mode 100644 StudentApp.Tests/StudentApp.Tests.csproj create mode 100644 StudentApp.Tests/UnitTest1.cs diff --git a/StudentApp.Tests/StudentApp.Tests.csproj b/StudentApp.Tests/StudentApp.Tests.csproj new file mode 100644 index 0000000..7b7ebe4 --- /dev/null +++ b/StudentApp.Tests/StudentApp.Tests.csproj @@ -0,0 +1,27 @@ + + + + net8.0 + enable + enable + + false + true + + + + + + + + + + + + + + + + + + diff --git a/StudentApp.Tests/UnitTest1.cs b/StudentApp.Tests/UnitTest1.cs new file mode 100644 index 0000000..345f8eb --- /dev/null +++ b/StudentApp.Tests/UnitTest1.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using OpenQA.Selenium; +using OpenQA.Selenium.Chrome; + +namespace StudentApp.Tests +{ + public class UITests + { + private ChromeDriver driver; + + [SetUp] + public void Setup() + { + driver = new ChromeDriver(); + } + + [Test] + public void OpenHomePage() + { + driver.Navigate().GoToUrl("https://www.google.com"); + Assert.AreEqual("Google", driver.Title); + } + + [TearDown] + public void Teardown() + { + driver.Dispose(); + } + } +} diff --git a/StudentApp.sln b/StudentApp.sln index e29f588..52e62c9 100644 --- a/StudentApp.sln +++ b/StudentApp.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.12.35527.113 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StudentApp", "StudentApp\StudentApp.csproj", "{8A67DCE4-01B5-4085-9295-7E8ED7AC6FF5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentApp.Tests", "StudentApp.Tests\StudentApp.Tests.csproj", "{909D1A0E-5B19-4E79-B542-A3EF3A45FB74}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,8 +17,15 @@ Global {8A67DCE4-01B5-4085-9295-7E8ED7AC6FF5}.Debug|Any CPU.Build.0 = Debug|Any CPU {8A67DCE4-01B5-4085-9295-7E8ED7AC6FF5}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A67DCE4-01B5-4085-9295-7E8ED7AC6FF5}.Release|Any CPU.Build.0 = Release|Any CPU + {909D1A0E-5B19-4E79-B542-A3EF3A45FB74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {909D1A0E-5B19-4E79-B542-A3EF3A45FB74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {909D1A0E-5B19-4E79-B542-A3EF3A45FB74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {909D1A0E-5B19-4E79-B542-A3EF3A45FB74}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6C4BE241-D11E-478B-9710-4A578CEC79DB} + EndGlobalSection EndGlobal diff --git a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs index c399dcb..30a98b3 100644 --- a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs +++ b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Este código fue generado por una herramienta. -// Versión de runtime:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si -// se vuelve a generar el código. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -14,10 +14,10 @@ [assembly: System.Reflection.AssemblyCompanyAttribute("StudentApp")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2394903217b2b4df673cd52ce6c821433bcd75aa")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c48a9c70ad1129804adf28ef284f1b35c20e5fd3")] [assembly: System.Reflection.AssemblyProductAttribute("StudentApp")] [assembly: System.Reflection.AssemblyTitleAttribute("StudentApp")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generado por la clase WriteCodeFragment de MSBuild. +// Generated by the MSBuild WriteCodeFragment class. diff --git a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache index 9281f77..eabfa64 100644 --- a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache +++ b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache @@ -1 +1 @@ -4b0c0ff21470ffc2cb8da46cd8bc936f1be9f2c5092d96d7f2a64d6c7808b60c +d26f3b09665a3c1ffe8797c837fac587fad9fdab837d47cdb7edff7a60eaa7a0 diff --git a/StudentApp/obj/Debug/net8.0/StudentApp.GeneratedMSBuildEditorConfig.editorconfig b/StudentApp/obj/Debug/net8.0/StudentApp.GeneratedMSBuildEditorConfig.editorconfig index d816709..b49a63e 100644 --- a/StudentApp/obj/Debug/net8.0/StudentApp.GeneratedMSBuildEditorConfig.editorconfig +++ b/StudentApp/obj/Debug/net8.0/StudentApp.GeneratedMSBuildEditorConfig.editorconfig @@ -9,75 +9,75 @@ build_property.EnforceExtendedAnalyzerRules = build_property._SupportedPlatformList = Linux,macOS,Windows build_property.RootNamespace = StudentApp build_property.RootNamespace = StudentApp -build_property.ProjectDir = C:\Users\Esteban\Documents\UCR\Tercer año\III Semestre\Lenguajes para Aplicaciones Comerciales\Proyecto\StudentApp\StudentApp\ +build_property.ProjectDir = C:\Users\daniv\source\repos\StudentApp\StudentApp\ build_property.EnableComHosting = build_property.EnableGeneratedComInterfaceComImportInterop = build_property.RazorLangVersion = 8.0 build_property.SupportLocalizedComponentNames = build_property.GenerateRazorMetadataSourceChecksumAttributes = -build_property.MSBuildProjectDirectory = C:\Users\Esteban\Documents\UCR\Tercer año\III Semestre\Lenguajes para Aplicaciones Comerciales\Proyecto\StudentApp\StudentApp +build_property.MSBuildProjectDirectory = C:\Users\daniv\source\repos\StudentApp\StudentApp build_property._RazorSourceGeneratorDebug = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Home/Index.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Home/Index.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcSG9tZVxJbmRleC5jc2h0bWw= build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Home/Privacy.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Home/Privacy.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcSG9tZVxQcml2YWN5LmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/AddNews.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/AddNews.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXEFkZE5ld3MuY3NodG1s build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/Advisement.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/Advisement.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXEFkdmlzZW1lbnQuY3NodG1s build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/AdvisementDetails.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/AdvisementDetails.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXEFkdmlzZW1lbnREZXRhaWxzLmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/Appointment.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/Appointment.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXEFwcG9pbnRtZW50LmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/Error.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/Error.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXEVycm9yLmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/Login.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/Login.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXExvZ2luLmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/News.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/News.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXE5ld3MuY3NodG1s build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/NewsDetails.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/NewsDetails.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXE5ld3NEZXRhaWxzLmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/Profile.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/Profile.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXFByb2ZpbGUuY3NodG1s build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/Register.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/Register.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXFJlZ2lzdGVyLmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/_ValidationScriptsPartial.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/_ValidationScriptsPartial.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXF9WYWxpZGF0aW9uU2NyaXB0c1BhcnRpYWwuY3NodG1s build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/_ViewImports.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/_ViewImports.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcX1ZpZXdJbXBvcnRzLmNzaHRtbA== build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/_ViewStart.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/_ViewStart.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcX1ZpZXdTdGFydC5jc2h0bWw= build_metadata.AdditionalFiles.CssScope = -[C:/Users/Esteban/Documents/UCR/Tercer año/III Semestre/Lenguajes para Aplicaciones Comerciales/Proyecto/StudentApp/StudentApp/Views/Shared/_Layout.cshtml] +[C:/Users/daniv/source/repos/StudentApp/StudentApp/Views/Shared/_Layout.cshtml] build_metadata.AdditionalFiles.TargetPath = Vmlld3NcU2hhcmVkXF9MYXlvdXQuY3NodG1s build_metadata.AdditionalFiles.CssScope = b-ak0w5rm0kc diff --git a/StudentApp/obj/Debug/net8.0/StudentApp.assets.cache b/StudentApp/obj/Debug/net8.0/StudentApp.assets.cache index bc9347765019eae28095fecc77d5742d33b7b11b..07b8499915116f7d6fe07fb3006bfc0c3d391565 100644 GIT binary patch delta 3369 zcmaKvUu;uV9LG0de{8#*J4d{_-la%~qp+>}bN8p+YRkH|YrC-~%Q6@v2D1%D8EaRB zNhO74A_j=EZ;0?9a}SX0VF@rbBt+wb!izd2k)X+9)ED3Opou0-Vy_L7-19s4_4hr$ zbAIP{&gXm2z4j>o#>0GHEE?Kr$;-<-|M`!h#nkMc^-nYD3qQ@4{;}3S_~^m)3!APj zR^6Md|KVz1Ufzc6xQqFI_wYb!bSgDGvj52VF)UcDu(gHW0@3GovmsqfR(s|)DC~qT{Ir(u)F7^8^`ink)9gddMujCv zJ%l@1?Kq*`ZK*(IL5z(P+LeM~HmZv!BMmrLX~$5ZO_~=qrq&&YQlv=liUuT#CfS5; zW^JdrrVX%^KpX4u;+JBD9prR7N<6JN_`D*W&2_r*S&2eORy-*gVS98bD`hXi>uxIZE~f|iS<4co`mYLP^L)l@rfU@ zNn(}vUl?V>WV`@>g&WXcUM1*4VEOm*&O&C>CAU|+Ou*&B)e4yaEDUCq4G8n&HvVbJFn4*6wGe!i(u+b(PP}G96SzScZLt8&d(Z0=5nxNIq zaREJkeEo_{5+rXKCJJz1X-kZ|R120y`0P=Nni<%tWa45tkf_>4#5HUJaBh`JbSAfk z46q5J;Z?qCIdmeplhtT^+R#)jixAq4Z>nW($ImdT#n3jH!e|E37NV$HQ!I}y&*m&4LKSnrF2Oc!3gcF@IaG?_h4s=xDK54El?Q43sWk%pg zK77)u5{{(Z4Kq$!O_;A_=xu8i8BjUCYRhmKJFqffcsnUQiWT;a;2ysa%JiS>Xs}gK4aFs{$Jg<5E~Pu)%R|2g%4HVGk~_82kU~ zpO1#5S^cx-W=|M(JxOVX7j9F*2o4|Gj@9JXHuA^XRl>#JN1M_rCNmIgi7| delta 3520 zcmaKvT})eL7{^-*1KQH@p2ZwSOH0>TR{89DMhgW>DP3EjqY<6RIx>b$*%*USm}4-P zp&Qc~+4i3?^Fn5HiMt^t)fls=5M$!Ug~JP7h>3T`#E*z3+!&pwId`1r<)Sy||2)rm z-se5Pf1bYoz4q=yZAYRz5;STwn$l_AU+1cS*2Mog_RIZ1V%_uGHQjmh;eU4r>h26Y z`u*NwLZi{ianOdElTT+-lbK{VGnG0%bQ*S@6H8|Ojfu4IrdnOII+18L<14KP^?gMc z*6tCAB5PJj4jE-Vs`8fdCd}p8SW>0TmdEh7tjwttyY4DGOFYdr+6r^NjZKp3cz!>d zArv#LjpZ;DB-kjae%;uPFA6Lytx{L38&J6;B)m;eX0~Y*`GpqYWm--&_u*clg^jD~ zu33|4D6+9>LUCf*AHe5D7Isplx*ZPuXOj>vwh6DOU#iH3c&qpnyGSIvV6%sCS#J|A zQOPd+sDF;=X`?NL4-6J!wr;kR#1 zPS%~CPN$}l6GOwJL+Ml|DWk8ckbe}P36jlYB$p@9XBN3^KE>s-2}2f=$ywgAzXc!KL@t5d+tU}vgG!N0-~gY#FgEQX z(bGoTalEic=HqLWBYl`$MKU(d2+(`>~ z*DLW%$>dug=*iiR$ybE$d>OvkE%9n5nioieOQOT?B}i0EF2glA2@5UW?M*I$Xsg6E zxex|@2IRHX@XaoY}=dT{F%EB|=q2n4dUTZi)UhHbc5fPASI4u5satdUaZ@cH!fmN_36X zqNS${uXfi6FY&_cs5qg=A0w4=XeU2xkvG7J_!2wMxv^ecJ`|xkl;@i@^sebyM3t%h PuVO5)Rmr*s9+mzN7a`}4 diff --git a/StudentApp/obj/StudentApp.csproj.nuget.dgspec.json b/StudentApp/obj/StudentApp.csproj.nuget.dgspec.json index 6b1ff2b..fe534b1 100644 --- a/StudentApp/obj/StudentApp.csproj.nuget.dgspec.json +++ b/StudentApp/obj/StudentApp.csproj.nuget.dgspec.json @@ -1,20 +1,20 @@ { "format": 1, "restore": { - "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\StudentApp.csproj": {} + "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\StudentApp.csproj": {} }, "projects": { - "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\StudentApp.csproj": { + "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\StudentApp.csproj": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\StudentApp.csproj", + "projectUniqueName": "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\StudentApp.csproj", "projectName": "StudentApp", - "projectPath": "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\StudentApp.csproj", - "packagesPath": "C:\\Users\\Esteban\\.nuget\\packages\\", - "outputPath": "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\obj\\", + "projectPath": "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\StudentApp.csproj", + "packagesPath": "C:\\Users\\daniv\\.nuget\\packages\\", + "outputPath": "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Esteban\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Users\\daniv\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" ], "originalTargetFrameworks": [ diff --git a/StudentApp/obj/StudentApp.csproj.nuget.g.props b/StudentApp/obj/StudentApp.csproj.nuget.g.props index 3755991..047e514 100644 --- a/StudentApp/obj/StudentApp.csproj.nuget.g.props +++ b/StudentApp/obj/StudentApp.csproj.nuget.g.props @@ -5,11 +5,11 @@ NuGet $(MSBuildThisFileDirectory)project.assets.json $(UserProfile)\.nuget\packages\ - C:\Users\Esteban\.nuget\packages\ + C:\Users\daniv\.nuget\packages\ PackageReference 6.11.1 - + \ No newline at end of file diff --git a/StudentApp/obj/project.assets.json b/StudentApp/obj/project.assets.json index fb15455..c4de3b0 100644 --- a/StudentApp/obj/project.assets.json +++ b/StudentApp/obj/project.assets.json @@ -1790,19 +1790,19 @@ ] }, "packageFolders": { - "C:\\Users\\Esteban\\.nuget\\packages\\": {} + "C:\\Users\\daniv\\.nuget\\packages\\": {} }, "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\StudentApp.csproj", + "projectUniqueName": "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\StudentApp.csproj", "projectName": "StudentApp", - "projectPath": "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\StudentApp.csproj", - "packagesPath": "C:\\Users\\Esteban\\.nuget\\packages\\", - "outputPath": "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\obj\\", + "projectPath": "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\StudentApp.csproj", + "packagesPath": "C:\\Users\\daniv\\.nuget\\packages\\", + "outputPath": "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\obj\\", "projectStyle": "PackageReference", "configFilePaths": [ - "C:\\Users\\Esteban\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Users\\daniv\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" ], "originalTargetFrameworks": [ diff --git a/StudentApp/obj/project.nuget.cache b/StudentApp/obj/project.nuget.cache index f65b113..2978bde 100644 --- a/StudentApp/obj/project.nuget.cache +++ b/StudentApp/obj/project.nuget.cache @@ -1,48 +1,48 @@ { "version": 2, - "dgSpecHash": "D3o6O3hsjRw=", + "dgSpecHash": "iCK5r4JGVio=", "success": true, - "projectFilePath": "C:\\Users\\Esteban\\Documents\\UCR\\Tercer año\\III Semestre\\Lenguajes para Aplicaciones Comerciales\\Proyecto\\StudentApp\\StudentApp\\StudentApp.csproj", + "projectFilePath": "C:\\Users\\daniv\\source\\repos\\StudentApp\\StudentApp\\StudentApp.csproj", "expectedPackageFiles": [ - "C:\\Users\\Esteban\\.nuget\\packages\\azure.core\\1.38.0\\azure.core.1.38.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\azure.identity\\1.11.4\\azure.identity.1.11.4.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.aspnetcore.authorization\\8.0.12\\microsoft.aspnetcore.authorization.8.0.12.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.aspnetcore.components\\8.0.12\\microsoft.aspnetcore.components.8.0.12.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.aspnetcore.components.analyzers\\8.0.12\\microsoft.aspnetcore.components.analyzers.8.0.12.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.aspnetcore.metadata\\8.0.12\\microsoft.aspnetcore.metadata.8.0.12.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.1\\microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.bcl.cryptography\\8.0.0\\microsoft.bcl.cryptography.8.0.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.data.sqlclient\\6.0.1\\microsoft.data.sqlclient.6.0.1.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.data.sqlclient.sni.runtime\\6.0.2\\microsoft.data.sqlclient.sni.runtime.6.0.2.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.extensions.caching.abstractions\\8.0.0\\microsoft.extensions.caching.abstractions.8.0.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.extensions.caching.memory\\8.0.1\\microsoft.extensions.caching.memory.8.0.1.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.2\\microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\8.0.2\\microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.extensions.options\\8.0.2\\microsoft.extensions.options.8.0.2.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.extensions.primitives\\8.0.0\\microsoft.extensions.primitives.8.0.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identity.client\\4.61.3\\microsoft.identity.client.4.61.3.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identity.client.extensions.msal\\4.61.3\\microsoft.identity.client.extensions.msal.4.61.3.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identitymodel.abstractions\\7.5.0\\microsoft.identitymodel.abstractions.7.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\7.5.0\\microsoft.identitymodel.jsonwebtokens.7.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identitymodel.logging\\7.5.0\\microsoft.identitymodel.logging.7.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identitymodel.protocols\\7.5.0\\microsoft.identitymodel.protocols.7.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identitymodel.protocols.openidconnect\\7.5.0\\microsoft.identitymodel.protocols.openidconnect.7.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.identitymodel.tokens\\7.5.0\\microsoft.identitymodel.tokens.7.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\microsoft.sqlserver.server\\1.0.0\\microsoft.sqlserver.server.1.0.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.clientmodel\\1.0.0\\system.clientmodel.1.0.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.configuration.configurationmanager\\8.0.1\\system.configuration.configurationmanager.8.0.1.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.diagnostics.diagnosticsource\\6.0.1\\system.diagnostics.diagnosticsource.6.0.1.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.diagnostics.eventlog\\8.0.1\\system.diagnostics.eventlog.8.0.1.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.identitymodel.tokens.jwt\\7.5.0\\system.identitymodel.tokens.jwt.7.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.memory\\4.5.4\\system.memory.4.5.4.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.memory.data\\1.0.2\\system.memory.data.1.0.2.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.numerics.vectors\\4.5.0\\system.numerics.vectors.4.5.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.0.0\\system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.security.cryptography.pkcs\\8.0.1\\system.security.cryptography.pkcs.8.0.1.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.security.cryptography.protecteddata\\8.0.0\\system.security.cryptography.protecteddata.8.0.0.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.text.encodings.web\\4.7.2\\system.text.encodings.web.4.7.2.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.text.json\\4.7.2\\system.text.json.4.7.2.nupkg.sha512", - "C:\\Users\\Esteban\\.nuget\\packages\\system.threading.tasks.extensions\\4.5.4\\system.threading.tasks.extensions.4.5.4.nupkg.sha512" + "C:\\Users\\daniv\\.nuget\\packages\\azure.core\\1.38.0\\azure.core.1.38.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\azure.identity\\1.11.4\\azure.identity.1.11.4.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.aspnetcore.authorization\\8.0.12\\microsoft.aspnetcore.authorization.8.0.12.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.aspnetcore.components\\8.0.12\\microsoft.aspnetcore.components.8.0.12.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.aspnetcore.components.analyzers\\8.0.12\\microsoft.aspnetcore.components.analyzers.8.0.12.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.aspnetcore.metadata\\8.0.12\\microsoft.aspnetcore.metadata.8.0.12.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.1\\microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.bcl.cryptography\\8.0.0\\microsoft.bcl.cryptography.8.0.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.data.sqlclient\\6.0.1\\microsoft.data.sqlclient.6.0.1.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.data.sqlclient.sni.runtime\\6.0.2\\microsoft.data.sqlclient.sni.runtime.6.0.2.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.extensions.caching.abstractions\\8.0.0\\microsoft.extensions.caching.abstractions.8.0.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.extensions.caching.memory\\8.0.1\\microsoft.extensions.caching.memory.8.0.1.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.2\\microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\8.0.2\\microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.extensions.options\\8.0.2\\microsoft.extensions.options.8.0.2.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.extensions.primitives\\8.0.0\\microsoft.extensions.primitives.8.0.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identity.client\\4.61.3\\microsoft.identity.client.4.61.3.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identity.client.extensions.msal\\4.61.3\\microsoft.identity.client.extensions.msal.4.61.3.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identitymodel.abstractions\\7.5.0\\microsoft.identitymodel.abstractions.7.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identitymodel.jsonwebtokens\\7.5.0\\microsoft.identitymodel.jsonwebtokens.7.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identitymodel.logging\\7.5.0\\microsoft.identitymodel.logging.7.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identitymodel.protocols\\7.5.0\\microsoft.identitymodel.protocols.7.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identitymodel.protocols.openidconnect\\7.5.0\\microsoft.identitymodel.protocols.openidconnect.7.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.identitymodel.tokens\\7.5.0\\microsoft.identitymodel.tokens.7.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\microsoft.sqlserver.server\\1.0.0\\microsoft.sqlserver.server.1.0.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.clientmodel\\1.0.0\\system.clientmodel.1.0.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.configuration.configurationmanager\\8.0.1\\system.configuration.configurationmanager.8.0.1.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.diagnostics.diagnosticsource\\6.0.1\\system.diagnostics.diagnosticsource.6.0.1.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.diagnostics.eventlog\\8.0.1\\system.diagnostics.eventlog.8.0.1.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.identitymodel.tokens.jwt\\7.5.0\\system.identitymodel.tokens.jwt.7.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.memory\\4.5.4\\system.memory.4.5.4.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.memory.data\\1.0.2\\system.memory.data.1.0.2.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.numerics.vectors\\4.5.0\\system.numerics.vectors.4.5.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.0.0\\system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.security.cryptography.pkcs\\8.0.1\\system.security.cryptography.pkcs.8.0.1.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.security.cryptography.protecteddata\\8.0.0\\system.security.cryptography.protecteddata.8.0.0.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.text.encodings.web\\4.7.2\\system.text.encodings.web.4.7.2.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.text.json\\4.7.2\\system.text.json.4.7.2.nupkg.sha512", + "C:\\Users\\daniv\\.nuget\\packages\\system.threading.tasks.extensions\\4.5.4\\system.threading.tasks.extensions.4.5.4.nupkg.sha512" ], "logs": [] } \ No newline at end of file From cbc077ef2c255b017724fe10256767d25fadeb41 Mon Sep 17 00:00:00 2001 From: varela13dani Date: Thu, 20 Feb 2025 01:45:21 -0600 Subject: [PATCH 5/9] Agregando pruebas Selenium y pipeline a test-azure-pipeline --- StudentApp.Tests/UnitTest1.cs | 49 ++++++++++++++++--- .../Debug/net8.0/StudentApp.AssemblyInfo.cs | 2 +- .../StudentApp.AssemblyInfoInputs.cache | 2 +- azure-pipelines.yml | 32 +++++++----- 4 files changed, 64 insertions(+), 21 deletions(-) diff --git a/StudentApp.Tests/UnitTest1.cs b/StudentApp.Tests/UnitTest1.cs index 345f8eb..27b1b72 100644 --- a/StudentApp.Tests/UnitTest1.cs +++ b/StudentApp.Tests/UnitTest1.cs @@ -1,30 +1,65 @@ -using NUnit.Framework; +using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; +using OpenQA.Selenium.Support.UI; +using System; +using System.Threading; namespace StudentApp.Tests { - public class UITests + public class RegisterTests { - private ChromeDriver driver; + private ChromeDriver driver; + private WebDriverWait wait; [SetUp] public void Setup() { driver = new ChromeDriver(); + driver.Manage().Window.Maximize(); + wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); } [Test] - public void OpenHomePage() + public void RegisterNewStudent() { - driver.Navigate().GoToUrl("https://www.google.com"); - Assert.AreEqual("Google", driver.Title); + driver.Navigate().GoToUrl("https://localhost:7047/User/Register"); + + string email = $"juan.perez{DateTime.Now.Ticks}danivarelacor@gmail.com"; + driver.FindElement(By.Id("r-name")).SendKeys("Juan Pérez"); + driver.FindElement(By.Id("r-email")).SendKeys(email); + driver.FindElement(By.Id("r-password")).SendKeys("Password123!"); + driver.FindElement(By.Id("confirm-password")).SendKeys("Password123!"); + + + driver.FindElement(By.Id("form-submit")).Click(); + + + Thread.Sleep(6000); + // 5️⃣ Esperar el mensaje de validación en la interfaz + IWebElement validationMessage = wait.Until(d => d.FindElement(By.Id("validation"))); + string messageText = validationMessage.Text; + + // 6️⃣ Lista de mensajes esperados del backend + string[] expectedMessages = { + "Su solicitud ha sido enviada correctamente. Revisa tu correo.", + "El correo electrónico ya ha sido registrado en el sistema.", + "No ha sido posible hacer la solicitud de registro. Intente de nuevo más tarde.", + "Ha ocurrido un error inesperado en el sistema. Intente de nuevo más tarde." + }; + + // 7️⃣ Validar que el mensaje recibido esté en la lista de mensajes esperados + Assert.IsTrue(Array.Exists(expectedMessages, msg => messageText.Contains(msg)), + $"Mensaje recibido inesperado: {messageText}"); } [TearDown] public void Teardown() { - driver.Dispose(); + if (driver != null) + { + driver.Dispose(); // ✅ Usa Dispose() para cerrar el navegador correctamente + } } } } diff --git a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs index 30a98b3..2e5436b 100644 --- a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs +++ b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfo.cs @@ -14,7 +14,7 @@ [assembly: System.Reflection.AssemblyCompanyAttribute("StudentApp")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c48a9c70ad1129804adf28ef284f1b35c20e5fd3")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f71dbdf8d42338753407b79f06745f883a395b27")] [assembly: System.Reflection.AssemblyProductAttribute("StudentApp")] [assembly: System.Reflection.AssemblyTitleAttribute("StudentApp")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache index eabfa64..7300418 100644 --- a/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache +++ b/StudentApp/obj/Debug/net8.0/StudentApp.AssemblyInfoInputs.cache @@ -1 +1 @@ -d26f3b09665a3c1ffe8797c837fac587fad9fdab837d47cdb7edff7a60eaa7a0 +99a0f1b92cd2028894593fa9f48a491fb16a3706f6427e46f9e84b1f631e32ba diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 13463c3..cb5693e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,19 +4,27 @@ trigger: - main pool: - name: 'Default' + name: "Default" steps: -- task: UseDotNet@2 - inputs: - packageType: 'sdk' - version: '8.0.x' + - task: UseDotNet@2 + inputs: + packageType: "sdk" + version: "8.0.x" -- script: | - dotnet restore StudentApp.sln - dotnet build StudentApp/StudentApp.csproj --configuration Release - displayName: 'Build StudentApp' + - script: | + dotnet restore StudentApp.sln + displayName: "Restore dependencies" -- script: | - dotnet test StudentApp/StudentApp.csproj --no-restore --verbosity normal - displayName: 'Run Tests for StudentApp' + - script: | + dotnet build StudentApp.sln --configuration Release + displayName: "Build Solution" + + - script: | + start cmd /c "dotnet run --project StudentApp/StudentApp.csproj --no-build" + timeout /t 20 /nobreak + displayName: "Start StudentApp" + + - script: | + dotnet test StudentApp.Tests/StudentApp.Tests.csproj --no-restore --verbosity normal + displayName: "Run Selenium Tests" From c5b5dceb565f503688c2d4529213e4337edfa133 Mon Sep 17 00:00:00 2001 From: varela13dani Date: Thu, 20 Feb 2025 01:47:24 -0600 Subject: [PATCH 6/9] Cambios de Blanca que necesitaba para que corra en esta rama --- StudentApp/Controllers/UserController.cs | 1 + StudentApp/Models/DAO/AppointmentDAO.cs | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/StudentApp/Controllers/UserController.cs b/StudentApp/Controllers/UserController.cs index 35b74f1..671086c 100644 --- a/StudentApp/Controllers/UserController.cs +++ b/StudentApp/Controllers/UserController.cs @@ -130,6 +130,7 @@ public IActionResult Register([FromBody] User user) } + [HttpGet] public IActionResult GetByEmail([FromQuery] string email) { diff --git a/StudentApp/Models/DAO/AppointmentDAO.cs b/StudentApp/Models/DAO/AppointmentDAO.cs index 4083df6..c989cf8 100644 --- a/StudentApp/Models/DAO/AppointmentDAO.cs +++ b/StudentApp/Models/DAO/AppointmentDAO.cs @@ -26,36 +26,36 @@ public int CreateAppointment(AppointmentDTO appointment) { try { + using (SqlCommand command = new SqlCommand("CreateAppointment", connection, transaction)) { command.CommandType = System.Data.CommandType.StoredProcedure; - - command.Parameters.AddWithValue("@Id", Guid.NewGuid().ToString()); + command.Parameters.AddWithValue("@Id", appointment.Id); command.Parameters.AddWithValue("@Date", appointment.Date); command.Parameters.AddWithValue("@Mode", appointment.Mode); command.Parameters.AddWithValue("@Status", "pending"); - command.Parameters.AddWithValue("@CourseId", appointment.Course.Id); - command.Parameters.AddWithValue("@StudentId", appointment.User.Id); + command.Parameters.AddWithValue("@CourseId", appointment.CourseId); + command.Parameters.AddWithValue("@StudentId", appointment.StudentId); result = command.ExecuteNonQuery(); } + using (SqlCommand command = new SqlCommand("GetProfessorEmail", connection, transaction)) { command.CommandType = System.Data.CommandType.StoredProcedure; - - command.Parameters.AddWithValue("@Id", appointment.Id); - command.Parameters.AddWithValue("@Date", appointment.Date); - command.Parameters.AddWithValue("@Mode", appointment.Mode); - command.Parameters.AddWithValue("@Status", "pending"); - command.Parameters.AddWithValue("@CourseId", appointment.CourseId); - command.Parameters.AddWithValue("@StudentId", appointment.StudentId); + command.Parameters.AddWithValue("@CourseId", appointment.CourseId); var professorEmail = command.ExecuteScalar()?.ToString() ?? string.Empty; - SendEmail.AppointmentEmail(professorEmail); + // Enviar el correo + if (!string.IsNullOrEmpty(professorEmail)) + { + SendEmail.AppointmentEmail(professorEmail); + } } + transaction.Commit(); } catch (SqlException) From 214f8205d1fdaf09a10705d98ceab853a094a249 Mon Sep 17 00:00:00 2001 From: varela13dani Date: Thu, 20 Feb 2025 01:54:28 -0600 Subject: [PATCH 7/9] yaml actualizado --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cb5693e..f122e74 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,8 +21,8 @@ steps: displayName: "Build Solution" - script: | - start cmd /c "dotnet run --project StudentApp/StudentApp.csproj --no-build" - timeout /t 20 /nobreak + start /B dotnet run --project StudentApp/StudentApp.csproj --no-build + ping 127.0.0.1 -n 20 > nul displayName: "Start StudentApp" - script: | From 37290af9c95678e2a802e4ca88f2f85171e1bec5 Mon Sep 17 00:00:00 2001 From: varela13dani Date: Thu, 20 Feb 2025 19:57:07 -0600 Subject: [PATCH 8/9] Eliminar pipeline --- azure-pipelines.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index f122e74..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,30 +0,0 @@ -trigger: - branches: - include: - - main - -pool: - name: "Default" - -steps: - - task: UseDotNet@2 - inputs: - packageType: "sdk" - version: "8.0.x" - - - script: | - dotnet restore StudentApp.sln - displayName: "Restore dependencies" - - - script: | - dotnet build StudentApp.sln --configuration Release - displayName: "Build Solution" - - - script: | - start /B dotnet run --project StudentApp/StudentApp.csproj --no-build - ping 127.0.0.1 -n 20 > nul - displayName: "Start StudentApp" - - - script: | - dotnet test StudentApp.Tests/StudentApp.Tests.csproj --no-restore --verbosity normal - displayName: "Run Selenium Tests" From 5394ce0fd8e9c9a2f4f0a25d6653392105e10dd8 Mon Sep 17 00:00:00 2001 From: varela13dani Date: Thu, 20 Feb 2025 19:59:37 -0600 Subject: [PATCH 9/9] Prueba de Registrarse --- StudentApp.Tests/UnitTest1.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/StudentApp.Tests/UnitTest1.cs b/StudentApp.Tests/UnitTest1.cs index 27b1b72..3a649f7 100644 --- a/StudentApp.Tests/UnitTest1.cs +++ b/StudentApp.Tests/UnitTest1.cs @@ -36,11 +36,11 @@ public void RegisterNewStudent() Thread.Sleep(6000); - // 5️⃣ Esperar el mensaje de validación en la interfaz + IWebElement validationMessage = wait.Until(d => d.FindElement(By.Id("validation"))); string messageText = validationMessage.Text; - // 6️⃣ Lista de mensajes esperados del backend + string[] expectedMessages = { "Su solicitud ha sido enviada correctamente. Revisa tu correo.", "El correo electrónico ya ha sido registrado en el sistema.", @@ -48,7 +48,6 @@ public void RegisterNewStudent() "Ha ocurrido un error inesperado en el sistema. Intente de nuevo más tarde." }; - // 7️⃣ Validar que el mensaje recibido esté en la lista de mensajes esperados Assert.IsTrue(Array.Exists(expectedMessages, msg => messageText.Contains(msg)), $"Mensaje recibido inesperado: {messageText}"); } @@ -58,7 +57,7 @@ public void Teardown() { if (driver != null) { - driver.Dispose(); // ✅ Usa Dispose() para cerrar el navegador correctamente + driver.Dispose(); } } }