<commit_before>const clipboardy = require('clipboardy');

function waitForOncoprint(timeout) {
    browser.pause(100); // give oncoprint time to disappear
    browser.waitUntil(()=>{
        return !browser.isExisting(".oncoprintLoadingIndicator") // wait for loading indicator to hide, and
            && browser.isExisting('#oncoprintDiv svg rect')// as a proxy for oncoprint being rendered, wait for an svg rectangle to appear in the legend
            && (browser.getCssProperty(".oncoprintContainer", "opacity").value === 1); // oncoprint has faded in
    }, timeout);
}

function getTextInOncoprintLegend() {
    return browser.getText("#oncoprintDiv .oncoprint-legend-div svg");
}

function setOncoprintMutationsMenuOpen(open) {
    const mutationColorMenuButton = "#mutationColorDropdown";
    const mutationColorMenuDropdown = "div.oncoprint__controls__mutation_color_menu";
    browser.moveToObject("div.oncoprint__controls");
    browser.waitForVisible(mutationColorMenuButton);
    browser.waitUntil(()=>{
        if (open === browser.isVisible(mutationColorMenuDropdown)) {
            return true;
        } else {
            browser.click(mutationColorMenuButton);
            return false;
        }
    }, 10000, `Couldn't ${open ? "open" : "close"} Mutations menu in Oncoprint`, 2000);
}

function goToUrlAndSetLocalStorage(url) {
    if (!useExternalFrontend) {
        browser.url(url);
    } else {
        var urlparam = useLocalDist? 'localdist' : 'localdev';
        var prefix = (url.indexOf("?") > 0)? '&' : '?';
        browser.url(`${url}${prefix}${urlparam}=true`);
    }
    browser.setViewportSize({ height: 1600, width: 1000 });

    // move mouse out of the way
    browser.moveToObject("body", 0, 0);
}

function sessionServiceIsEnabled() {
    return browser.execute(function() {
        return window.frontendConfig.serverConfig.sessionServiceEnabled;
    }).value;
}

function waitForNumberOfStudyCheckboxes(expectedNumber, text) {
    browser.waitUntil(()=>{
        var ret = browser.elements('[data-test="cancerTypeListContainer"] > ul > ul').value.length === expectedNumber;
        if (text && ret) {
            ret = browser.isExisting('[data-test="cancerTypeListContainer"] > ul > ul > ul > li:nth-child(2) > label > span');
            if (ret) {
                ret = (browser.getText('[data-test="cancerTypeListContainer"] > ul > ul > ul > li:nth-child(2) > label > span') === text);
            }
        }
        return ret;
    }, 30000);
}<commit_msg>incr timeout for study checkboxes<commit_after>const clipboardy = require('clipboardy');

function waitForOncoprint(timeout) {
    browser.pause(100); // give oncoprint time to disappear
    browser.waitUntil(()=>{
        return !browser.isExisting(".oncoprintLoadingIndicator") // wait for loading indicator to hide, and
            && browser.isExisting('#oncoprintDiv svg rect')// as a proxy for oncoprint being rendered, wait for an svg rectangle to appear in the legend
            && (browser.getCssProperty(".oncoprintContainer", "opacity").value === 1); // oncoprint has faded in
    }, timeout);
}

function getTextInOncoprintLegend() {
    return browser.getText("#oncoprintDiv .oncoprint-legend-div svg");
}

function setOncoprintMutationsMenuOpen(open) {
    const mutationColorMenuButton = "#mutationColorDropdown";
    const mutationColorMenuDropdown = "div.oncoprint__controls__mutation_color_menu";
    browser.moveToObject("div.oncoprint__controls");
    browser.waitForVisible(mutationColorMenuButton);
    browser.waitUntil(()=>{
        if (open === browser.isVisible(mutationColorMenuDropdown)) {
            return true;
        } else {
            browser.click(mutationColorMenuButton);
            return false;
        }
    }, 10000, `Couldn't ${open ? "open" : "close"} Mutations menu in Oncoprint`, 2000);
}

function goToUrlAndSetLocalStorage(url) {
    if (!useExternalFrontend) {
        browser.url(url);
    } else {
        var urlparam = useLocalDist? 'localdist' : 'localdev';
        var prefix = (url.indexOf("?") > 0)? '&' : '?';
        browser.url(`${url}${prefix}${urlparam}=true`);
    }
    browser.setViewportSize({ height: 1600, width: 1000 });

    // move mouse out of the way
    browser.moveToObject("body", 0, 0);
}

function sessionServiceIsEnabled() {
    return browser.execute(function() {
        return window.frontendConfig.serverConfig.sessionServiceEnabled;
    }).value;
}

function waitForNumberOfStudyCheckboxes(expectedNumber, text) {
    browser.waitUntil(()=>{
        var ret = browser.elements('[data-test="cancerTypeListContainer"] > ul > ul').value.length === expectedNumber;
        if (text && ret) {
            ret = browser.isExisting('[data-test="cancerTypeListContainer"] > ul > ul > ul > li:nth-child(2) > label > span');
            if (ret) {
                ret = (browser.getText('[data-test="cancerTypeListContainer"] > ul > ul > ul > li:nth-child(2) > label > span') === text);
            }
        }
        return ret;
    }, 60000);
}
{'fraction_non_alphanumeric': 0.13717693836978131, 'fraction_numerical': 0.012326043737574552, 'mean_word_length': 3.3333333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, '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': '6941628', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1491, 'n_words': 318}