GithubHelp home page GithubHelp logo

angular / protractor-timeline-plugin Goto Github PK

View Code? Open in Web Editor NEW
18.0 13.0 13.0 224 KB

Gathers test timeline information and presents the output visually

License: MIT License

JavaScript 83.91% HTML 16.09%

protractor-timeline-plugin's Introduction

Timeline Plugin

This plugin gathers test timeline information from the protractor test process, the selenium client logs (if available), and sauce labs (if available), and presents the output visually. This improves understanding of where latency issues are in tests.

To enable the Timeline plugin, set it up in your config file:

exports.config = {
  plugins: [{
    package: 'protractor-timeline-plugin',

    // Output json and html will go in this folder.
    outdir: 'timelines',

    // Set the name of the html file. Defaults to index.html.
    outputHtmlFileName: 'results.html'

    // Optional - if sauceUser and sauceKey are specified, logs from
    // SauceLabs will also be parsed after test invocation.
    sauceUser: 'Jane',
    sauceKey: 'abcdefg'
  }],
  // other configuration settings
};

protractor-timeline-plugin's People

Contributors

anuubis avatar sjelin avatar thesharpieone avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar

protractor-timeline-plugin's Issues

Unable to find module 'protractor-timeline-plugin' without global installation

When I run protractor with this plugin (or any of the first party plugins in my configuration file), I get an error saying:

E/launcher - Error: Cannot find module 'protractor-timeline-plugin'

My config file plugins section,

plugins: [{
    package: 'protractor-timeline-plugin'
    outdir: 'timelines',
    outputHtmlFileName: 'results.html'
}]

It seems to work however if I install the plugin globally. Unfortunately installing globally isn't an option for me. Has this issue been seen previously/are there any known workarounds? Let me know if you need any more info or how I can help to debug it

Protractor version: "^4.0.10"

Parse Browserstack logs

Timeline plugin currently has an ability to parse SauceLabs logs, but, would be a good idea to add support for BrowserStack? Thanks.

Protractor 3.3.0 issue and fix

The timeline plugin doesn't work with protractor 3.3.0.
'executor' returns now a promise instead of a callback.

Here my fix, hope it helps:

// Override executor so that we get information about commands starting
  // and stopping.
  var originalExecute = browser.driver.executor_.execute;
  browser.driver.executor_.execute = function(command) {
    var timelineEvent = {
      source: 'Test Process',
      id: counter++,
      command: command,
      start: new Date().getTime(),
      end: null
    };
    if (!self.testProcessSetTimeoutTimestamp &&
        timelineEvent.command.name_ == 'setScriptTimeout') {
      self.testProcessSetTimeoutTimestamp = timelineEvent.start;
    }
    self.timeline.push(timelineEvent);
    return originalExecute.apply(browser.driver.executor_, [command]).then(function(res) {
      timelineEvent.end = new Date().getTime();
      return res;
    });
  };

html loads empty

Hi all,
When i run Protractor with the plugin in place the output files are created but the html doesnt load results,
Do you know the reason?
screen shot 2016-02-14 at 21 02 00

HTML loads empty (i have tried with Chrome, Safari, etc...)
JSON contains data:

[{"source":"Test Process","id":0,"command":{"name_":"getAvailableLogTypes","parameters_":{}},"start":1455414657512,"end":1455414657521},{"source":"Test Process","id":1,"command":{"name_":"maximizeWindow","parameters_":{}},"start":1455414657632,"end":1455414657938},{"source":"Test Process","id":2,"command":{"name_":"get","parameters_":{"url":"http://localhost:8100/"}},"start":1455414657940,"end":1455414658589},{"source":"Test Process","id":3,"command":{"name_":"switchToFrame","parameters_":{"id":null}},"start":1455414661598,"end":1455414661607},{"source":"Test Process","id":4,"command":{"name_":"executeScript","parameters_":{"script":"(function () {if (typeof axe === "object" && axe.version) { return; }var s = document.createElement("script");s.innerHTML = "/_! aXe v1.1.1\n * Copyright (c) 2015 Deque Systems, Inc.\n *\n * Your use of this Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n *\n * This entire copyright notice must appear in every copy of this file you\n * distribute or in any file that contains substantial portions of this source\n * code.\n */\n(function (window, document) {\n\n/_exported clone _/\n\n/__\n * Deeply clones an object or array\n * @param {Mixed} obj The object/array to clone\n * @return {Mixed} A clone of the initial object or array\n /\nfunction clone(obj) {\n\t'use strict';\n\tvar index, length,\n\t\tout = obj;\n\n\tif (obj !== null && typeof obj === 'object') {\n\t\tif (Array.isArray(obj)) {\n\t\t\tout = [];\n\t\t\tfor (index = 0, length = obj.length; index < length; index++) {\n\t\t\t\tout[index] = clone(obj[index]);\n\t\t\t}\n\t\t} else {\n\t\t\tout = {};\n\t\t\t// jshint forin: false\n\t\t\tfor (index in obj) {\n\t\t\t\tout[index] = clone(obj[index]);\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n/_exported matchesSelector /\n/\n * Polyfill for Element#matches\n * @param {HTMLElement} node The element to test\n * @param {String} selector The selector to test element against\n * @return {Boolean}\n */\nvar matchesSelector = (function () {\n\t'use strict';\n\n\tvar method;\n\n\tfunction getMethod(win) {\n\n\t\tvar index, candidate,\n\t\t\telProto = win.Element.prototype,\n\t\t\tcandidates = ['matches', 'matchesSelector', 'mozMatchesSelector', 'webkitMatchesSelector', 'msMatchesSelector'],\n\t\t\tlength = candidates.length;\n\n\t\tfor (index = 0; index < length; index++) {\n\t\t\tcandidate =.........

Existing issues with timeline visualization

I'm having problems viewing most timelines generated from this tool. I think I'm running into this underlying Google Visualization Issue.
google/google-visualization-issues#2269

I always seem to get this error in Chrome:
Cannot read property 'v' of undefined

when viewing in Firefox, I sometimes get a timeline chart, and sometimes get this error:
this.tp[0] is undefined

My recommendation to other users of this plugin: Take the JSON generated from this tool, but don't bother with the result.html file; instead, create your own reports.

If I find a good HTML snippet to use in place of result.html, I will post it in this thread.

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.