Skip to content

Commit 3410f85

Browse files
committed
First commit
0 parents  commit 3410f85

File tree

97 files changed

+6569
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+6569
-0
lines changed

.vs/SeleniumBoilerplate/v16/.suo

14.5 KB
Binary file not shown.

SeleniumBoilerplate.sln

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31313.79
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeleniumBoilerplate", "SeleniumBoilerplate\SeleniumBoilerplate.csproj", "{8AE5D0D2-E488-4E82-84FF-2B205C065993}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{8AE5D0D2-E488-4E82-84FF-2B205C065993}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{8AE5D0D2-E488-4E82-84FF-2B205C065993}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{8AE5D0D2-E488-4E82-84FF-2B205C065993}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{8AE5D0D2-E488-4E82-84FF-2B205C065993}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {02C932D6-F3E8-415C-939E-98F44820A5E8}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace SeleniumBoilerplate.PageObjects
6+
{
7+
class SimplePage
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using Xunit;
5+
6+
namespace SeleniumBoilerplate.Scenarios
7+
{
8+
public class SimplePageTests : IClassFixture<StartupFixture>
9+
{
10+
StartupFixture fixture;
11+
12+
public SimplePageTests(StartupFixture fixture)
13+
{
14+
this.fixture = fixture;
15+
}
16+
17+
[Fact]
18+
public void AbrirNavegador()
19+
{
20+
var browser = fixture.InicializaDriver("chrome");
21+
22+
browser.Navigate().GoToUrl("www.google.com");
23+
}
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
11+
<PackageReference Include="Selenium.Chrome.WebDriver" Version="85.0.0" />
12+
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
13+
<PackageReference Include="xunit" Version="2.4.1" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
<PrivateAssets>all</PrivateAssets>
17+
</PackageReference>
18+
<PackageReference Include="coverlet.collector" Version="1.3.0">
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
<PrivateAssets>all</PrivateAssets>
21+
</PackageReference>
22+
</ItemGroup>
23+
24+
</Project>

SeleniumBoilerplate/StartupFixture.cs

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using OpenQA.Selenium;
2+
using OpenQA.Selenium.Chrome;
3+
using OpenQA.Selenium.Firefox;
4+
using System;
5+
using System.IO;
6+
using Xunit;
7+
8+
namespace SeleniumBoilerplate
9+
{
10+
public class StartupFixture : IDisposable
11+
{
12+
IWebDriver _driver;
13+
private char separador = Path.PathSeparator;
14+
15+
public IWebDriver InicializaDriver(string browser)
16+
{
17+
switch (browser)
18+
{
19+
case "chrome":
20+
_driver = new ChromeDriver();
21+
break;
22+
case "firefox":
23+
_driver = new FirefoxDriver();
24+
break;
25+
default:
26+
Console.WriteLine("Browser não é suportado!");
27+
break;
28+
}
29+
30+
return _driver;
31+
}
32+
33+
public void Dispose()
34+
{
35+
Screenshot screenshot = (_driver as ITakesScreenshot).GetScreenshot();
36+
37+
string ScreenshotDir = Path.Combine($"{Directory.GetCurrentDirectory()}{separador}Evidencias");
38+
39+
screenshot.SaveAsFile($"{ScreenshotDir}{DateTime.Now}", ScreenshotImageFormat.Png);
40+
41+
_driver.Quit();
42+
}
43+
}
44+
}
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// <autogenerated />
2+
using System;
3+
using System.Reflection;
4+
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// O código foi gerado por uma ferramenta.
4+
// Versão de Tempo de Execução:4.0.30319.42000
5+
//
6+
// As alterações ao arquivo poderão causar comportamento incorreto e serão perdidas se
7+
// o código for gerado novamente.
8+
// </auto-generated>
9+
//------------------------------------------------------------------------------
10+
11+
using System;
12+
using System.Reflection;
13+
14+
[assembly: System.Reflection.AssemblyCompanyAttribute("SeleniumBoilerplate")]
15+
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
16+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
17+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
18+
[assembly: System.Reflection.AssemblyProductAttribute("SeleniumBoilerplate")]
19+
[assembly: System.Reflection.AssemblyTitleAttribute("SeleniumBoilerplate")]
20+
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
21+
22+
// Gerado pela classe WriteCodeFragment do MSBuild.
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6eec6f067df7d818085626409cdbbe6022db43fc
Binary file not shown.

SeleniumBoilerplate/obj/Debug/netcoreapp3.1/SeleniumBoilerplate.csproj.CopyComplete

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"format": 1,
3+
"restore": {
4+
"C:\\Users\\Pichau\\source\\repos\\SeleniumBoilerplate\\SeleniumBoilerplate\\SeleniumBoilerplate.csproj": {}
5+
},
6+
"projects": {
7+
"C:\\Users\\Pichau\\source\\repos\\SeleniumBoilerplate\\SeleniumBoilerplate\\SeleniumBoilerplate.csproj": {
8+
"version": "1.0.0",
9+
"restore": {
10+
"projectUniqueName": "C:\\Users\\Pichau\\source\\repos\\SeleniumBoilerplate\\SeleniumBoilerplate\\SeleniumBoilerplate.csproj",
11+
"projectName": "SeleniumBoilerplate",
12+
"projectPath": "C:\\Users\\Pichau\\source\\repos\\SeleniumBoilerplate\\SeleniumBoilerplate\\SeleniumBoilerplate.csproj",
13+
"packagesPath": "C:\\Users\\Pichau\\.nuget\\packages\\",
14+
"outputPath": "C:\\Users\\Pichau\\source\\repos\\SeleniumBoilerplate\\SeleniumBoilerplate\\obj\\",
15+
"projectStyle": "PackageReference",
16+
"configFilePaths": [
17+
"C:\\Users\\Pichau\\AppData\\Roaming\\NuGet\\NuGet.Config",
18+
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
19+
],
20+
"originalTargetFrameworks": [
21+
"netcoreapp3.1"
22+
],
23+
"sources": {
24+
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
25+
"https://api.nuget.org/v3/index.json": {}
26+
},
27+
"frameworks": {
28+
"netcoreapp3.1": {
29+
"targetAlias": "netcoreapp3.1",
30+
"projectReferences": {}
31+
}
32+
},
33+
"warningProperties": {
34+
"warnAsError": [
35+
"NU1605"
36+
]
37+
}
38+
},
39+
"frameworks": {
40+
"netcoreapp3.1": {
41+
"targetAlias": "netcoreapp3.1",
42+
"dependencies": {
43+
"Microsoft.NET.Test.Sdk": {
44+
"target": "Package",
45+
"version": "[16.7.1, )"
46+
},
47+
"Selenium.Chrome.WebDriver": {
48+
"target": "Package",
49+
"version": "[85.0.0, )"
50+
},
51+
"Selenium.WebDriver": {
52+
"target": "Package",
53+
"version": "[3.141.0, )"
54+
},
55+
"coverlet.collector": {
56+
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
57+
"suppressParent": "All",
58+
"target": "Package",
59+
"version": "[1.3.0, )"
60+
},
61+
"xunit": {
62+
"target": "Package",
63+
"version": "[2.4.1, )"
64+
},
65+
"xunit.runner.visualstudio": {
66+
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
67+
"suppressParent": "All",
68+
"target": "Package",
69+
"version": "[2.4.3, )"
70+
}
71+
},
72+
"imports": [
73+
"net461",
74+
"net462",
75+
"net47",
76+
"net471",
77+
"net472",
78+
"net48"
79+
],
80+
"assetTargetFallback": true,
81+
"warn": true,
82+
"frameworkReferences": {
83+
"Microsoft.NETCore.App": {
84+
"privateAssets": "all"
85+
}
86+
},
87+
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.203\\RuntimeIdentifierGraph.json"
88+
}
89+
}
90+
}
91+
}
92+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
4+
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
5+
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
6+
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
7+
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
8+
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Pichau\.nuget\packages\</NuGetPackageFolders>
9+
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
10+
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.1</NuGetToolVersion>
11+
</PropertyGroup>
12+
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
13+
<SourceRoot Include="C:\Users\Pichau\.nuget\packages\" />
14+
</ItemGroup>
15+
<PropertyGroup>
16+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
17+
</PropertyGroup>
18+
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
19+
<Import Project="$(NuGetPackageRoot)xunit.runner.visualstudio\2.4.3\build\netcoreapp2.1\xunit.runner.visualstudio.props" Condition="Exists('$(NuGetPackageRoot)xunit.runner.visualstudio\2.4.3\build\netcoreapp2.1\xunit.runner.visualstudio.props')" />
20+
<Import Project="$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.props" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.props')" />
21+
<Import Project="$(NuGetPackageRoot)microsoft.testplatform.testhost\16.7.1\build\netcoreapp2.1\Microsoft.TestPlatform.TestHost.props" Condition="Exists('$(NuGetPackageRoot)microsoft.testplatform.testhost\16.7.1\build\netcoreapp2.1\Microsoft.TestPlatform.TestHost.props')" />
22+
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\16.7.1\build\netstandard1.0\Microsoft.CodeCoverage.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\16.7.1\build\netstandard1.0\Microsoft.CodeCoverage.props')" />
23+
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\16.7.1\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\16.7.1\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.props')" />
24+
</ImportGroup>
25+
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
26+
<Pkgxunit_analyzers Condition=" '$(Pkgxunit_analyzers)' == '' ">C:\Users\Pichau\.nuget\packages\xunit.analyzers\0.10.0</Pkgxunit_analyzers>
27+
<PkgNewtonsoft_Json Condition=" '$(PkgNewtonsoft_Json)' == '' ">C:\Users\Pichau\.nuget\packages\newtonsoft.json\10.0.3</PkgNewtonsoft_Json>
28+
</PropertyGroup>
29+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
5+
</PropertyGroup>
6+
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
7+
<Import Project="$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.targets" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.targets')" />
8+
<Import Project="$(NuGetPackageRoot)selenium.chrome.webdriver\85.0.0\build\Selenium.Chrome.WebDriver.targets" Condition="Exists('$(NuGetPackageRoot)selenium.chrome.webdriver\85.0.0\build\Selenium.Chrome.WebDriver.targets')" />
9+
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\16.7.1\build\netstandard1.0\Microsoft.CodeCoverage.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\16.7.1\build\netstandard1.0\Microsoft.CodeCoverage.targets')" />
10+
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\16.7.1\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\16.7.1\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.targets')" />
11+
<Import Project="$(NuGetPackageRoot)coverlet.collector\1.3.0\build\netstandard1.0\coverlet.collector.targets" Condition="Exists('$(NuGetPackageRoot)coverlet.collector\1.3.0\build\netstandard1.0\coverlet.collector.targets')" />
12+
</ImportGroup>
13+
</Project>

0 commit comments

Comments
 (0)