grafana/e2e/various-suite/explore.spec.ts

43 lines
1.5 KiB
TypeScript
Raw Normal View History

import { e2e } from '../utils';
describe('Explore', () => {
beforeEach(() => {
e2e.flows.login(e2e.env('USERNAME'), e2e.env('PASSWORD'));
});
it('Basic path through Explore.', () => {
e2e.pages.Explore.visit();
e2e.pages.Explore.General.container().should('have.length', 1);
e2e.components.RefreshPicker.runButtonV2().should('have.length', 1);
// delete query history queries that would be unrelated
e2e.components.QueryTab.queryHistoryButton().should('be.visible').click();
cy.get('button[title="Delete query"]').each((button) => {
button.trigger('click');
});
cy.get('button[title="Delete query"]').should('not.exist');
e2e.components.QueryTab.queryHistoryButton().should('be.visible').click();
e2e.components.DataSource.TestData.QueryTab.scenarioSelectContainer()
.scrollIntoView()
.should('be.visible')
.within(() => {
cy.get('input[id*="test-data-scenario-select-"]').should('be.visible').click();
});
cy.contains('CSV Metric Values').scrollIntoView().should('be.visible').click();
const canvases = cy.get('canvas');
Prometheus: Add support for Exemplars (#28057) * Fix typos * Query exemplars API * Add link to traceID * Update exemplar to show more information Reduce exemplars density * Fix typos * Query exemplars API * Add link to traceID * Update exemplar to show more information Reduce exemplars density * Update GraphNG legend type * Show new graph component in Explore * Add exemplar annotation a design update * Graph panel not to show red line annotation Exemplar plugin to use y value * Address review comments * Density filter for exemplars * Update schema of exemplars * Density filter with y-value sampling * Enforce axis scales to include 0 * Changes after merge with master * Show metrics when there is no result * Decorators tests fix * ExemplarMarker to receive component prop * Remove context menu from explore graph * Add color to graph * Update explore graph panel * Update graph config to use default values * Fix data source tests * Do not show exemplars outside of graph * Add exemplars switch * Fix typos * Add exemplars query only when enabled * Show graph in explore without filling it * Update exemplars plugin y value scale selection * Update tests * Add data source picker for internal linking * Increase pointSize for better visibility * Fix explore e2e test * Fix data link title variable interpolation * Use new switch component in PromExemplarField * Move FieldLink component to new file * Convert exemplar to datalink * Add legend toggling logic to Explore * Add legend toggling to Explore * Address Ivana's feedback * Address Andrej's comments * Address Gio's feedback * Add tests for result_transformer * Fix eslint issues * Change sampler formula for better readability Co-authored-by: David Kaltschmidt <david@leia.lan> Co-authored-by: David Kaltschmidt <david@leia.fritz.box> Co-authored-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
2021-01-15 09:20:20 -06:00
canvases.should('have.length', 1);
Query History: Implement RemoteStorage methods: get all, add new (#48330) * Load Rich History when the container is opened * Store rich history for each pane separately * Do not update currently opened query history when an item is added It's impossible to figure out if the item should be added or not, because filters are applied in the backend. We don't want to replicate that filtering logic in frontend. One way to make it work could be by refreshing both panes. * Test starring and deleting query history items when both panes are open * Remove e2e dependency on ExploreId * Fix unit test * Assert exact queries * Simplify test * Fix e2e tests * Fix toolbar a11y * Reload the history after an item is added * Fix unit test * Remove references to Explore from generic PageToolbar component * Update test name * Fix test assertion * Add issue item to TODO * Improve test assertion * Simplify test setup * Move query history settings to persistence layer * Fix test import * Fix unit test * Fix unit test * Test local storage settings API * Code formatting * Fix linting errors * Add an integration test * Add missing aria role * Fix a11y issues * Fix a11y issues * Use divs instead of ul/li Otherwis,e pa11y-ci reports the error below claiming there are no children with role=tab: Certain ARIA roles must contain particular children (https://dequeuniversity.com/rules/axe/4.3/aria-required-children?application=axeAPI) (#reactRoot > div > main > div:nth-child(3) > div > div:nth-child(1) > div > div:nth-child(1) > div > div > nav > div:nth-child(2) > ul) <ul class="css-af3vye" role="tablist"><li class="css-1ciwanz"><a href...</ul> * Clean up settings tab * Remove redundant aria label * Remove redundant container * Clean up test assertions * Move filtering to persistence layer * Move filtering to persistence layer * Simplify applying filters * Split applying filters and reloading the history * Debounce updating filters * Update tests * Fix waiting for debounced results * Clear results when switching tabs * Improve test coverage * Update docs * Revert extra handling for uid (will be added when we introduce remote storage) * Create basic plan * Rename query history toggle * Add list of supported features and add ds name to RichHistoryQuery object * Clean up Removed planned items will be addressed in upcoming prs (filtering and pagination) * Handle data source filters * Simplify DTO conversion * Clean up * Fix betterer conflicts * Fix imports * Fix imports * Post-merge fixes * Use config instead of a feature flag * Use config instead of a feature flag * Update converter tests * Add tests for RichHistoryRemoteStorage * Simplify test setup * Simplify assertion * Add e2e test for query history * Remove duplicated entry * Fix unit tests * Improve readability * Remove unnecessary casting * Mock backend in integration tests * Remove unnecessary casting * Fix integration test * Update betterer results * Fix unit tests * Simplify testing with DataSourceSrv * Fix sorting and add to/from filtering * Simplify testing DataSourceSettings * Update betterer results * Ensure previous request is canceled when getting search results * Add loading message when results are being loaded * Show info message only if local storage is enabled * Fix unit test * Reuse sort order options * Reuse sort order options * Fix footer spacing
2022-05-17 05:59:16 -05:00
// Both queries above should have been run and be shown in the query history
e2e.components.QueryTab.queryHistoryButton().should('be.visible').click();
e2e.components.QueryHistory.queryText().should('have.length', 1).should('contain', 'csv_metric_values');
// delete all queries
cy.get('button[title="Delete query"]').each((button) => {
button.trigger('click');
});
});
});