This commit is contained in:
Lukáš Kaňka
2023-08-22 20:28:19 +02:00
commit 14d46cad1c
2236 changed files with 74214 additions and 0 deletions

View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Selenium.WebDriver" Version="4.8.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -0,0 +1,116 @@
<html xmlns:tp="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.ObjectModel" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<body>
<h1>Test run details</h1>
<div class="summary">
<div class="block"><span>Total tests</span><div class="total-tests">1</div><br></div>
<div class="block"><span>Passed  : </span><span class="passedTests">0</span><br><span>Failed  : </span><span class="failedTests">1</span><br><span>Skipped : </span><span class="skippedTests">0</span><br></div>
<div class="block"><span>Pass percentage</span><div class="pass-percentage">0 %</div><br></div>
<div class="block"><span>Run duration</span><div class="test-run-time">28s 771ms</div><br></div><br></div>
<h2>Failed Results</h2>
<div class="list-row" onclick="ToggleClass('-13767669-failedResult')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="-13767669-failedResult" style="display:block;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>12s 474ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#_hUDmY9\-8O4aA9u8P7aCtiAs_5"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 31
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<h2>All Results</h2>
<div class="list-row" onclick="ToggleClass('-13767669')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="-13767669" style="display:none;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>12s 474ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#_hUDmY9\-8O4aA9u8P7aCtiAs_5"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 31
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<div>
<h2>Informational messages</h2><span>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 7.0.2)</span><br><span>[xUnit.net 00:00:09.12] Discovering: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:09.18] Discovered: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:09.19] Starting: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:21.79] OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#_hUDmY9\-8O4aA9u8P7aCtiAs_5"}
(Session info: chrome=110.0.5481.77)</span><br><span>[xUnit.net 00:00:21.79] Stack Trace:</span><br><span>[xUnit.net 00:00:21.79] at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)</span><br><span>[xUnit.net 00:00:21.80] at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)</span><br><span>[xUnit.net 00:00:21.80] at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)</span><br><span>[xUnit.net 00:00:21.80] at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)</span><br><span>[xUnit.net 00:00:21.80] at OpenQA.Selenium.By.FindElement(ISearchContext context)</span><br><span>[xUnit.net 00:00:21.80] at OpenQA.Selenium.WebDriver.FindElement(By by)</span><br><span>[xUnit.net 00:00:21.80] c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs(31,0): at Google_Search_xUnit.UnitTest1.Test1()</span><br><span>[xUnit.net 00:00:21.80] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)</span><br><span>[xUnit.net 00:00:21.80] at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</span><br><span>[xUnit.net 00:00:21.81] Finished: Google_Search_xUnit</span><br></div>
<div>
<h2>Error and Warning messages</h2><span>[xUnit.net 00:00:21.79] Google_Search_xUnit.UnitTest1.Test1 [FAIL]</span><br></div>
</body><script language="javascript">
function ToggleClass(id) {
var elem = document.getElementById(id);
if (elem.style.display == "none") {
elem.style.display = "block";
}
else {
elem.style.display = "none";
}
}
</script><style>
body { font-family: Calibri, Verdana, Arial, sans-serif; background-color: White; color: Black; }
h2 {
margin-top: 15px;
margin-bottom:10px;
}
pre {
white-space: pre-wrap;
}
.summary {font-family:monospace;
display: -webkit-flex; /* Safari */
-webkit-flex-wrap: wrap; /* Safari 6.1+ */
display: flex;
flex-wrap: wrap;
}
.row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#d7e9fa;
}
.list-row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#ffffff;
}
.inner-row{
border: 2px solid #ffffff;
padding-left:1%;
margin-left:1%;
background-color:#ffffff;
}
.block{
width : 150px;
}
.leaf-division{
border: 2px solid #ffffff;
background-color:#e6eff7;
}
.pass { color: #0c0; }
.fail { color: #c00; }
.error-message { color : brown; }
.error-stack-trace { color: brown; }
.duration {float:right;padding-right:1%;}
.total-tests { font-size : 30px}
.test-run-time { font-size : 30px}
.pass-percentage { font-size : 30px}
.error-info{
margin-left:16px;
}
</style>
</html>

View File

@ -0,0 +1,116 @@
<html xmlns:tp="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.ObjectModel" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<body>
<h1>Test run details</h1>
<div class="summary">
<div class="block"><span>Total tests</span><div class="total-tests">1</div><br></div>
<div class="block"><span>Passed  : </span><span class="passedTests">0</span><br><span>Failed  : </span><span class="failedTests">1</span><br><span>Skipped : </span><span class="skippedTests">0</span><br></div>
<div class="block"><span>Pass percentage</span><div class="pass-percentage">0 %</div><br></div>
<div class="block"><span>Run duration</span><div class="test-run-time">15s 151ms</div><br></div><br></div>
<h2>Failed Results</h2>
<div class="list-row" onclick="ToggleClass('-1737294713-failedResult')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="-1737294713-failedResult" style="display:block;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>10s 708ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#_hUDmY9"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 31
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<h2>All Results</h2>
<div class="list-row" onclick="ToggleClass('-1737294713')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="-1737294713" style="display:none;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>10s 708ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#_hUDmY9"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 31
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<div>
<h2>Informational messages</h2><span>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 7.0.2)</span><br><span>[xUnit.net 00:00:02.04] Discovering: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:02.13] Discovered: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:02.14] Starting: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:13.04] OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#_hUDmY9"}
(Session info: chrome=110.0.5481.77)</span><br><span>[xUnit.net 00:00:13.04] Stack Trace:</span><br><span>[xUnit.net 00:00:13.05] at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)</span><br><span>[xUnit.net 00:00:13.05] at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)</span><br><span>[xUnit.net 00:00:13.05] at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)</span><br><span>[xUnit.net 00:00:13.05] at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)</span><br><span>[xUnit.net 00:00:13.05] at OpenQA.Selenium.By.FindElement(ISearchContext context)</span><br><span>[xUnit.net 00:00:13.05] at OpenQA.Selenium.WebDriver.FindElement(By by)</span><br><span>[xUnit.net 00:00:13.05] c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs(31,0): at Google_Search_xUnit.UnitTest1.Test1()</span><br><span>[xUnit.net 00:00:13.05] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)</span><br><span>[xUnit.net 00:00:13.05] at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</span><br><span>[xUnit.net 00:00:13.07] Finished: Google_Search_xUnit</span><br></div>
<div>
<h2>Error and Warning messages</h2><span>[xUnit.net 00:00:13.04] Google_Search_xUnit.UnitTest1.Test1 [FAIL]</span><br></div>
</body><script language="javascript">
function ToggleClass(id) {
var elem = document.getElementById(id);
if (elem.style.display == "none") {
elem.style.display = "block";
}
else {
elem.style.display = "none";
}
}
</script><style>
body { font-family: Calibri, Verdana, Arial, sans-serif; background-color: White; color: Black; }
h2 {
margin-top: 15px;
margin-bottom:10px;
}
pre {
white-space: pre-wrap;
}
.summary {font-family:monospace;
display: -webkit-flex; /* Safari */
-webkit-flex-wrap: wrap; /* Safari 6.1+ */
display: flex;
flex-wrap: wrap;
}
.row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#d7e9fa;
}
.list-row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#ffffff;
}
.inner-row{
border: 2px solid #ffffff;
padding-left:1%;
margin-left:1%;
background-color:#ffffff;
}
.block{
width : 150px;
}
.leaf-division{
border: 2px solid #ffffff;
background-color:#e6eff7;
}
.pass { color: #0c0; }
.fail { color: #c00; }
.error-message { color : brown; }
.error-stack-trace { color: brown; }
.duration {float:right;padding-right:1%;}
.total-tests { font-size : 30px}
.test-run-time { font-size : 30px}
.pass-percentage { font-size : 30px}
.error-info{
margin-left:16px;
}
</style>
</html>

View File

@ -0,0 +1,116 @@
<html xmlns:tp="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.ObjectModel" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<body>
<h1>Test run details</h1>
<div class="summary">
<div class="block"><span>Total tests</span><div class="total-tests">1</div><br></div>
<div class="block"><span>Passed  : </span><span class="passedTests">0</span><br><span>Failed  : </span><span class="failedTests">1</span><br><span>Skipped : </span><span class="skippedTests">0</span><br></div>
<div class="block"><span>Pass percentage</span><div class="pass-percentage">0 %</div><br></div>
<div class="block"><span>Run duration</span><div class="test-run-time">16s 554ms</div><br></div><br></div>
<h2>Failed Results</h2>
<div class="list-row" onclick="ToggleClass('1084027317-failedResult')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="1084027317-failedResult" style="display:block;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>12s 61ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//a[text()='Nástroje']"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 31
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<h2>All Results</h2>
<div class="list-row" onclick="ToggleClass('1084027317')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="1084027317" style="display:none;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>12s 61ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//a[text()='Nástroje']"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 31
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<div>
<h2>Informational messages</h2><span>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 7.0.2)</span><br><span>[xUnit.net 00:00:02.05] Discovering: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:02.15] Discovered: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:02.15] Starting: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:14.38] OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//a[text()='Nástroje']"}
(Session info: chrome=110.0.5481.77)</span><br><span>[xUnit.net 00:00:14.38] Stack Trace:</span><br><span>[xUnit.net 00:00:14.38] at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)</span><br><span>[xUnit.net 00:00:14.38] at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)</span><br><span>[xUnit.net 00:00:14.38] at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)</span><br><span>[xUnit.net 00:00:14.38] at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)</span><br><span>[xUnit.net 00:00:14.38] at OpenQA.Selenium.By.FindElement(ISearchContext context)</span><br><span>[xUnit.net 00:00:14.38] at OpenQA.Selenium.WebDriver.FindElement(By by)</span><br><span>[xUnit.net 00:00:14.38] c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs(31,0): at Google_Search_xUnit.UnitTest1.Test1()</span><br><span>[xUnit.net 00:00:14.38] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)</span><br><span>[xUnit.net 00:00:14.38] at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</span><br><span>[xUnit.net 00:00:14.40] Finished: Google_Search_xUnit</span><br></div>
<div>
<h2>Error and Warning messages</h2><span>[xUnit.net 00:00:14.38] Google_Search_xUnit.UnitTest1.Test1 [FAIL]</span><br></div>
</body><script language="javascript">
function ToggleClass(id) {
var elem = document.getElementById(id);
if (elem.style.display == "none") {
elem.style.display = "block";
}
else {
elem.style.display = "none";
}
}
</script><style>
body { font-family: Calibri, Verdana, Arial, sans-serif; background-color: White; color: Black; }
h2 {
margin-top: 15px;
margin-bottom:10px;
}
pre {
white-space: pre-wrap;
}
.summary {font-family:monospace;
display: -webkit-flex; /* Safari */
-webkit-flex-wrap: wrap; /* Safari 6.1+ */
display: flex;
flex-wrap: wrap;
}
.row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#d7e9fa;
}
.list-row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#ffffff;
}
.inner-row{
border: 2px solid #ffffff;
padding-left:1%;
margin-left:1%;
background-color:#ffffff;
}
.block{
width : 150px;
}
.leaf-division{
border: 2px solid #ffffff;
background-color:#e6eff7;
}
.pass { color: #0c0; }
.fail { color: #c00; }
.error-message { color : brown; }
.error-stack-trace { color: brown; }
.duration {float:right;padding-right:1%;}
.total-tests { font-size : 30px}
.test-run-time { font-size : 30px}
.pass-percentage { font-size : 30px}
.error-info{
margin-left:16px;
}
</style>
</html>

View File

@ -0,0 +1,116 @@
<html xmlns:tp="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.ObjectModel" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<body>
<h1>Test run details</h1>
<div class="summary">
<div class="block"><span>Total tests</span><div class="total-tests">1</div><br></div>
<div class="block"><span>Passed  : </span><span class="passedTests">0</span><br><span>Failed  : </span><span class="failedTests">1</span><br><span>Skipped : </span><span class="skippedTests">0</span><br></div>
<div class="block"><span>Pass percentage</span><div class="pass-percentage">0 %</div><br></div>
<div class="block"><span>Run duration</span><div class="test-run-time">18s 946ms</div><br></div><br></div>
<h2>Failed Results</h2>
<div class="list-row" onclick="ToggleClass('1799405191-failedResult')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="1799405191-failedResult" style="display:block;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>14s 312ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//a[text()='Nástroje']"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 33
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<h2>All Results</h2>
<div class="list-row" onclick="ToggleClass('1799405191')">c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\bin\Debug\net7.0\Google_Search_xUnit.dll</div>
<div class="inner-row" Id="1799405191" style="display:none;">
<div class="leaf-division">
<div><span class="fail"></span><span> Google_Search_xUnit.UnitTest1.Test1</span><div class="duration"><span>14s 312ms</span><br></div>
</div>
<div class="error-info">
Error: <span class="error-message"><pre>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//a[text()='Nástroje']"}
(Session info: chrome=110.0.5481.77)</pre></span><br>
Stack trace: <span class="error-stack-trace"><pre> at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at Google_Search_xUnit.UnitTest1.Test1() in c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs:line 33
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</pre></span><br></div>
</div>
</div>
<div>
<h2>Informational messages</h2><span>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 7.0.2)</span><br><span>[xUnit.net 00:00:02.51] Discovering: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:02.60] Discovered: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:02.61] Starting: Google_Search_xUnit</span><br><span>[xUnit.net 00:00:17.06] OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//a[text()='Nástroje']"}
(Session info: chrome=110.0.5481.77)</span><br><span>[xUnit.net 00:00:17.06] Stack Trace:</span><br><span>[xUnit.net 00:00:17.06] at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)</span><br><span>[xUnit.net 00:00:17.06] at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)</span><br><span>[xUnit.net 00:00:17.06] at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)</span><br><span>[xUnit.net 00:00:17.06] at OpenQA.Selenium.By.&lt;.ctor&gt;b__11_0(ISearchContext context)</span><br><span>[xUnit.net 00:00:17.06] at OpenQA.Selenium.By.FindElement(ISearchContext context)</span><br><span>[xUnit.net 00:00:17.06] at OpenQA.Selenium.WebDriver.FindElement(By by)</span><br><span>[xUnit.net 00:00:17.06] c:\Testing.Net\GitHub\Testing\xUnit\Google_Search_xUnit\UnitTest1.cs(33,0): at Google_Search_xUnit.UnitTest1.Test1()</span><br><span>[xUnit.net 00:00:17.06] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)</span><br><span>[xUnit.net 00:00:17.06] at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)</span><br><span>[xUnit.net 00:00:17.08] Finished: Google_Search_xUnit</span><br></div>
<div>
<h2>Error and Warning messages</h2><span>[xUnit.net 00:00:17.06] Google_Search_xUnit.UnitTest1.Test1 [FAIL]</span><br></div>
</body><script language="javascript">
function ToggleClass(id) {
var elem = document.getElementById(id);
if (elem.style.display == "none") {
elem.style.display = "block";
}
else {
elem.style.display = "none";
}
}
</script><style>
body { font-family: Calibri, Verdana, Arial, sans-serif; background-color: White; color: Black; }
h2 {
margin-top: 15px;
margin-bottom:10px;
}
pre {
white-space: pre-wrap;
}
.summary {font-family:monospace;
display: -webkit-flex; /* Safari */
-webkit-flex-wrap: wrap; /* Safari 6.1+ */
display: flex;
flex-wrap: wrap;
}
.row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#d7e9fa;
}
.list-row {
border: 2px solid #ffffff;
width:100%;
cursor:pointer;
background-color:#ffffff;
}
.inner-row{
border: 2px solid #ffffff;
padding-left:1%;
margin-left:1%;
background-color:#ffffff;
}
.block{
width : 150px;
}
.leaf-division{
border: 2px solid #ffffff;
background-color:#e6eff7;
}
.pass { color: #0c0; }
.fail { color: #c00; }
.error-message { color : brown; }
.error-stack-trace { color: brown; }
.duration {float:right;padding-right:1%;}
.total-tests { font-size : 30px}
.test-run-time { font-size : 30px}
.pass-percentage { font-size : 30px}
.error-info{
margin-left:16px;
}
</style>
</html>

View File

@ -0,0 +1,51 @@
using Xunit;
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace Google_Search_xUnit;
public class UnitTest1
{
[Fact]
public void Test1()
{
// Otevře stránku google
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.google.com");
driver.Manage().Window.Maximize();
// zamítne cookies google (odmítnout vše)
IWebElement addButton = driver.FindElement(By.Id("W0wltc"));
addButton.Click();
// napíše slovo test do vyhledávání a potvrdí
IWebElement searchBox = driver.FindElement(By.Name("q"));
searchBox.SendKeys("test");
searchBox.Submit();
Thread.Sleep(1000);
IWebElement zpet = driver.FindElement(By.Id("logo"));
zpet.Click();
// IWebElement gearButton = driver.FindElement(By.CssSelector("[class='your-css-class']"));
//gearButton.Click();
Thread.Sleep(2000);
driver.Quit();
}
}

View File

@ -0,0 +1 @@
global using Xunit;

View File

@ -0,0 +1,3 @@
@echo off
dotnet test --logger:"html;LogFilePath=testresults.html"

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "net7.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.0"
}
}
}

Some files were not shown because too many files have changed in this diff Show More