<commit_before>import {Selector, ClientFunction} from 'testcafe';

export const frameworks = ['knockout', 'react'];
export const url = 'http://127.0.0.1:8080/testCafe/';

export const initSurvey = ClientFunction((framework, json) => {
    Survey.defaultBootstrapCss.navigationButton = "btn btn-primary";
    Survey.Survey.cssType = "bootstrap";

    var model = new Survey.Model(json);

    model.onComplete.add(function (model) {
        window.SurveyResult = model.data;
    });

    if(framework === "knockout") {
        model.render("surveyElement");
    }
    else if(framework === "react") {
        ReactDOM.render(React.createElement(Survey.Survey, { model: model }), document.getElementById("surveyElement"));
    }

    window.survey = model;
});

export const getSurveyResult = ClientFunction(() => window.SurveyResult);

export const setOptions = ClientFunction((questionName, modValue) => {
    var mergeOptions = function (obj1, obj2) {
        for (var attrname in obj2) {
            obj1[attrname] = obj2[attrname];
        }
    };
    var q = survey.getQuestionByName(questionName || 'car');
    mergeOptions(q, modValue);
    survey.render();
});<commit_msg>testcafe: setings<commit_after>import {Selector, ClientFunction} from 'testcafe';

export const frameworks = [
        'knockout',
        'react'
    ];
export const url = 'http://127.0.0.1:8080/testCafe/';

export const initSurvey = ClientFunction((framework, json) => {
    Survey.defaultBootstrapCss.navigationButton = "btn btn-primary";
    Survey.Survey.cssType = "bootstrap";

    var model = new Survey.Model(json);

    model.onComplete.add(function (model) {
        window.SurveyResult = model.data;
    });

    if(framework === "knockout") {
        model.render("surveyElement");
    }
    else if(framework === "react") {
        ReactDOM.render(React.createElement(Survey.Survey, { model: model }), document.getElementById("surveyElement"));
    }

    window.survey = model;
});

export const getSurveyResult = ClientFunction(() => window.SurveyResult);

export const setOptions = ClientFunction((questionName, modValue) => {
    var mergeOptions = function (obj1, obj2) {
        for (var attrname in obj2) {
            obj1[attrname] = obj2[attrname];
        }
    };
    var q = survey.getQuestionByName(questionName || 'car');
    mergeOptions(q, modValue);
    survey.render();
});
{'fraction_non_alphanumeric': 0.14471476510067113, 'fraction_numerical': 0.012583892617449664, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3073650', 'n_tokens_mistral': 732, 'n_tokens_neox': 719, 'n_words': 147}