# all files / features/ComponentEditor/Models/ BrowserModel.js

100% Statements 9/9
100% Branches 0/0
100% Functions 3/3
100% Lines 9/9

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73

    1

    1
    25
    25
    25

    25

    25

    1
    25

     'use strict';

    // Module:
    var ComponentEditor = require('../ComponentEditor');

    var createBrowserModelConstructor = function () {
        var BrowserModel = function BrowserModel () {
            this.name = 'browser';
            this.variableName = this.name;
        };

        BrowserModel.prototype.methods = [{
            name: 'get',
            description: 'Navigate to the given destination and loads mock modules before Angular.',
            arguments: [{
                name: 'destination',
                description: 'Destination URL',
                type: 'string',
                required: true
            }, {
                name: 'timeout',
                description: 'Number of milliseconds to wait for Angular to start.',
                type: 'number'
            }]
        }, {
            name: 'refresh',
            description: 'Makes a full reload of the current page and loads mock modules before Angular. Assumes that the page being loaded uses Angular.',
            arguments: [{
                name: 'timeout',
                description: 'Number of seconds to wait for Angular to start.',
                type: 'number'
            }]
        }, {
            name: 'setLocation',
            description: 'Browse to another page using in-page navigation.',
            arguments: [{
                name: 'url',
                description: 'In page URL using the same syntax as $location.url()',
                type: 'string',
                required: true
            }],
            returns: 'promise'
        }, {
            name: 'getLocationAbsUrl',
            description: 'Returns the current absolute url from AngularJS.',
            returns: 'string',
            string: {
                name: 'absoluteUrl',
                type: 'string',
                required: true
            }
        }, {
            name: 'waitForAngular',
            description: 'Instruct webdriver to wait until Angular has finished rendering and has no outstanding $http calls before continuing.',
            returns: 'promise'
        }, {
         name: 'sendKeys',
         description: 'Custom browser actions.',
         arguments: [{
             name: 'staticKey',
             description: 'Static keys that user wants to send to the browser',
             type: 'Identifier',
             required: true
         }]
      }];

        return BrowserModel;
    };

    ComponentEditor.factory('BrowserModel', function () {
        return createBrowserModelConstructor();
    });