github.com/grafana/pyroscope@v1.18.0/cypress/e2e/smoke.cy.ts (about) 1 // / <reference types="cypress" /> 2 describe('smoke', () => { 3 beforeEach(function () { 4 const apiBasePath = Cypress.env('apiBasePath') || ''; 5 6 cy.intercept(`${apiBasePath}/querier.v1.QuerierService/LabelNames`, { 7 fixture: 'profileTypes.json', 8 }).as('profileTypes'); 9 }); 10 11 it('loads admin page', () => { 12 cy.visit('/admin'); 13 }); 14 15 it('loads single view (/)', () => { 16 cy.visit('/'); 17 cy.wait(`@profileTypes`); 18 }); 19 20 it('loads comparison view (/comparison)', () => { 21 cy.visit('/comparison'); 22 cy.wait(`@profileTypes`); 23 }); 24 25 it('loads diff view (/comparison-diff)', () => { 26 cy.visit('/comparison-diff'); 27 cy.wait(`@profileTypes`); 28 }); 29 30 it('changes path when navigating', () => { 31 const clickSidebar = (name: string) => { 32 cy.get('nav.pro-menu .pro-item-content') 33 .filter(`:contains("${name}")`) 34 .parent() 35 .parent() 36 .click(); 37 }; 38 39 cy.visit('/'); 40 cy.url().should('contain', '/'); 41 cy.title().should('include', 'Single'); 42 43 clickSidebar('Comparison View'); 44 cy.url().should('contain', '/comparison'); 45 cy.title().should('include', 'Comparison'); 46 47 clickSidebar('Diff View'); 48 cy.url().should('contain', '/comparison-diff'); 49 cy.title().should('include', 'Diff'); 50 51 clickSidebar('Tag Explorer'); 52 cy.url().should('contain', '/explore'); 53 cy.title().should('include', 'Tag Explorer'); 54 55 clickSidebar('Single'); 56 cy.url().should('contain', '/'); 57 cy.title().should('include', 'Single'); 58 }); 59 });