Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Created a Cypress test for Spacing attribute in desktop Writer
Signed-off-by: Ezinne Nnamani <nnamani.ezinne@collabora.com>
Change-Id: Iefbffc90fc794b61815b92fd54702a4215858dc7
Signed-off-by: Ezinne Nnamani <nnamani.ezinne@collabora.com>
  • Loading branch information
Ezinnem authored and tzolnai committed Nov 10, 2020
1 parent 43db7bf commit d0210de
Showing 1 changed file with 80 additions and 1 deletion.
Expand Up @@ -19,7 +19,7 @@ describe('Top toolbar tests.', function() {
afterEach(function() {
helper.afterAll(testFileName);
});

it('Apply highlight color.', function() {
cy.get('#tb_editbar_item_backcolor')
.click();
Expand Down Expand Up @@ -185,6 +185,85 @@ describe('Top toolbar tests.', function() {
.should('have.attr', 'align', 'justify');
});

it('Apply Line spacing: 1', function() {
cy.get('#tb_editbar_item_linespacing')
.click();

cy.contains('.menu-text', 'Line Spacing: 1.5')
.click();

helper.reselectAllText();

cy.get('#copy-paste-container p')
.should('have.attr', 'style', 'margin-bottom: 0in; font-style: normal; font-weight: normal; line-height: 150%');


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

cy.contains('.menu-text', 'Line Spacing: 1')
.click();

helper.reselectAllText();

cy.get('#copy-paste-container p')
.should('have.attr', 'style', 'margin-bottom: 0in; font-style: normal; font-weight: normal; line-height: 100%');
});

it('Apply Line spacing: 1.5', function() {
cy.get('#tb_editbar_item_linespacing')
.click();

cy.contains('.menu-text', 'Line Spacing: 1.5')
.click();

helper.reselectAllText();

cy.get('#copy-paste-container p')
.should('have.attr', 'style', 'margin-bottom: 0in; font-style: normal; font-weight: normal; line-height: 150%');
});

it('Apply Line spacing: 2', function() {
cy.get('#tb_editbar_item_linespacing')
.click();

cy.contains('.menu-text', 'Line Spacing: 2')
.click();

helper.reselectAllText();

cy.get('#copy-paste-container p')
.should('have.attr', 'style', 'margin-bottom: 0in; font-style: normal; font-weight: normal; line-height: 200%');
});

it('Increase/Decrease Paragraph spacing', function() {
cy.get('#tb_editbar_item_linespacing')
.click();

cy.contains('.menu-text', 'Increase Paragraph Spacing')
.click();

helper.reselectAllText();

cy.get('#copy-paste-container p')
.should('have.attr', 'style', 'margin-top: 0.04in; margin-bottom: 0.04in; font-style: normal; font-weight: normal; line-height: 100%');

helper.reselectAllText();

//Decrease Paragraph Spacing
cy.get('#tb_editbar_item_linespacing')
.click();

cy.contains('.menu-text', 'Decrease Paragraph Spacing')
.click();

helper.reselectAllText();

cy.get('#copy-paste-container p')
.should('have.attr', 'style', 'margin-bottom: 0in; font-style: normal; font-weight: normal; line-height: 100%');

});

it('Toggle numbered list.', function() {
cy.get('#tb_editbar_item_defaultnumbering')
.click();
Expand Down

0 comments on commit d0210de

Please sign in to comment.