Git Product home page Git Product logo

osf-ui-tests's Introduction

OSF-UI-Tests

OSF user interface tests

Current State

Our UI tests to this point do not require access to the OSF codebase; but to a running instance of the OSF. This allows them to be run against a dev or staging server instead of only on the developer's local machine.

One of the challenges we've faced is that of keeping our UI tests current with the OSF. With the introduction of unit and functional tests within the main OSF repo, we plan to alleviate this by eventually moving all tests there. To prepare for this, we're cleaning up our tests to use the page object pattern and a set of fixtures representing user actions.

Tools

Nose

Nose offers several benefits, many of which we're not yet utilizing. As the nose test runner completely supports unittest-based tests, there should be few issues supporting legacy tests while we migrate to use node more fully.

####solr

Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Jetty. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language. Solr's powerful external configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive plugin architecture when more advanced customization is required.

Selenium

Selenium is a tool designed to allow the develop to drive a web browser with code, emulating user behavior. The biggest challenge in doing so has so far been with respect to timing - sensing page refreshes, particularly those driven by clicking a button or executing Javascript.

We've attempted to alleviate this by moving to the page object pattern. A page object represents an individual page of the OSF, exposing properties and methods corresponding to elements on the page and actions that the user might take.

Guidelines for adding tests

New tests should whenever possible be added to an existing test suite. If you're testing that registrations of a project have a description that matches that of their parent projects, /tests/registrations/test_create.py already contains a test class that creates a project and registers it as appropriate. Since no action is taken in the browser to perform these tests, the registration is created only once, saving significant time.

Use the assertion methods in nose.tools, instead of those provided by unittest. These are PEP8-compliant.

Running the tests

  • From localhost
    • Point config:osf_home to localhost:5000
    • Start mongod
    • Invoke solr
    • Start OSF (main.py)
  • From development server
    • Point config:osf_home to dev URL
  • To run the tests
    • Run one test file: nosetests <testfile.py>
    • Run all test files: nosetests

Using Sauce

section pending

osf-ui-tests's People

Contributors

chennan47 avatar harryrybacki avatar jmcarp avatar lyndsysimon avatar rliebz avatar samportnow avatar

Watchers

 avatar

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.