<commit_before>Cypress.Commands.add("login", (email, password) => {
    cy.request({
        method: 'POST',
        url: '/login',
        form: true,
        body: { '_username': email, '_password': password }
    }).then(function (response) {
        expect(response.status).to.eq(200);
    });
})

Cypress.Commands.add("visitStandaloneScene", () => {
    cy.visit('/scene/list');
    cy.url().should('eq', Cypress.config('baseUrl') + '/scene/list');
    cy.get('tr').contains(/^Scena$/).parent().find('[title="Edycja"]').click().then(() => {
        cy.url().should('contain', Cypress.config('baseUrl') + '/scene/edit');
    });
});

Cypress.Commands.add("visitSceneForChapter", () => {
    cy.visit('/chapter/list');
    cy.url().should('eq', Cypress.config('baseUrl') + '/chapter/list');
    cy.get('tr').contains(/^Rozdział$/).parent().find('[title="Edycja"]').click().then(() => {
        cy.url().should('contain', Cypress.config('baseUrl') + '/chapter/edit');
        cy.get('.side-menu').contains('Scena 1').parent().find('[title="Edycja"]').click().then(() => {
            cy.url().should('contain', Cypress.config('baseUrl') + '/scene/edit');
        });
    });
});

Cypress.Commands.add("registerAjaxContainerAlias", () => {
    cy.get('#ajax-container').as('ajax-container');
});
<commit_msg>Fixed Cypress tests broken after book/chapter sidemenu updates<commit_after>Cypress.Commands.add("login", (email, password) => {
    cy.request({
        method: 'POST',
        url: '/login',
        form: true,
        body: { '_username': email, '_password': password }
    }).then(function (response) {
        expect(response.status).to.eq(200);
    });
})

Cypress.Commands.add("visitStandaloneScene", () => {
    cy.visit('/scene/list');
    cy.url().should('eq', Cypress.config('baseUrl') + '/scene/list');
    cy.get('tr').contains(/^Scena$/).parent().find('[title="Edycja"]').click().then(() => {
        cy.url().should('contain', Cypress.config('baseUrl') + '/scene/edit');
    });
});

Cypress.Commands.add("visitSceneForChapter", () => {
    cy.visit('/chapter/list');
    cy.url().should('eq', Cypress.config('baseUrl') + '/chapter/list');
    cy.get('tr').contains(/^Rozdział$/).parent().find('[title="Edycja"]').click().then(() => {
        cy.url().should('contain', Cypress.config('baseUrl') + '/chapter/edit');

        cy.get('.side-menu ul li').contains('Sceny').parents('li').first().as('scenes');
        cy.get('@scenes').find('.js-list-toggle').click().then(() => {
            cy.get('@scenes').within(() => {
                cy.contains(/^Scena 1$/).next().find('[title="Edycja"]').click().then(() => {
                    cy.url().should('contain', Cypress.config('baseUrl') + '/scene/edit');
                })
            });
        });
    });
});

Cypress.Commands.add("registerAjaxContainerAlias", () => {
    cy.get('#ajax-container').as('ajax-container');
});

{'fraction_non_alphanumeric': 0.25946317962835513, 'fraction_numerical': 0.0027529249827942187, 'mean_word_length': 3.3002958579881656, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '4482702', 'n_tokens_mistral': 960, 'n_tokens_neox': 947, 'n_words': 98}