cezarypiatek / tellurium Goto Github PK
View Code? Open in Web Editor NEWA utility pack to create maintainable and reliable UI tests using Selenium with additional support for ASP.NET MVC projects.
License: MIT License
A utility pack to create maintainable and reliable UI tests using Selenium with additional support for ASP.NET MVC projects.
License: MIT License
Create fullpage screenshots in Chrome >59 according to this solution implemented in Java:
https://stackoverflow.com/questions/45199076/take-full-page-screen-shot-in-chrome-with-selenium
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
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
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.
https://www.w3.org/WAI/intro/aria
Take account aria-labelledby attribute
Now it does not work for SampleUITest for Firefox.
There is need to switch to geckodriver:
I have tried but had not luck, and my time run out.
@cezarypiatek btw which version of FF (x86, x64) are you using? There are different drivers and I think we should stick to the one that you have.
Things to accomplish this issue:
The purpose of this issue is to simplify driver installation from the official sources.
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:
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
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.
Something like "mark as pattern" for given region
There is a need to make Dashboard as a self-hosted website. Migrate VisualAssertion.Dashboard to ASP.NET Core. It should work as a window service https://codeopinion.com/self-host-asp-net-web-api-as-a-windows-service/
Driver path is saved in SeleniumWebdrivers.json relative to Solution location but restored in path relative to project file.
How to reproduce
Install-SeleniumWebDriver -Browser Chrome
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
It could be helpful to mark as pattern all selected tests
Dashboard -> patterns
Consider if Chrome headless should be added as a separated browser to available browsers list.
For Chrome and Opera try to use DOM.setFileInputFiles from RemoteInterface:
https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setFileInputFiles
Sample usage could be found here:
cyrus-and/chrome-remote-interface#164
More about Chrome RI:
https://github.com/cyrus-and/chrome-remote-interface
https://github.com/MasterDevs/ChromeDevTools
@cezarypiatek What do you think about this idea?
Latest builds are failing if we want to fix them then why not to keep everything in one place (code + build pipelines in github)?
Please add it to wiki
This file should be saved in project directory instead of solution directory (every project should be able to have own version of SeleniumWebdrivers.json).
Source of SeleniumDriverInstaller script are available here https://github.com/cezarypiatek/Tellurium/blob/master/Src/Tools/SeleniumDriverInstaller.psm1
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
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);
Create browser extension that allows to stream page content during test session
https://www.html5rocks.com/en/tutorials/streaming/screenshare/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.