C#
This commit is contained in:
20
Testing_Ubuntu/Nunit/Lukan/Lukan.csproj
Normal file
20
Testing_Ubuntu/Nunit/Lukan/Lukan.csproj
Normal file
@ -0,0 +1,20 @@
|
||||
<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="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
||||
<PackageReference Include="Selenium.WebDriver" Version="4.8.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
1
Testing_Ubuntu/Nunit/Lukan/Usings.cs
Normal file
1
Testing_Ubuntu/Nunit/Lukan/Usings.cs
Normal file
@ -0,0 +1 @@
|
||||
global using NUnit.Framework;
|
52
Testing_Ubuntu/Nunit/Lukan/lukan.cs
Normal file
52
Testing_Ubuntu/Nunit/Lukan/lukan.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Chrome;
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using System.Threading;
|
||||
|
||||
namespace Lukan;
|
||||
|
||||
public class Tests
|
||||
{
|
||||
IWebDriver driver = new ChromeDriver();
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
driver.Navigate()
|
||||
.GoToUrl("https://lukan.cz");
|
||||
//Maximize the browser window
|
||||
driver.Manage().Window.Maximize();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test1()
|
||||
{
|
||||
// přijetí cookies
|
||||
IWebElement cookies = driver.FindElement(By.XPath("//div[2]/span"));
|
||||
cookies.Click();
|
||||
// odmitnuti xpath=//div[3]/span
|
||||
|
||||
|
||||
//zkontroluje nadpis webu
|
||||
string actualTitle = driver.Title;
|
||||
string expectedTitle = "Lukáš bloguje - Blog o všem možném i nemožném";
|
||||
Assert.AreEqual(expectedTitle, actualTitle);
|
||||
|
||||
// přejde na O_mne
|
||||
IWebElement o_mne = driver.FindElement(By.Id(""));
|
||||
o_mne.Click();
|
||||
|
||||
Thread.Sleep(3000);
|
||||
|
||||
Console.Write("Test prošel");
|
||||
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void EndTest()
|
||||
{
|
||||
//close the browser
|
||||
driver.Close();
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
|
@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Lukan")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Lukan")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Lukan")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Vygenerované třídou WriteCodeFragment nástroje MSBuild
|
||||
|
@ -0,0 +1 @@
|
||||
3dac3a9f713a6a2abbc62a6900437e8318dda209
|
@ -0,0 +1,11 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net7.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = Lukan
|
||||
build_property.ProjectDir = /home/kankys/dev/Testing_Ubuntu/Nunit/Lukan/
|
@ -0,0 +1,8 @@
|
||||
// <auto-generated/>
|
||||
global using global::System;
|
||||
global using global::System.Collections.Generic;
|
||||
global using global::System.IO;
|
||||
global using global::System.Linq;
|
||||
global using global::System.Net.Http;
|
||||
global using global::System.Threading;
|
||||
global using global::System.Threading.Tasks;
|
BIN
Testing_Ubuntu/Nunit/Lukan/obj/Debug/net7.0/Lukan.assets.cache
Normal file
BIN
Testing_Ubuntu/Nunit/Lukan/obj/Debug/net7.0/Lukan.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,87 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"/home/kankys/dev/Testing_Ubuntu/Nunit/Lukan/Lukan.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"/home/kankys/dev/Testing_Ubuntu/Nunit/Lukan/Lukan.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/kankys/dev/Testing_Ubuntu/Nunit/Lukan/Lukan.csproj",
|
||||
"projectName": "Lukan",
|
||||
"projectPath": "/home/kankys/dev/Testing_Ubuntu/Nunit/Lukan/Lukan.csproj",
|
||||
"packagesPath": "/home/kankys/.nuget/packages/",
|
||||
"outputPath": "/home/kankys/dev/Testing_Ubuntu/Nunit/Lukan/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/kankys/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net7.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net7.0": {
|
||||
"targetAlias": "net7.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net7.0": {
|
||||
"targetAlias": "net7.0",
|
||||
"dependencies": {
|
||||
"Microsoft.NET.Test.Sdk": {
|
||||
"target": "Package",
|
||||
"version": "[17.3.2, )"
|
||||
},
|
||||
"NUnit": {
|
||||
"target": "Package",
|
||||
"version": "[3.13.3, )"
|
||||
},
|
||||
"NUnit.Analyzers": {
|
||||
"target": "Package",
|
||||
"version": "[3.3.0, )"
|
||||
},
|
||||
"NUnit3TestAdapter": {
|
||||
"target": "Package",
|
||||
"version": "[4.2.1, )"
|
||||
},
|
||||
"Selenium.WebDriver": {
|
||||
"target": "Package",
|
||||
"version": "[4.8.0, )"
|
||||
},
|
||||
"coverlet.collector": {
|
||||
"target": "Package",
|
||||
"version": "[3.1.2, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/7.0.102/RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
Testing_Ubuntu/Nunit/Lukan/obj/Lukan.csproj.nuget.g.props
Normal file
25
Testing_Ubuntu/Nunit/Lukan/obj/Lukan.csproj.nuget.g.props
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/kankys/.nuget/packages/</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/kankys/.nuget/packages/</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.4.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="/home/kankys/.nuget/packages/" />
|
||||
</ItemGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)nunit3testadapter/4.2.1/build/netcoreapp2.1/NUnit3TestAdapter.props" Condition="Exists('$(NuGetPackageRoot)nunit3testadapter/4.2.1/build/netcoreapp2.1/NUnit3TestAdapter.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)nunit/3.13.3/build/NUnit.props" Condition="Exists('$(NuGetPackageRoot)nunit/3.13.3/build/NUnit.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.testplatform.testhost/17.3.2/build/netcoreapp2.1/Microsoft.TestPlatform.TestHost.props" Condition="Exists('$(NuGetPackageRoot)microsoft.testplatform.testhost/17.3.2/build/netcoreapp2.1/Microsoft.TestPlatform.TestHost.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage/17.3.2/build/netstandard1.0/Microsoft.CodeCoverage.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage/17.3.2/build/netstandard1.0/Microsoft.CodeCoverage.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk/17.3.2/build/netcoreapp2.1/Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk/17.3.2/build/netcoreapp2.1/Microsoft.NET.Test.Sdk.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgNUnit_Analyzers Condition=" '$(PkgNUnit_Analyzers)' == '' ">/home/kankys/.nuget/packages/nunit.analyzers/3.3.0</PkgNUnit_Analyzers>
|
||||
</PropertyGroup>
|
||||
</Project>
|
10
Testing_Ubuntu/Nunit/Lukan/obj/Lukan.csproj.nuget.g.targets
Normal file
10
Testing_Ubuntu/Nunit/Lukan/obj/Lukan.csproj.nuget.g.targets
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)selenium.webdriver/4.8.0/build/Selenium.WebDriver.targets" Condition="Exists('$(NuGetPackageRoot)selenium.webdriver/4.8.0/build/Selenium.WebDriver.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)netstandard.library/2.0.0/build/netstandard2.0/NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library/2.0.0/build/netstandard2.0/NETStandard.Library.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage/17.3.2/build/netstandard1.0/Microsoft.CodeCoverage.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage/17.3.2/build/netstandard1.0/Microsoft.CodeCoverage.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk/17.3.2/build/netcoreapp2.1/Microsoft.NET.Test.Sdk.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk/17.3.2/build/netcoreapp2.1/Microsoft.NET.Test.Sdk.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)coverlet.collector/3.1.2/build/netstandard1.0/coverlet.collector.targets" Condition="Exists('$(NuGetPackageRoot)coverlet.collector/3.1.2/build/netstandard1.0/coverlet.collector.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
1406
Testing_Ubuntu/Nunit/Lukan/obj/project.assets.json
Normal file
1406
Testing_Ubuntu/Nunit/Lukan/obj/project.assets.json
Normal file
File diff suppressed because it is too large
Load Diff
23
Testing_Ubuntu/Nunit/Lukan/obj/project.nuget.cache
Normal file
23
Testing_Ubuntu/Nunit/Lukan/obj/project.nuget.cache
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "qZtKg00syRLp3LxUDHsMHAOFhrQw4l8zyas7BLB0POcN2oKzIpkDI+W9oYo2QmF3anjZ2LTSZVPMHAQnxsgzng==",
|
||||
"success": true,
|
||||
"projectFilePath": "/home/kankys/dev/Testing_Ubuntu/Nunit/Lukan/Lukan.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"/home/kankys/.nuget/packages/coverlet.collector/3.1.2/coverlet.collector.3.1.2.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/microsoft.codecoverage/17.3.2/microsoft.codecoverage.17.3.2.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/microsoft.net.test.sdk/17.3.2/microsoft.net.test.sdk.17.3.2.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/microsoft.netcore.platforms/1.1.0/microsoft.netcore.platforms.1.1.0.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/microsoft.testplatform.objectmodel/17.3.2/microsoft.testplatform.objectmodel.17.3.2.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/microsoft.testplatform.testhost/17.3.2/microsoft.testplatform.testhost.17.3.2.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/netstandard.library/2.0.0/netstandard.library.2.0.0.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/newtonsoft.json/13.0.1/newtonsoft.json.13.0.1.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/nuget.frameworks/5.11.0/nuget.frameworks.5.11.0.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/nunit/3.13.3/nunit.3.13.3.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/nunit.analyzers/3.3.0/nunit.analyzers.3.3.0.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/nunit3testadapter/4.2.1/nunit3testadapter.4.2.1.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/selenium.webdriver/4.8.0/selenium.webdriver.4.8.0.nupkg.sha512",
|
||||
"/home/kankys/.nuget/packages/system.reflection.metadata/1.6.0/system.reflection.metadata.1.6.0.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
Reference in New Issue
Block a user