summaryrefslogtreecommitdiffstats
path: root/cypress_test/integration_tests/desktop/calc/apply_font_spec.js
blob: 012c0c3cd7e5b4974958a0cf924c4ca72900301e (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
/* global describe it cy beforeEach require afterEach */

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

describe('Apply font changes.', function() {
	var origTestFileName = 'apply_font.ods';
	var testFileName;

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

		calcHelper.clickOnFirstCell();
	});

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

	it('Apply font name',function() {

		cy.get('#tb_editbar_item_fonts').click();

		cy.contains('.select2-results__option','Linux Libertine G')
			.click();

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td font')
			.should('have.attr', 'face', 'Linux Libertine G');
	});

	it('Apply font size.', function() {
		cy.get('#tb_editbar_item_fontsizes').click();

		cy.contains('.select2-results__option','14')
			.click();

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td font')
			.should('have.attr', 'size', '4');
	});

	it('Apply bold font', function() {
		helper.clickOnIdle('#tb_editbar_item_bold');

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td b')
			.should('exist');
	});

	it('Apply italic font.', function() {
		helper.clickOnIdle('#tb_editbar_item_italic');

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td i')
			.should('exist');
	});

	it('Apply underline.', function() {
		helper.clickOnIdle('#tb_editbar_item_underline');

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td u')
			.should('exist');
	});

	it('Apply strikeout.', function() {
		helper.clickOnIdle('#tb_editbar_item_strikeout');

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td s')
			.should('exist');
	});

	it('Apply font color.', function() {
		helper.clickOnIdle('#tb_editbar_item_fontcolor');

		cy.get('.color[name="FF011B"]')
			.click();

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td font')
			.should('have.attr', 'color', '#FF011B');
	});

	it('Apply highlight color', function() {
		helper.clickOnIdle('#tb_editbar_item_backgroundcolor');

		cy.get('.color[name="FF011B"]')
			.click();

		calcHelper.selectEntireSheet();

		cy.get('#copy-paste-container table td')
			.should('have.attr', 'bgcolor', '#FF011B');
	});
});