Sunday, December 2, 2018

Web Interface Testing technologies / Mocking / Headless Website Testing

  • A headless browser is a web browser without a graphical user interface.Headless browsers provide automated control of a web page in an environment similar to popular web browsers, but are executed via a command-line interface or using network communication. They are particularly useful for testing web pages as they are able to render and understand HTML the same way a browser would, including styling elements such as page layout, color, font selection and execution of JavaScript and AJAX which are usually not available when using other testing methods.

  • Use cases
    Headless browsers are used for:
        Test automation in modern web applications.
        Taking screenshots of web pages.
        Running automated tests for JavaScript libraries.
        Scraping web sites for data.
        Automating interaction of web pages.
    Headless browsers can also be used to:
        Perform DDOS attacks on web sites.
        Increase advertisement impressions.
        Automate web sites in unintended wayse.g. for Credential stuffing.
    https://en.wikipedia.org/wiki/Headless_browser
Tasty mocking framework for unit tests in Java
https://site.mockito.org/
  • Web Interface Testing technologies
Using Mock Objects
 Spring MVC, StrutsTestCaseJSFUnit
 Good for the controller layer
 Doesn't test the HTML screens themselves
– Writing tests to run against a web application
 HTTPUnit, Cactus, JmeterTestMaker,...
– Run tests from within a real web browser
 Selenium

Mockito is a mocking framework that tastes really good. It lets you write beautiful tests with clean & simple API. Mockito doesn't give you hangover because the tests are very readable and they produce clean verification errors
"We decided during the main conference that we should use JUnit 4 and Mockito because we think they are the future of TDD and mocking in Java" - Dan North, the originator of BDD
http://code.google.com/p/mockito/
  • Mocha is a JavaScript test framework for Node.js programs, featuring browser support, asynchronous testing, test coverage reports, and use of any assertion library

Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases
https://mochajs.org/


  • Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM

Jasmine is an open source testing framework for JavaScript. It aims to run on any JavaScript-enabled platform, to not intrude on the application nor the IDE, and to have easy-to-read syntax. It is heavily influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec.
https://jasmine.github.io/


  • Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful and highly expressive specification language. Thanks to its JUnit runner, Spock is compatible with most IDEs, build tools, and continuous integration servers. Spock is inspired from JUnit, RSpec, jMock, Mockito, Groovy, Scala, Vulcans, and other fascinating life forms.

http://spockframework.org/


  • JMock is a library that supports test-driven development of Java code with mock objects.JMock is a library that supports test-driven development of Java code with mock objects.Mock objects help you design and test the interactions between the objects in your programs

http://jmock.org/


  • EasyMock is an open source testing framework for Java released under the Apache License. The framework allows the creation of test double objects for the purpose of Test-driven Development or Behavior Driven Development.
EasyMock provides Mock Objects for interfaces (and objects through the class extension) by generating them on the fly using Java's proxy mechanism.
EasyMock is a perfect fit for Test-Driven Development.

Why
    Great testing includes isolation
How
Isolation involves Mock Objects
What
EasyMock makes mocking easier
http://easymock.org/


  • JSFUnit is a test framework for JSF applications. It is designed to allow complete integration testing and unit testing of JSF applications using a simplified API. 

http://jsfunit.jboss.org/
  • Headless Website Testing
Run functional tests with frameworks such as Jasmine, QUnit, Mocha, Capybara, WebDriver, and many other.PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
http://phantomjs.org/

  • A headless Internet Explorer browser using the .NET WebBrowser Class with a Javascript API running on the V8 engine.
The API is coded as a port of PhantomJS. Perfect for test automation. If you have used phantom before then you already know how to use TrifleJS.
http://triflejs.org

  • These are browsers that simulate a browser environment. While they are able to support common browser features (HTML parsing, cookies, XHR, some javascript, etc.), they do not render DOM and have limited support for DOM events.

Zombie.js
Insanely fast, headless full-stack testing using Node.js.
http://zombie.js.org/
  • Browserless AJAX Testing with Rhino and Envjs, Part 1
http://loose-bits.com/2011/02/browserless-ajax-testing-with-rhino-and.html
  • A scriptable browser for Web developers.SlimerJS allows you to interact with a web page through an external JS script
https://slimerjs.org/
  • What is Splash?
Splash is a lightweight, scriptable headless browser with an HTTP API. It is used to:
    properly render web pages that use JavaScript
    interact with them
    get detailed information about requests/responses initiated by a web page
    apply Adblock Plus filters
    take screenshots of the crawled websites as they are seen in a browser

https://scrapinghub.com/splash/
  • WireMock is a simulator for HTTP-based APIs. Some might consider it a service virtualization tool or a mock server.

http://wiremock.org/

  • Geb is a browser automation solution.

It brings together the power of WebDriver, the elegance of jQuery content selection, the robustness of Page Object modelling and the expressiveness of the Groovy language.
It can be used for scripting, scraping and general automation — or equally as a functional/web/acceptance testing solution via integration with testing frameworks such as Spock, JUnit & TestNG.
Geb leverages the WebDriver library for browser automation. This means that Geb works with any browser that WebDriver works with

http://www.gebish.org/


  • Google Test

Googletest - Google Testing and Mocking Framework
Google's C++ test framework
This repository is a merger of the formerly separate GoogleTest and GoogleMock projects

https://github.com/google/googletest

No comments:

Post a Comment