summaryrefslogtreecommitdiffstats
path: root/cypress_test/integration_tests/desktop/calc/statusbar_spec.js
blob: ba91b6feb4bb0ee35e3abe3ac70e1c2a0f06ad10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* global describe it cy beforeEach require afterEach Cypress */

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

describe('Statubar tests.', function() {
	var testFileName = 'statusbar.ods';

	beforeEach(function() {
		helper.beforeAll(testFileName, 'calc');

		if (Cypress.env('INTEGRATION') === 'nextcloud') {
			desktopHelper.showStatusBarIfHidden ();
		}
	});

	afterEach(function() {
		helper.afterAll(testFileName, this.currentTest.state);
	});

	it('Selected sheet.', function() {
		cy.get('#StatusDocPos')
			.should('have.text', 'Sheet 1 of 2');

		helper.clickOnIdle('.spreadsheet-tab', 'Sheet2');

		cy.get('#StatusDocPos')
			.should('have.text', 'Sheet 2 of 2');

		helper.clickOnIdle('.spreadsheet-tab', 'Sheet1');

		cy.get('#StatusDocPos')
			.should('have.text', 'Sheet 1 of 2');
	});

	it('Multiple cell selection.', function() {
		cy.get('#RowColSelCount')
			.should('have.text', '\u00a0Select multiple cells\u00a0');

		helper.typeIntoInputField('input#addressInput', 'A1:A2');

		cy.get('#RowColSelCount')
			.should('have.text', 'Selected: 2 rows, 1 column');

		helper.typeIntoInputField('input#addressInput', 'A1');

		cy.get('#RowColSelCount')
			.should('have.text', '\u00a0Select multiple cells\u00a0');
	});

	it.skip('Text editing mode.', function() {
		cy.get('#InsertMode')
			.should('have.text', '\u00a0Insert mode: inactive\u00a0');

		calcHelper.dblClickOnFirstCell();

		cy.get('#InsertMode')
			.should('have.text', 'Insert');

		calcHelper.typeIntoFormulabar('{enter}');

		cy.get('#InsertMode')
			.should('have.text', '\u00a0Insert mode: inactive\u00a0');
	});

	it('Selected data summary.', function() {
		cy.get('#StateTableCell')
			.should('have.text', 'Average: ; Sum: 0');

		helper.typeIntoInputField('input#addressInput', 'A1:A2');

		cy.get('#StateTableCell')
			.should('have.text', 'Average: 15.5; Sum: 31');

		helper.typeIntoInputField('input#addressInput', 'A1');

		cy.get('#StateTableCell')
			.should('have.text', 'Average: 10; Sum: 10');
	});

	it('Change zoom level.', function() {
		desktopHelper.resetZoomLevel();

		desktopHelper.shouldHaveZoomLevel('100');

		desktopHelper.zoomIn();

		desktopHelper.shouldHaveZoomLevel('120');

		desktopHelper.zoomOut();

		desktopHelper.shouldHaveZoomLevel('100');
	});

	it('Select zoom level.', function() {
		desktopHelper.resetZoomLevel();

		desktopHelper.shouldHaveZoomLevel('100');

		desktopHelper.selectZoomLevel('280');

		desktopHelper.shouldHaveZoomLevel('280');
	});
});