2024-05-01 09:56:48 -05:00
|
|
|
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
|
2024-09-24 07:23:18 -05:00
|
|
|
cy.scrollTo('bottom', {
|
2024-08-19 08:42:45 -05:00
|
|
|
timeout: 5 * 1000,
|
|
|
|
});
|
2024-05-01 09:56:48 -05:00
|
|
|
|
|
|
|
// 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();
|
2024-09-30 04:49:02 -05:00
|
|
|
e2e.components.PanelEditor.applyButton().click();
|
2024-05-01 09:56:48 -05:00
|
|
|
|
2024-09-30 04:49:02 -05:00
|
|
|
// And the last panel should still be visible!
|
2024-08-21 09:05:07 -05:00
|
|
|
e2e.components.Panels.Panel.title('Panel #50').should('be.visible');
|
2024-05-01 09:56:48 -05:00
|
|
|
});
|
|
|
|
});
|