{"size": 3941, "ext": "js", "max_stars_repo_path": "cypress/integration/default/sidebar.inc.js", "max_stars_repo_name": "daiwai/phpDocumentor", "max_stars_repo_stars_event_min_datetime": "2020-03-29T19:45:07.000Z", "max_stars_repo_stars_event_max_datetime": "2020-03-29T19:45:07.000Z", "max_issues_repo_path": "cypress/integration/default/sidebar.inc.js", "max_issues_repo_name": "daiwai/phpDocumentor", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "cypress/integration/default/sidebar.inc.js", "max_forks_repo_name": "daiwai/phpDocumentor", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.1176470588, "max_line_length": 85, "alphanum_fraction": 0.548591728}
import {getSidebarHeaderByTitle, getSidebarItemByTitle} from "./helpers/sidebar.lib";
import {shouldVisitPageWithTitle} from "./helpers/pages.lib";

export default function() {
    it('Has "Documentation" in the menu as title', function() {
        cy.get('.phpdocumentor-title').contains("Documentation");
    });

    describe('Namespaces section', function() {
        it('Shows the Namespaces section', function () {
            getSidebarHeaderByTitle('Namespaces')
                .should('be.visible');
        })

        it('Shows the "Marios" namespace', function () {
            getSidebarItemByTitle('Namespaces', 'Marios', 'namespace')
                .should('be.visible');
        });

        it('Opens the "Marios" namespace', function() {
            getSidebarItemByTitle('Namespaces', 'Marios', 'namespace')
                .click();

            shouldVisitPageWithTitle('/namespaces/marios.html', 'Marios');
        });

        it('Shows the "Pizza" (sub)namespace', function() {
            cy.get('.phpdocumentor-sidebar .phpdocumentor-list').contains("Pizza");
        });

        it('Opens the "Pizza" namespace', function() {
            cy.get('.phpdocumentor-sidebar .phpdocumentor-list').contains("Pizza")
                .click();

            shouldVisitPageWithTitle('/namespaces/marios-pizza.html', 'Pizza');
        });
    });

    describe('Packages section', function() {
        it('Shows the Packages section', function () {
            getSidebarHeaderByTitle('Packages')
                .should('be.visible');
        })

        it('Shows the "Default" package', function () {
            getSidebarItemByTitle('Packages', 'Default')
                .should('be.visible');
        });

        it('Opens the "Default" package', function() {
            getSidebarItemByTitle('Packages', 'Default')
                .click();
            shouldVisitPageWithTitle('/packages/Default.html', 'Default');
        });
    });

    describe('Reports section', function() {
        it('Shows the Reports section', function () {
            getSidebarHeaderByTitle('Reports')
                .should('be.visible');
        });

        it('Has a report with Deprecated elements', function () {
            getSidebarItemByTitle('Reports', 'Deprecated')
                .should('be.visible');
        });

        it('Has a report with Errors', function () {
            getSidebarItemByTitle('Reports', 'Errors')
                .should('be.visible');
        });

        it('Has a report with Markers', function () {
            getSidebarItemByTitle('Reports', 'Markers')
                .should('be.visible')
        });

        it('Opens the Deprecated elements report', function() {
            getSidebarItemByTitle('Reports', 'Deprecated')
                .click();

            shouldVisitPageWithTitle('/reports/deprecated.html', 'Deprecated');
        });

        it('Opens the Errors report', function() {
            getSidebarItemByTitle('Reports', 'Errors')
                .click();

            shouldVisitPageWithTitle('/reports/errors.html', 'Errors');
        });

        it('Opens the Markers report', function() {
            getSidebarItemByTitle('Reports', 'Markers')
                .click();

            shouldVisitPageWithTitle('/reports/markers.html', 'Markers');
        });
    });

    describe('Indices section', function() {
        it('Shows the Indices section', function () {
            getSidebarHeaderByTitle('Indices')
                .should('be.visible');
        });

        it('Has a index with all files in it', function () {
            getSidebarItemByTitle('Indices', 'Files')
                .should('be.visible');
        });

        it('Opens the Files index', function() {
            getSidebarItemByTitle('Indices', 'Files')
                .click();

            shouldVisitPageWithTitle('/indices/files.html', 'Files');
        });
    });
};
