Skip to content

Commit

Permalink
cypress: add sheet jump on following test
Browse files Browse the repository at this point in the history
Signed-off-by: Szymon Kłos <[email protected]>
Change-Id: I8933695e5e4b7e99224470da4370bb858c4ad255
  • Loading branch information
eszkadev committed Aug 21, 2024
1 parent 4ed28ee commit 10fbcfe
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions cypress_test/integration_tests/multiuser/calc/cell_cursor_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global describe it cy beforeEach require */

var helper = require('../../common/helper');
var calcHelper = require('../../common/calc_helper');
var desktopHelper = require('../../common/desktop_helper');

describe(['tagmultiuser'], 'Check cell cursor and view behavior', function() {
Expand Down Expand Up @@ -46,4 +47,42 @@ describe(['tagmultiuser'], 'Check cell cursor and view behavior', function() {
// second view should still have cursor at the previous cell: A588+1
cy.cGet('input#addressInput-input').should('have.prop', 'value', 'A589');
});

it('Jump to the other sheet', function() {
// second view follow the first one
cy.cSetActiveFrame('#iframe2');
cy.cGet('#userListHeader').click();
cy.cGet('.user-list-item').eq(1).click();
cy.cGet('.jsdialog-overlay').click({force: true});

// first view goes somewhere in the middle of a sheet
cy.cSetActiveFrame('#iframe1');

cy.cGet('input#addressInput-input').type('{selectAll}A400{enter}');
desktopHelper.assertScrollbarPosition('vertical', 210, 240);
calcHelper.clickOnFirstCell(true, true, false);
cy.cGet('body').type('abc{enter}');

// second view should jump there
cy.cSetActiveFrame('#iframe2');
desktopHelper.assertScrollbarPosition('vertical', 210, 240);

// first view inserts sheet before current one
cy.cSetActiveFrame('#iframe1');
calcHelper.selectOptionFromContextMenu('Insert sheet before this');
cy.cGet('#map').focus();

// we should see A1
cy.cGet('input#addressInput-input').should('have.prop', 'value', 'A1');
desktopHelper.assertScrollbarPosition('vertical', 0, 30);

// verify that second view followed the first one
cy.cSetActiveFrame('#iframe2');
desktopHelper.assertScrollbarPosition('vertical', 0, 30);

// first goes to second sheet and we should see A388
cy.cSetActiveFrame('#iframe1');
cy.cGet('#spreadsheet-tab1').click();
desktopHelper.assertScrollbarPosition('vertical', 210, 240);
});
});

0 comments on commit 10fbcfe

Please sign in to comment.