How to use the ariatemplates/Aria.$window function in ariatemplates

To help you get started, we’ve selected a few ariatemplates examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Task.js View on Github external
return function (task) {
                // -------------------------------------------------- processing

                // tracing -----------------------------------------------------

                if (self.trace.enable) {
                    var console = Aria.$window.console;

                    // message -------------------------------------------------

                    var message;
                    if (ariaCoreBrowser.isWebkit) {
                        message = ['%c' + self.name, 'color: ' + self.trace.color];
                    } else {
                        message = [self.name];
                    }

                    // log method ----------------------------------------------

                    var logMethod;
                    if (!self.hasChildren) {
                        logMethod = console.log;
                    } else {
github ariatemplates / ariatemplates / test / aria / widgets / wai / input / actionWidget / Base.js View on Github external
_testWidgetType : function (callback, widgetType) {
            // --------------------------------------------------- destructuring

            var document = Aria.$window.document;

            var elements = widgetType.elements;
            // var finalElement = document.getElementById(elements.after.id);

            var name = widgetType.name;
            var testData = this.testData[name];

            var traversals = this.traversals;

            // ------------------------------------------------------ processing

            this._executeStepsAndWriteHistory(callback, function (api) {
                // ----------------------------------------------- destructuring

                var step = api.step;
                var says = api.says;
github ariatemplates / ariatemplates / test / aria / core / TplClassLoaderErrorTestCase.js View on Github external
setUp : function () {
            var document = Aria.$window.document;
            this.thisDivIsInTheBody = document.createElement("div");
            this.thisDivIsInTheBody.id = "thisDivIsInTheBody";
            document.body.appendChild(this.thisDivIsInTheBody);

            // Add a filter to slow down the script, I need an instance otherwise it's not loaded for a while
            this.filterSlow = new testAriaTemplatesTestErrorSlowDown();
            ariaCoreIOFiltersMgr.addFilter(this.filterSlow);
        },
github ariatemplates / ariatemplates / test / aria / widgets / wai / input / actionWidget / JawsBase.js View on Github external
_testWidgetType : function (callback, widgetType) {
            // --------------------------------------------------- destructuring

            var document = Aria.$window.document;

            var elements = widgetType.elements;
            // var finalElement = document.getElementById(elements.after.id);

            var name = widgetType.name;
            var testData = this.testData[name];

            var traversals = this.traversals;

            // ------------------------------------------------------ processing

            this._executeStepsAndWriteHistory(callback, function (api) {
                // ----------------------------------------------- destructuring

                var step = api.step;
                var says = api.says;
github ariatemplates / ariatemplates / test / aria / utils / domNavigationManager / DomNavigationManagerRobotTestCase.js View on Github external
_checkFocusedElement : function (next, expectedTextContent, shouldBeContained) {
            // -------------------------------------- input arguments processing

            if (shouldBeContained == null) {
                shouldBeContained = true;
            }

            // --------------------------------------------------- destructuring

            var ancestor = this._currentNode;

            var document = Aria.$window.document;
            var focusedElement = document.activeElement;
            var textContent = focusedElement.textContent || focusedElement.innerText;

            // ------------------------------------------------------ processing

            var result;
            var message;

            // -----------------------------------------------------------------

            result = ariaUtilsDom.isAncestor(focusedElement, ancestor);
            message = 'Focused element should%1be contained inside the element';

            var subtitution;
            if (shouldBeContained) {
                subtitution = ' ';
github ariatemplates / ariatemplates / test / aria / widgets / errorlist / displayOptions / ErrorListDisplayOptionsTestCase.js View on Github external
runTemplateTest: function () {
            var contentElement = Aria.$window.document.getElementById(this._elementId);

            this.assertTrue(contentElement != null, 'Custom id should have been passed and output to build the element.');

            this.end();
        }
    }
github ariatemplates / ariatemplates / test / aria / widgets / wai / input / actionWidget / buttonFocusableWhenDisabled / FocusableDisabledButtonJawsTestCase.js View on Github external
fn: function () {
                            this.assertEquals(Aria.$window.document.activeElement, this.getElementById("tf2"));
                            this.assertEquals(data.firstButtonNbClicks, 1),
                            this.assertEquals(data.secondButtonNbClicks, 1),
                            this.assertEquals(data.thirdButtonNbClicks, 1),
                            this.assertEquals(data.fourthButtonNbClicks, 1),
                            this.assertJawsHistoryEquals([
                                "First field Edit",
                                "First button Button Unavailable",
                                "Second button Button",
                                "Fourth button Button",
                                "Last field Edit",
                                "First field Edit",
                                "First button Button",
                                "Second button Button Unavailable",
                                "Third button Button",
                                "Last field Edit"
                            ].join("\n"), this.end);
github ariatemplates / ariatemplates / test / aria / widgets / wai / input / actionWidget / buttonFocusableWhenDisabled / FocusableDisabledButtonJawsTestCase.js View on Github external
fn: function () {
                    this.assertEquals(Aria.$window.document.activeElement, this.getElementById("tf2"));
                    this.assertFalsy(data.firstButtonNbClicks),
                    this.assertEquals(data.secondButtonNbClicks, 1),
                    this.assertFalsy(data.thirdButtonNbClicks),
                    this.assertEquals(data.fourthButtonNbClicks, 1),
                    ariaUtilsJson.setValue(data, "firstButtonDisabled", false);
                    ariaUtilsJson.setValue(data, "secondButtonDisabled", true);
                    ariaUtilsJson.setValue(data, "thirdButtonDisabled", false);
                    ariaUtilsJson.setValue(data, "fourthButtonDisabled", true);
                    this.execute([
                        ["click", this.getElementById("tf1")], ["pause", 100],
                        ["type", null, "[tab]"], ["pause", 200], ["type", null, "[space]"], ["pause", 200],
                        ["type", null, "[tab]"], ["pause", 200], ["type", null, "[space]"], ["pause", 200],
                        ["type", null, "[tab]"], ["pause", 200], ["type", null, "[space]"], ["pause", 200],
                        ["type", null, "[tab]"], ["pause", 200]
                    ], {
                        fn: function () {
github ariatemplates / ariatemplates / test / aria / templates / robotCalibrationTest / CalibrationRobotTestCase.js View on Github external
runTemplateTest : function () {
            var markPosition = {
                x : 70,
                y : 144
            };
            var document = Aria.$window.document;
            var markPixel = document.createElement("div");
            var markPixelStyle = markPixel.style;
            markPixelStyle.position = "absolute";
            markPixelStyle.backgroundColor = "black";
            markPixelStyle.width = "1px";
            markPixelStyle.height = "1px";
            markPixelStyle.left = markPosition.x + "px";
            markPixelStyle.top = markPosition.y + "px";
            markPixelStyle.zIndex = "10000";
            document.body.appendChild(markPixel);

            var clicks = [];
            var clickHandler = {
                fn : function (event) {
                    clicks.push({
                        x : event.clientX,