Skip to content

Commit

Permalink
Merge pull request #1 from zzzrst/ImplementationOfAutomationTestSetFr…
Browse files Browse the repository at this point in the history
…amework

Implementation of automation test set framework
  • Loading branch information
zzzstr authored Feb 7, 2020
2 parents 48e29ac + dcd1143 commit 95ba4ed
Show file tree
Hide file tree
Showing 134 changed files with 16,676 additions and 1,344 deletions.
6 changes: 6 additions & 0 deletions SeleniumPerfXML.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.28803.202
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SeleniumPerfXML", "SeleniumPerfXML\SeleniumPerfXML.csproj", "{A492DA8B-D8C0-42F7-A00F-4E4D8940D95A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SeleniumPerfXMLNUnitTest", "SeleniumPerfXMLNUnitTest\SeleniumPerfXMLNUnitTest.csproj", "{01DABD79-F79F-43A2-83D8-3366E6A985DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{A492DA8B-D8C0-42F7-A00F-4E4D8940D95A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A492DA8B-D8C0-42F7-A00F-4E4D8940D95A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A492DA8B-D8C0-42F7-A00F-4E4D8940D95A}.Release|Any CPU.Build.0 = Release|Any CPU
{01DABD79-F79F-43A2-83D8-3366E6A985DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01DABD79-F79F-43A2-83D8-3366E6A985DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01DABD79-F79F-43A2-83D8-3366E6A985DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01DABD79-F79F-43A2-83D8-3366E6A985DF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
11 changes: 5 additions & 6 deletions SeleniumPerfXML/Axe/AxeDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace SeleniumPerfXML.Axe
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenQA.Selenium;
using Selenium.Axe;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

/// <summary>
/// This is the driver to deal with Axe.core.
Expand Down Expand Up @@ -62,7 +62,6 @@ public AxeDriver()
/// <param name="providedPageTitle"> Title of the page. </param>
public void CaptureResult(IWebDriver driver, string providedPageTitle)
{

driver.Manage().Window.FullScreen();
AxeResult results = driver.Analyze();

Expand Down Expand Up @@ -165,7 +164,7 @@ public void LogResults(string folderLocation)
string directoryPath = $"{folderLocation}\\Json\\{resultType.Key}";
Directory.CreateDirectory(directoryPath);

using (StreamWriter file = File.CreateText($"{directoryPath}\\{fileName}"))
using (StreamWriter file = File.AppendText($"{directoryPath}\\{fileName}"))
using (JsonTextWriter writer = new JsonTextWriter(file) { Formatting = Formatting.Indented })
{
ruleSummary.WriteTo(writer);
Expand Down
19 changes: 19 additions & 0 deletions SeleniumPerfXML/Axe/IAccessibilityChecker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// <copyright file="IAccessibilityChecker.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>

namespace SeleniumPerfXML.Axe
{
using OpenQA.Selenium;

/// <summary>
/// The Accessibility interface.
/// </summary>
public interface IAccessibilityChecker
{
/// <summary>
/// Gets or sets the webdriver variable.
/// </summary>
public IWebDriver WebDriver { get; set; }
}
}
65 changes: 65 additions & 0 deletions SeleniumPerfXML/Builders/SeleniumDriverBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// <copyright file="SeleniumDriverBuilder.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>

namespace SeleniumPerfXML.Builders
{
using System;
using static SeleniumPerfXML.SeleniumDriver;

/// <summary>
/// Builds a new selenium Driver based on the given variables.
/// </summary>
public class SeleniumDriverBuilder
{
/// <summary>
/// Gets or sets the browser to use.
/// </summary>
public Browser Browser { get; set; }

/// <summary>
/// Gets or sets the time out Threshold.
/// </summary>
public TimeSpan TimeOutThreshold { get; set; }

/// <summary>
/// Gets or sets the Enviornment to use.
/// </summary>
public string Environment { get; set; }

/// <summary>
/// Gets or sets the url to go to.
/// </summary>
public string URL { get; set; }

/// <summary>
/// Gets or sets the location of the Screenshot.
/// </summary>
public string ScreenshotSaveLocation { get; set; }

/// <summary>
/// Gets or sets the error container location.
/// </summary>
public string ErrorContainer { get; set; }

/// <summary>
/// Gets or sets the loading spinner location.
/// </summary>
public string LoadingSpinner { get; set; }

/// <summary>
/// Returns the seleniumDriver based on the given paramenters.
/// </summary>
/// <returns>A new SeleniumDriver.</returns>
public SeleniumDriver BuildSeleniumDriver()
{
SeleniumDriver driver;
driver = new SeleniumDriver(this.Browser, this.TimeOutThreshold, this.Environment, this.URL, this.ScreenshotSaveLocation)
{
ErrorContainer = this.ErrorContainer,
LoadingSpinner = this.LoadingSpinner,
};
return driver;
}
}
}
Loading

0 comments on commit 95ba4ed

Please sign in to comment.