summaryrefslogtreecommitdiffstats
path: root/cypress_test/integration_tests/multiuser/impress/slide_operations_user2_spec.js
blob: b50cfe6d3899738b266c4ef2ffdbd4f1c2934236 (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
/* global describe it cy beforeEach require afterEach */

var helper = require('../../common/helper');
var impressHelper = require('../../common/impress_helper');

describe('Slide operations: user-2.', {retries : 0}, function() {
	var testFileName = 'slide_operations.odp';

	beforeEach(function() {
		// Wait here, before loading the document.
		// Opening two clients at the same time causes an issue.
		cy.wait(5000);
		helper.beforeAll(testFileName, 'impress', true);
	});

	afterEach(function() {
		helper.afterAll(testFileName);
	});

	it('Insert/delete slide.', function() {
		// user-1 loads the same document
		cy.get('#tb_actionbar_item_userlist')
			.should('be.visible');

		cy.get('#tb_actionbar_item_userlist .w2ui-tb-caption')
			.should('have.text', '2 users');

		// user-1 inserts a new slide
		impressHelper.assertNumberOfSlidePreviews(2);

		// remove the second slide
		cy.get('#slide-sorter .preview-frame:nth-of-type(3)')
			.click();

		cy.get('#slide-sorter .preview-frame:nth-of-type(3) .preview-img')
			.should('have.class', 'preview-img-currentpart');

		helper.clickOnIdle('#tb_presentation-toolbar_item_deletepage');

		cy.get('.vex-dialog-form .vex-dialog-button-primary')
			.click();

		impressHelper.assertNumberOfSlidePreviews(1);
	});
});