<commit_before>import {browser, protractor, element, by} from 'protractor';
import {DoceditPage} from '../docedit/docedit.page';
import {DocumentViewPage} from '../widgets/document-view.page';

import {ResourcesPage} from '../resources/resources.page';
import {DoceditRelationsTabPage} from '../docedit/docedit-relations-tab.page';
import {NavbarPage} from '../navbar.page';
const EC = protractor.ExpectedConditions;
const delays = require('../config/delays');


/**
 * @author <NAME>
 */
fdescribe('widgets/document-view', function() {

    beforeEach(function() {
        browser.sleep(1000);
    });

    beforeEach(() => {
        NavbarPage.performNavigateToSettings();
        require('request').post('http://localhost:3003/reset', {});
        browser.sleep(delays.shortRest * 10);
        NavbarPage.clickNavigateToExcavation();
        // browser.wait(EC.visibilityOf(element(by.id('create-main-type-document-button'))), delays.ECWaitTime);
        browser.sleep(delays.shortRest * 5);
    });


    /**
     * Addresses an issue where relations were shown double.
     */
    it('show only relations present in the object', function() {
        ResourcesPage.performCreateLink();
        ResourcesPage.clickSelectResource('1');
        DocumentViewPage.getRelations().then(function(relations) {
            expect(relations.length).toBe(2);
        });
    });

    it('show the relations present in the object', function() {
        ResourcesPage.performCreateLink();
        ResourcesPage.clickSelectResource('1');
        DocumentViewPage.getRelationName(1).then(value => {
            expect(value).toBe('Liegt in'); // with the correct relation label
        });
        DocumentViewPage.getRelationValue(1).then(value => {
            expect(value).toBe('2');<commit_msg>speed up beforeeach (e2e:focus)<commit_after>import {browser, protractor, element, by} from 'protractor';
import {DoceditPage} from '../docedit/docedit.page';
import {DocumentViewPage} from '../widgets/document-view.page';

import {ResourcesPage} from '../resources/resources.page';
import {DoceditRelationsTabPage} from '../docedit/docedit-relations-tab.page';
import {NavbarPage} from '../navbar.page';
const EC = protractor.ExpectedConditions;
const delays = require('../config/delays');


/**
 * @author <NAME>
 */
fdescribe('widgets/document-view', function() {

    beforeEach(function() {
        browser.sleep(1000);
    });

    beforeEach(() => {
        NavbarPage.performNavigateToSettings();
        require('request').post('http://localhost:3003/reset', {});
        browser.sleep(delays.shortRest * 5);
        NavbarPage.clickNavigateToExcavation();
        // browser.wait(EC.visibilityOf(element(by.id('create-main-type-document-button'))), delays.ECWaitTime);
        browser.sleep(delays.shortRest);
    });


    /**
     * Addresses an issue where relations were shown double.
     */
    it('show only relations present in the object', function() {
        ResourcesPage.performCreateLink();
        ResourcesPage.clickSelectResource('1');
        DocumentViewPage.getRelations().then(function(relations) {
            expect(relations.length).toBe(2);
        });
    });

    it('show the relations present in the object', function() {
        ResourcesPage.performCreateLink();
        ResourcesPage.clickSelectResource('1');
        DocumentViewPage.getRelationName(1).then(value => {
            expect(value).toBe('Liegt in'); // with the correct relation label
        });
        DocumentViewPage.getRelationValue(1).then(value => {
            expect(value).toBe('2');
{'fraction_non_alphanumeric': 0.15277390577083913, 'fraction_numerical': 0.009199888486200167, 'mean_word_length': 3.375609756097561, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1352960', 'n_tokens_mistral': 1037, 'n_tokens_neox': 975, 'n_words': 179}