<commit_before>
'use strict';

module.exports = new Authoring();

function Authoring() {

    this.lock = element(by.css('[ng-click="lock()"]'));
    this.close_button = element(by.buttonText('CLOSE'));
    this.save_button = element(by.buttonText('SAVE'));

    this.navbarMenuBtn = element(by.css('.dropdown-toggle.sd-create-btn'));
    this.newPlainArticleLink = element(by.id('create_text_article'));
    this.newEmptyPackageLink = element(by.id('create_package'));
    this.infoIconsBox = element(by.css('.info-icons'));
    this.sendToButton = element(by.id('send-to-btn'));

    this.setCategoryBtn = element(by.id('category-setting'))
        .element(by.tagName('button'));

    /**
     * Find all file type icons in the item's info icons box matching the
     * given file type.
     *
     * @param {string} itemType - the item type of interest, e.g. 'text',
     *   'composite', 'picture', etc.
     * @return {Object} a promise that is resolved with all DOM elements found
     */
    this.findItemTypeIcons = function (itemType) {
        var selector = '.filetype-icon-' + itemType;
        return this.infoIconsBox.all(by.css(selector));
    };

    /**
     * Send item to given desk
     *
     * @param {string} desk Desk name
     * @param {string} stage Stage name
     */
    this.sendTo = function(desk, stage) {
        this.sendToButton.click();
        this.sendToSidebarOpened(desk, stage);
    };

    this.confirmSendTo = function() {
        element(by.className('modal-content')).all(by.css('[ng-click="ok()"]')).click();
    };

    this.sendToSidebarOpened = function(desk, stage) {
        var sidebar = element.all(by.css('.send-to-pane')).last(),
            dropdown = sidebar.element(by.css('.desk-select .dropdown-toggle'));

        dropdown.waitReady();
        dropdown.click();
        sidebar.element(by.buttonText(desk)).click();
        if (stage !== undefined) {
            sidebar.element(by.buttonText(stage)).click();
        }
        sidebar.element(by.buttonText('send')).click();
    };

    this.markAction = function() {
        return element(by.className('svg-icon-add-to-list')).click();
    };

    this.createTextItem = function() {
        return element(by.css('[class="dropdown-toggle sd-create-btn"]')).click().then(function() {
            return element(by.id('create_text_article')).click();
        });
    };

    this.close = function() {
        return this.close_button.click();
    };

    this.publish = function() {
        this.sendToButton.click();
        return element(by.buttonText('PUBLISH')).click();
    };
<commit_msg>Fix test<commit_after>
'use strict';

module.exports = new Authoring();

function Authoring() {

    this.lock = element(by.css('[ng-click="lock()"]'));
    this.publish_button = element(by.buttonText('publish'));
    this.close_button = element(by.buttonText('CLOSE'));
    this.save_button = element(by.buttonText('SAVE'));

    this.navbarMenuBtn = element(by.css('.dropdown-toggle.sd-create-btn'));
    this.newPlainArticleLink = element(by.id('create_text_article'));
    this.newEmptyPackageLink = element(by.id('create_package'));
    this.infoIconsBox = element(by.css('.info-icons'));
    this.sendToButton = element(by.id('send-to-btn'));

    this.setCategoryBtn = element(by.id('category-setting'))
        .element(by.tagName('button'));

    /**
     * Find all file type icons in the item's info icons box matching the
     * given file type.
     *
     * @param {string} itemType - the item type of interest, e.g. 'text',
     *   'composite', 'picture', etc.
     * @return {Object} a promise that is resolved with all DOM elements found
     */
    this.findItemTypeIcons = function (itemType) {
        var selector = '.filetype-icon-' + itemType;
        return this.infoIconsBox.all(by.css(selector));
    };

    /**
     * Send item to given desk
     *
     * @param {string} desk Desk name
     * @param {string} stage Stage name
     */
    this.sendTo = function(desk, stage) {
        this.sendToButton.click();
        this.sendToSidebarOpened(desk, stage);
    };

    this.confirmSendTo = function() {
        element(by.className('modal-content')).all(by.css('[ng-click="ok()"]')).click();
    };

    this.sendToSidebarOpened = function(desk, stage) {
        var sidebar = element.all(by.css('.send-to-pane')).last(),
            dropdown = sidebar.element(by.css('.desk-select .dropdown-toggle'));

        dropdown.waitReady();
        dropdown.click();
        sidebar.element(by.buttonText(desk)).click();
        if (stage !== undefined) {
            sidebar.element(by.buttonText(stage)).click();
        }
        sidebar.element(by.buttonText('send')).click();
    };

    this.markAction = function() {
        return element(by.className('svg-icon-add-to-list')).click();
    };

    this.createTextItem = function() {
        return element(by.css('[class="dropdown-toggle sd-create-btn"]')).click().then(function() {
            return element(by.id('create_text_article')).click();
        });
    };

    this.close = function() {
        return this.close_button.click();
    };

    this.publish = function() {
        this.sendToButton.click();
        return this.publish_button.click();
    };

{'fraction_non_alphanumeric': 0.16818873668188736, 'fraction_numerical': 0.0, 'mean_word_length': 2.8569332355099046, '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': '2208627', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1593, 'n_words': 279}