grafana/e2e/dashboards-suite/general-dashboards.spec.ts
Torkel Ödegaard 43dba8c3f9
DashboardScene: Support bodyScrolling (#91888)
* Progress

* Fix dashboards pane

* almost working

* add hook to get scopesDashboardsScene state

* check whether it's enabled when considering opened state

* add height to container

* Update

* revert change

* Make it work when bodyScrolling is disabled

* Last tweaks

* Update scenes

* Updating

* Fix

* fix tests

* fix lint  issues

* fix lint  issues

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2024-08-19 15:42:45 +02:00

31 lines
1023 B
TypeScript

import { e2e } from '../utils';
const PAGE_UNDER_TEST = 'edediimbjhdz4b/a-tall-dashboard';
describe('Dashboards', () => {
beforeEach(() => {
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD'));
});
it('should restore scroll position', () => {
e2e.flows.openDashboard({ uid: PAGE_UNDER_TEST });
e2e.components.Panels.Panel.title('Panel #1').should('be.visible');
// scroll to the bottom
cy.get('#page-scrollbar').scrollTo('bottom', {
timeout: 5 * 1000,
});
// The last panel should be visible...
e2e.components.Panels.Panel.title('Panel #50').should('be.visible');
// Then we open and close the panel editor
e2e.components.Panels.Panel.menu('Panel #50').click({ force: true }); // it only shows on hover
e2e.components.Panels.Panel.menuItems('Edit').click();
e2e.components.PanelEditor.applyButton().click();
// And the last panel should still be visible!
e2e.components.Panels.Panel.title('Panel #50').should('be.visible');
});
});