<commit_before>import {browser, protractor, element, by} from 'protractor';

'use strict';
var common = require("../common.js");
var EC = protractor.ExpectedConditions;
var delays = require('../config/delays');

/**
 * @author <NAME>
 */
var DocumentViewPage = function() {

    // click

    this.clickRelation = function(relationIndex) {
        return element.all(by.css('#document-view a')).get(relationIndex).click();
    };

    this.clickEditDocument = function() {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-edit-document'))), delays.ECWaitTime);
        element(by.id('document-view-button-edit-document')).click();
    };

    this.clickCreateGeometry = function(type) {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-create-' + type))), delays.ECWaitTime);
        return element(by.id('document-view-button-create-' + type)).click();
    };

    this.clickReeditGeometry = function() {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-edit-geometry'))), delays.ECWaitTime);
        element(by.id('document-view-button-edit-geometry')).click();
    };

    this.clickSolveConflicts = function() {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-solve-conflicts'))), delays.ECWaitTime);
        element(by.id('document-view-button-solve-conflicts')).click();
    };

    // get text

    /**
     * @param index counting from 0 for the first field
     */
    this.getRelationValue = function(index) {
        browser.wait(EC.visibilityOf(element(by.css('relations-view a'))), delays.ECWaitTime);
        return element.all(by.css('relations-view a')).get(index).getText();
    };

    /**
     * @param index counting from 0 for the first field
     */
    this.getRelationName = function(index) {
        browser.wait(EC.visibilityOf(element(by.css('relations-view div:nth-child(' + (index + 1) + ') .fieldname'))), delays.ECWaitTime);
        return element.all(by.css('relations-view div:nth-child(' + (index + 1) + ') .fieldname')).get(index).getText();
    };

    /**
     * @param index counting from 0 for the first field
     */
    this.getFieldValue = function(index) {
        browser.wait(EC.visibilityOf(element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldvalue'))), delays.ECWaitTime);
        return element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldvalue')).getText();
    };

    /**
     * @param index counting from 0 for the first field
     */
    this.getFieldName = function(index) {
        browser.wait(EC.visibilityOf(element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldname'))), delays.ECWaitTime);
        return element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldname')).getText();
    };

    this.getFields = function() {
        browser.wait(EC.visibilityOf(element(by.css('fields-view > div'))), delays.ECWaitTime);
        return element.all(by.css('fields-view > div'))
    };

    this.getRelations = function() {
        browser.sleep(delays.shortRest);
        return element.all(by.css('relations-view a'));
    };

    this.getSelectedGeometryTypeText = function() {
        browser.wait(EC.visibilityOf(element(by.css('#document-view-field-geometry .fieldvalue'))), delays.ECWaitTime);
        return element(by.id('document-view-field-geometry')).element(by.css('.fieldvalue')).getText();
    };
};

module.exports = new DocumentViewPage();<commit_msg>convert to typescript class<commit_after>import {browser, protractor, element, by} from 'protractor';

'use strict';
const common = require("../common.js");
const EC = protractor.ExpectedConditions;
const delays = require('../config/delays');

/**
 * @author <NAME>
 */
export class DocumentViewPage {

    // click

    public static clickRelation(relationIndex) {
        return element.all(by.css('#document-view a')).get(relationIndex).click();
    };

    public static clickEditDocument() {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-edit-document'))), delays.ECWaitTime);
        element(by.id('document-view-button-edit-document')).click();
    };

    public static clickCreateGeometry(type) {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-create-' + type))), delays.ECWaitTime);
        return element(by.id('document-view-button-create-' + type)).click();
    };

    public static clickReeditGeometry() {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-edit-geometry'))), delays.ECWaitTime);
        element(by.id('document-view-button-edit-geometry')).click();
    };

    public static clickSolveConflicts() {
        browser.wait(EC.visibilityOf(element(by.id('document-view-button-solve-conflicts'))), delays.ECWaitTime);
        element(by.id('document-view-button-solve-conflicts')).click();
    };

    // get text

    /**
     * @param index counting from 0 for the first field
     */
    public static getRelationValue(index) {
        browser.wait(EC.visibilityOf(element(by.css('relations-view a'))), delays.ECWaitTime);
        return element.all(by.css('relations-view a')).get(index).getText();
    };

    /**
     * @param index counting from 0 for the first field
     */
    public static getRelationName(index) {
        browser.wait(EC.visibilityOf(element(by.css('relations-view div:nth-child(' + (index + 1) + ') .fieldname'))), delays.ECWaitTime);
        return element.all(by.css('relations-view div:nth-child(' + (index + 1) + ') .fieldname')).get(index).getText();
    };

    /**
     * @param index counting from 0 for the first field
     */
    public static getFieldValue(index) {
        browser.wait(EC.visibilityOf(element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldvalue'))), delays.ECWaitTime);
        return element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldvalue')).getText();
    };

    /**
     * @param index counting from 0 for the first field
     */
    public static getFieldName(index) {
        browser.wait(EC.visibilityOf(element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldname'))), delays.ECWaitTime);
        return element(by.css('fields-view div:nth-child(' + (index + 1) + ') .fieldname')).getText();
    };

    public static getFields() {
        browser.wait(EC.visibilityOf(element(by.css('fields-view > div'))), delays.ECWaitTime);
        return element.all(by.css('fields-view > div'))
    };

    public static getRelations() {
        browser.sleep(delays.shortRest);
        return element.all(by.css('relations-view a'));
    };

    public static getSelectedGeometryTypeText() {
        browser.wait(EC.visibilityOf(element(by.css('#document-view-field-geometry .fieldvalue'))), delays.ECWaitTime);
        return element(by.id('document-view-field-geometry')).element(by.css('.fieldvalue')).getText();
    };
}
{'fraction_non_alphanumeric': 0.1731520324027195, 'fraction_numerical': 0.0028930999566035005, 'mean_word_length': 3.429212043561819, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '235847', 'n_tokens_mistral': 2180, 'n_tokens_neox': 2079, 'n_words': 339}