<commit_before>(function() {

    var Assert = YAHOO.util.Assert;
    var Test = ORBEON.util.Test;
    var OD = ORBEON.util.Dom;
    var YD = YAHOO.util.Dom;

    YAHOO.tool.TestRunner.add(new YAHOO.tool.TestCase({

        name: "Message action",

        /**
         * Checks the specified message is display, and close the message box.
         *
         * @param {string} text
         */
        checkDisplayedMessage: function(text) {
            var dialog = OD.get("xforms-message-dialog");
            Assert.areEqual("visible", dialog.parentNode.style.visibility, "dialog is visible");
            var body = YD.getElementsByClassName("bd", null, dialog)[0];
            Assert.areEqual(text, OD.getStringValue(body), "unexpected message in dialog");
            dialog.getElementsByTagName("button")[0].click();
        },

        /**
         * Check we are able to show multiple messages in a row when a page is first loaded.
         */
        testInitial: function() {
            this.checkDisplayedMessage("Message 1");
            this.checkDisplayedMessage("Message 2");
        },

        /**
         * Check a that 2 messages are shown in a row after clicking on a button.
         */
        testSubsequent: function() {
            Test.executeCausingAjaxRequest(this, function() {
                Test.click("show-messages");
            }, function() {
                this.checkDisplayedMessage("Message 3");
                this.checkDisplayedMessage("Message 4");<commit_msg>Fix: test was not passing since we added a span in the message dialog for YUI 2.8<commit_after>(function() {

    var Assert = YAHOO.util.Assert;
    var Test = ORBEON.util.Test;
    var OD = ORBEON.util.Dom;
    var YD = YAHOO.util.Dom;

    YAHOO.tool.TestRunner.add(new YAHOO.tool.TestCase({

        name: "Message action",

        /**
         * Checks the specified message is display, and close the message box.
         *
         * @param {string} text
         */
        checkDisplayedMessage: function(text) {
            var dialog = OD.get("xforms-message-dialog");
            Assert.areEqual("visible", dialog.parentNode.style.visibility, "dialog is visible");
            var body = YD.getElementsByClassName("bd", null, dialog)[0];
            var span = OD.getChildElementByIndex(body, 0);
            Assert.areEqual(text, OD.getStringValue(span), "unexpected message in dialog");
            dialog.getElementsByTagName("button")[0].click();
        },

        /**
         * Check we are able to show multiple messages in a row when a page is first loaded.
         */
        testInitial: function() {
            this.checkDisplayedMessage("Message 1");
            this.checkDisplayedMessage("Message 2");
        },

        /**
         * Check a that 2 messages are shown in a row after clicking on a button.
         */
        testSubsequent: function() {
            Test.executeCausingAjaxRequest(this, function() {
                Test.click("show-messages");
            }, function() {
                this.checkDisplayedMessage("Message 3");
                this.checkDisplayedMessage("Message 4");
{'fraction_non_alphanumeric': 0.11383147853736089, 'fraction_numerical': 0.005405405405405406, 'mean_word_length': 2.072265625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3831717', 'n_tokens_mistral': 879, 'n_tokens_neox': 829, 'n_words': 223}