Giter Club home page Giter Club logo

e2e-angular-requirejs-scenario-karma-protractor's Introduction

Angular with requirejs AMD loading project structure for e2e testings via scenario/karma vs protractor

This is a sample project for seeing how to run e2e tests. The biggest difficulty is timing around the AMD loading.

The sample app is simple. It loads a version onto the screen via angular service injection. This is enough to prove AMD timing issues. Results:

  • DON'T use karma and scenario - I still couldn't get it to work but reckon it could be fixed - the code waits and loads but somewhere the targeting of the element is wrong and needs to be fixed
  • Protractor was successful and easily implemented

Thoughts:

  • both can integrate with Angular
  • scenario obviously requires Angular, so protractor is more generalised (good)
  • both are interprocess communication
  • selenium/webdriver are maintained and extended by others (good)
  • both have grunt runners

Installation

sudo npm install -d grunt karma bower
npm install
bower install
node_modules/protractor/bin/install_selenium_standalone

Running the site

If you want to see how little it does. Run below to start up the server and load up a browser:

grunt

Testing

Running via Karma

These tests fail. You noticed that there is a pause in the second test. This shows how the loader timing is fine. If you remove the ng-scenario-require.js from the e2e.conf.js then one test will pass but the AMD loading doesn't happen in time.

grunt karma

Running via Protractor

These tests all pass.

grunt protractor

e2e-angular-requirejs-scenario-karma-protractor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

eugeniussoftdev

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.