<commit_before>﻿import Login = require("../../Helpers/LoginHelper");
import CatalogHelper = require("../../Helpers/CatalogHelper");
import ItSystemEditPo = require("../../PageObjects/it-system/Catalog/ItSystemCatalog.po")
import TestFixtureWrapper = require("../../Utility/TestFixtureWrapper");

describe("LocalAdmin user tests", () => {
    var loginHelper = new Login();
    var pageObject = new ItSystemEditPo();
    var testFixture = new TestFixtureWrapper();
    var findCatalogColumnsFor = CatalogHelper.findCatalogColumnsFor;

    beforeAll(() => {
        loginHelper.loginAsLocalAdmin();
    });

    afterAll(() => {
        testFixture.cleanupState();
    });

    it("Can create catalog and delete it again", () => {
        const catalogName = "catalog" + new Date().getTime();

        console.log("Loading page");
        loadPage();
        waitForKendoGrid();

        console.log("Making sure " + catalogName + " does not exist");
        expect(findCatalogColumnsFor(catalogName)).toBeEmptyArray();

        console.log("Creating catalog");
        CatalogHelper.createCatalog(catalogName);

        console.log("Loading page after catalog creation");
        loadPage();
        waitForKendoGrid();
        expect(findCatalogColumnsFor(catalogName).first().getText()).toEqual(catalogName);

        console.log("Deleting catalog");
        CatalogHelper.deleteCatalog(catalogName);

        console.log("Verify that catalog is deleted");
        loadPage();
        expect(findCatalogColumnsFor(catalogName)).toBeEmptyArray();
    });

    function waitForKendoGrid() {
        return CatalogHelper.waitForKendoGrid();
    }

    function loadPage() {
        pageObject.getPage();
    }
});
<commit_msg>wait for kendo<commit_after>﻿import Login = require("../../Helpers/LoginHelper");
import CatalogHelper = require("../../Helpers/CatalogHelper");
import ItSystemEditPo = require("../../PageObjects/it-system/Catalog/ItSystemCatalog.po")
import TestFixtureWrapper = require("../../Utility/TestFixtureWrapper");

describe("LocalAdmin user tests", () => {
    var loginHelper = new Login();
    var pageObject = new ItSystemEditPo();
    var testFixture = new TestFixtureWrapper();
    var findCatalogColumnsFor = CatalogHelper.findCatalogColumnsFor;

    beforeAll(() => {
        loginHelper.loginAsLocalAdmin();
    });

    afterAll(() => {
        testFixture.cleanupState();
    });

    it("Can create catalog and delete it again", () => {
        const catalogName = "catalog" + new Date().getTime();

        console.log("Loading page");
        loadPage();
        waitForKendoGrid();

        console.log("Making sure " + catalogName + " does not exist");
        expect(findCatalogColumnsFor(catalogName)).toBeEmptyArray();

        console.log("Creating catalog");
        CatalogHelper.createCatalog(catalogName);

        console.log("Loading page after catalog creation");
        loadPage();
        waitForKendoGrid();
        expect(findCatalogColumnsFor(catalogName).first().getText()).toEqual(catalogName);

        console.log("Deleting catalog");
        CatalogHelper.deleteCatalog(catalogName);

        console.log("Verify that catalog is deleted");
        loadPage();
        waitForKendoGrid();
        expect(findCatalogColumnsFor(catalogName)).toBeEmptyArray();
    });

    function waitForKendoGrid() {
        return CatalogHelper.waitForKendoGrid();
    }

    function loadPage() {
        pageObject.getPage();
    }
});

{'fraction_non_alphanumeric': 0.14063848144952545, 'fraction_numerical': 0.0, 'mean_word_length': 3.2414634146341466, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7591300', 'n_tokens_mistral': 916, 'n_tokens_neox': 911, 'n_words': 173}