Git Product home page Git Product logo

cezarypiatek / tellurium Goto Github PK

View Code? Open in Web Editor NEW
34.0 8.0 18.0 18.34 MB

A utility pack to create maintainable and reliable UI tests using Selenium with additional support for ASP.NET MVC projects.

License: MIT License

C# 76.01% CSS 0.77% HTML 13.21% JavaScript 5.14% Batchfile 0.11% PowerShell 4.69% Dockerfile 0.06% ASP.NET 0.02%
uitests uitest selenium asp net-mvc aspnet-mvc maintainable

tellurium's Introduction

Logo

Tellurium (aka Maintainable Selenium) Tweet

Build status

A utility pack to create maintainable UI tests using Selenium with additional support for ASP.NET MVC projects.

To get know how to use Tellurium check project's Wiki page

Nuget package

Nuget feed with packages from lates build

https://ci.appveyor.com/nuget/maintainableselenium-dhfqs7br0y2v

tellurium's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tellurium's Issues

SeleniumDriverInstaller restore driver in invalid path

Driver path is saved in SeleniumWebdrivers.json relative to Solution location but restored in path relative to project file.

How to reproduce

  1. Install Tellurium.SeleniumDriverInstaller nuget package
  2. Invoke in nuget packge manager console
Install-SeleniumWebDriver -Browser Chrome
  1. Remove Driver directory from your project
  2. Invoke command
Restore-SeleniumWebDriver

Result: Restored webdriver is not in the same directory as the one which was deleted

Source of SeleniumDriverInstaller script are available here https://github.com/cezarypiatek/Tellurium/blob/master/Src/Tools/SeleniumDriverInstaller.psm1

Manager Drivers of Sample.UITest via Nuget

Now Drivers are *.exe files and when I ran Sample for first time, test failed cause driver was out of date.
With having them in Nuget we can easily update them by updating nuget package version to newest.

Error during taking screenshot for assertion

Offset within element cannot be scrolled into view: (1035, 74.5): [object HTMLInputElement] (34)
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteMouse.MouseMove(ICoordinates where)
   at OpenQA.Selenium.Interactions.CompositeAction.Perform()
   at Tellurium.MvcPages.SeleniumUtils.SeleniumExtensions.HoverOn(RemoteWebDriver driver, IWebElement elementToHover) in C:\projects\maintainableselenium\Src\MvcPages\SeleniumUtils\SeleniumExtensions.cs:line 299
   at Tellurium.MvcPages.BrowserCamera.BrowserCamera.TakeScreenshot() in C:\projects\maintainableselenium\Src\MvcPages\BrowserCamera\BrowserCamera.cs:line 41
   at Tellurium.VisualAssertions.Screenshots.VisualAssertionsService.CheckViewWithPattern(IBrowserCamera browserCamera, String viewName) in C:\projects\maintainableselenium\Src\VisualAssertions\Screenshots\VisualAssertionsService.cs:line 57

The newest version of webdriver is not installed by default using SeleniumWebdriverInstaller

The following command should install the newest version of webdriver but does not (random version is selected). The same for others drivers.

Install-SeleniumWebDriver  -Browser Firefox -Version v0.19.0 -Platform win64

However this command list all driver versions in proper order

Get-SeleniumWebDriverVersions -Browser Firefox
Driver  Version     Platform
------  -------     --------
Firefox v0.19.0     arm7hf  
Firefox v0.19.0     linux32 
Firefox v0.19.0     linux64 
Firefox v0.19.0     macos   
Firefox v0.19.0     win64   
Firefox v0.18.0     arm7hf  
Firefox v0.18.0     linux32 
Firefox v0.18.0     linux64 
Firefox v0.18.0     macos   
Firefox v0.18.0     win32   
Firefox v0.18.0     win64   
Firefox v0.17.0     arm7hf  
Firefox v0.17.0     linux32 
Firefox v0.17.0     linux64 
Firefox v0.17.0     macos   
Firefox v0.17.0     win32   
Firefox v0.17.0     win64   
Firefox v0.16.1     arm7hf  

Source of SeleniumDriverInstaller script are available here https://github.com/cezarypiatek/Tellurium/blob/master/Src/Tools/SeleniumDriverInstaller.psm1

Add support for downloading files

http://selenium-python.readthedocs.io/faq.html#how-to-auto-save-files-using-custom-firefox-profile
https://stackoverflow.com/questions/27824124/how-to-change-file-download-location-in-webdriver-while-using-chrome-driver-fire

Map chromePrefs = new HashMap();
chromePrefs.put(“profile.default_content_settings.popups”, 2);
chromePrefs.put(“download.default_directory”, getFilePath());
ChromeOptions options = new ChromeOptions();
//Map chromeOptionsMap = new HashMap();
options.setExperimentalOption(“prefs”, chromePrefs);
options.addArguments(“–test-type”);
capability = DesiredCapabilities.chrome();
capability.setCapability(“chrome.switches”, Arrays.asList(“–start-maximized,–ignore-certificate-error”));
capability.setCapability(ChromeOptions.CAPABILITY, options);
//capability.setCapability(ChromeOptions.CAPABILITY, chromeOptionsMap);

Move DownloadDrivers.psm1 to separated nuget package

Things to accomplish this issue:

  1. Create a separated nuget package with DownloadDrivers.psm1 (name proposal: Tellurium.SeleniumDriversInstaller)
  2. Add parameter that allows to select driver architecture (x86 and x64)
  3. Add parameter that allows to select driver version
  4. Add command that allows to list all available versions of given driver
  5. Configure package deployment

The purpose of this issue is to simplify driver installation from the official sources.

Add smart changes detection

VisualAssertion should be able to detect that more than screenshot is affected with the same change (ex. layout change). It could be very helpful to mark as pattern all test result affected with the same change.

Cannot create legacy driver for Firefox

Cannot create driver for Firefox 47.0.1

System.NullReferenceException : Object reference not set to an instance of an object.
   at Tellurium.MvcPages.BrowserCamera.Lens.BrowserCameraLensFactory.IsHeadlessFirefox(RemoteWebDriver webDriver) in C:\projects\maintainableselenium\src\MvcPages\BrowserCamera\Lens\BrowserCameraLensFactory.cs:line 45
   at Tellurium.MvcPages.BrowserCamera.Lens.BrowserCameraLensFactory.CreateLensForAutoMode(RemoteWebDriver webDriver) in C:\projects\maintainableselenium\src\MvcPages\BrowserCamera\Lens\BrowserCameraLensFactory.cs:line 40
   at Tellurium.MvcPages.BrowserCamera.BrowserCameraFactory.CreateNew(RemoteWebDriver driver, BrowserCameraConfig cameraConfig) in C:\projects\maintainableselenium\src\MvcPages\BrowserCamera\BrowserCameraFactory.cs:line 10
   at Tellurium.MvcPages.BrowserAdapter.Create(BrowserAdapterConfig config, RemoteWebDriver driver) in C:\projects\maintainableselenium\src\MvcPages\BrowserAdapter.cs:line 58
   at Ailleron.EFL.UITest.UITests.RunTestForCategory(String categoryName, Action`1 testAction) in C:\TeamCityAgents\AgentMoa1\work\eace9c548cfcf1b2\src\EFL\EFL.UITest\UITests.cs:line 55

Migrate to SeleniumHQ 3

  1. Update nuget package to Selenium 3
  2. Update script for downloading webdrivers (add geckodriver)

Create installer for VisualAssertion Dashboard

It could be convenient to install Dashboard application https://github.com/cezarypiatek/Tellurium/tree/master/Src/Dashboard using dedicated installer instead of manually executing the following steps:

  1. Extract Dashboard files into installation directory
  2. Make modification to configuration files:
    • set port (appsettings.json)
    • set connection string to database (app.config)
  3. Register app as windows service

Currently this app is released as zip file. I think about replacing it (or add as and alternative) with installer build with WIX http://wixtoolset.org/documentation/

Registering Dashboard application as a windows service is already implemented with Topshelf .
https://github.com/cezarypiatek/Tellurium/blob/master/Src/Dashboard/Program.cs

TelluriumDashboard.exe install -servicename "TelluriumDashboard"
TelluriumDashboard.exe start

Improve logging test result for TeamCity

  1. Upload Error Screenshot as a build artifact
  2. Generate file with report which could be attached as a custom tab
  3. Add report tab for VisualAsserions
  4. Add Unique id for test result

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.