C#
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/.vs/xUnit_Lukan/v17/.futdcache.v2
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/.vs/xUnit_Lukan/v17/.futdcache.v2
Normal file
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/.vs/xUnit_Lukan/v17/.suo
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/.vs/xUnit_Lukan/v17/.suo
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,82 @@
|
||||
<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">1</span><br><span>Failed : </span><span class="failedTests">0</span><br><span>Skipped : </span><span class="skippedTests">0</span><br></div>
|
||||
<div class="block"><span>Pass percentage</span><div class="pass-percentage">100 %</div><br></div>
|
||||
<div class="block"><span>Run duration</span><div class="test-run-time">51s 335ms</div><br></div><br></div>
|
||||
<h2>All Results</h2>
|
||||
<div class="list-row" onclick="ToggleClass('-398008626')">c:\Testing.Net\GitHub\Testing\xUnit\xUnit_Lukan\bin\Debug\net7.0\xUnit_Lukan.dll</div>
|
||||
<div class="inner-row" Id="-398008626" style="display:none;">
|
||||
<div class="leaf-division">
|
||||
<div><span class="pass">✔</span><span> xUnit.NET.UnitTest1.Test1</span><div class="duration"><span>29s 665ms</span><br></div>
|
||||
</div>
|
||||
<div class="error-info"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Informational messages</h2><span>[xUnit.net 00:00:00.02] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 7.0.2)</span><br><span>[xUnit.net 00:00:12.03] Discovering: xUnit_Lukan</span><br><span>[xUnit.net 00:00:12.13] Discovered: xUnit_Lukan</span><br><span>[xUnit.net 00:00:12.14] Starting: xUnit_Lukan</span><br><span>[xUnit.net 00:00:42.19] Finished: xUnit_Lukan</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>
|
66
Testing_Win/xUnit/xUnit_Lukan/UnitTest1.cs
Normal file
66
Testing_Win/xUnit/xUnit_Lukan/UnitTest1.cs
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
using Xunit;
|
||||
using System;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Chrome;
|
||||
using Xunit.Abstractions;
|
||||
using Xunit.Sdk;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace xUnit.NET
|
||||
{
|
||||
|
||||
|
||||
public class UnitTest1
|
||||
{
|
||||
String test_url = "https://lukan.cz/";
|
||||
String itemName = "Lukáš Bloguje";
|
||||
|
||||
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
/*
|
||||
Logger.Info("Running test MyTest");
|
||||
logger.Info("Test method 1 started");
|
||||
logger.Info("Test method 1 completed");
|
||||
*/
|
||||
|
||||
|
||||
IWebDriver driver;
|
||||
|
||||
driver = new ChromeDriver();
|
||||
driver.Navigate().GoToUrl(test_url);
|
||||
driver.Manage().Window.Maximize();
|
||||
|
||||
Console.Write("Začátek testu");
|
||||
|
||||
// Zkkontroluje nadpis webu
|
||||
Assert.Equal("Lukáš bloguje - Blog o všem možném i nemožném", driver.Title);
|
||||
|
||||
// Clikne na tlačítko
|
||||
IWebElement addButton = driver.FindElement(By.Id("menu-item-79"));
|
||||
addButton.Click();
|
||||
|
||||
Assert.Equal("O mně - Lukáš bloguje", driver.Title);
|
||||
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// vrátí mě na hlavní stránku
|
||||
IWebElement hlavniButton = driver.FindElement(By.Id("menu-item-75"));
|
||||
|
||||
// Počká tři sekundy na další akci
|
||||
Thread.Sleep(3000);
|
||||
|
||||
Console.Write("Dotestováno");
|
||||
|
||||
driver.Quit();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
1
Testing_Win/xUnit/xUnit_Lukan/Usings.cs
Normal file
1
Testing_Win/xUnit/xUnit_Lukan/Usings.cs
Normal file
@ -0,0 +1 @@
|
||||
global using Xunit;
|
5
Testing_Win/xUnit/xUnit_Lukan/bash.bat
Normal file
5
Testing_Win/xUnit/xUnit_Lukan/bash.bat
Normal file
@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
dotnet test --logger:"html;LogFilePath=testresults.html;"
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/NLog.dll
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/NLog.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/WebDriver.dll
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/WebDriver.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
Výstup testu
|
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/testhost.dll
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/testhost.dll
Normal file
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/testhost.exe
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/testhost.exe
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1709
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xUnit_Lukan.deps.json
Normal file
1709
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xUnit_Lukan.deps.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xUnit_Lukan.dll
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xUnit_Lukan.dll
Normal file
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xUnit_Lukan.pdb
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xUnit_Lukan.pdb
Normal file
Binary file not shown.
@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net7.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "7.0.0"
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xunit.assert.dll
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xunit.assert.dll
Normal file
Binary file not shown.
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xunit.core.dll
Normal file
BIN
Testing_Win/xUnit/xUnit_Lukan/bin/Debug/net7.0/xunit.core.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user