Skip to content

Commit

Permalink
Merge pull request #16506 from gabriellpr/font-size-test
Browse files Browse the repository at this point in the history
test: Increase/Decrease font-size
  • Loading branch information
antobinary committed Jan 25, 2023
2 parents dcd177c + f51927a commit 2749336
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ class ApplicationMenu extends BaseMenu {
label={intl.formatMessage(intlMessages.decreaseFontBtnLabel)}
aria-label={`${intl.formatMessage(intlMessages.decreaseFontBtnLabel)}, ${ariaValueLabel}`}
disabled={isSmallestFontSize}
data-test="decreaseFontSize"
/>
</Styled.Col>
<Styled.Col>
Expand All @@ -495,6 +496,7 @@ class ApplicationMenu extends BaseMenu {
label={intl.formatMessage(intlMessages.increaseFontBtnLabel)}
aria-label={`${intl.formatMessage(intlMessages.increaseFontBtnLabel)}, ${ariaValueLabel}`}
disabled={isLargestFontSize}
data-test="increaseFontSize"
/>
</Styled.Col>
</Styled.PullContentRight>
Expand Down
4 changes: 4 additions & 0 deletions bigbluebutton-tests/playwright/core/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,7 @@ exports.fullscreenModal = 'div[id="fsmodal"]';
exports.simpleModal = 'div[id="simpleModal"]';
exports.sharedNotesBackground = 'div[data-test="notes"]';
exports.whiteboardOptionsButton = 'button[data-test="whiteboardOptionsButton"]';

// Font size
exports.increaseFontSize = 'button[data-test="increaseFontSize"]';
exports.descreaseFontSize = 'button[data-test="decreaseFontSize"]';
4 changes: 4 additions & 0 deletions bigbluebutton-tests/playwright/core/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ class Page {
async textColorTest(selector, color) {
await expect(await this.page.$eval(selector, e => getComputedStyle(e).color)).toBe(color);
}

async fontSizeCheck(selector, size) {
await expect(await this.page.$eval(selector, e => getComputedStyle(e).fontSize)).toBe(size);
}
}

module.exports = exports = Page;
31 changes: 31 additions & 0 deletions bigbluebutton-tests/playwright/options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,37 @@ class Options extends Page {
await this.waitAndClick(e.modalConfirmButton);
await this.backgroundColorTest(e.presentationToolbarWrapper, 'rgb(39, 42, 42)');
}

async fontSizeTest() {
// Increasing font size
await openSettings(this);
await this.waitAndClick(e.increaseFontSize);
await this.waitAndClick(e.modalConfirmButton);

await this.fontSizeCheck(e.chatButton, '16px');//text + icon
await this.fontSizeCheck(e.chatWelcomeMessageText, '16px');
await this.fontSizeCheck(e.chatMessages, '16px');
await this.fontSizeCheck(e.sharedNotes, '14px');
await this.fontSizeCheck(e.userslist, '16px');
await this.fontSizeCheck(e.currentUser, '16px');
await this.fontSizeCheck(e.actionsBarBackground, '16px');
await this.fontSizeCheck(e.navbarBackground, '24px');

// Decreasing font size
await openSettings(this);
await this.waitAndClick(e.descreaseFontSize);
await this.waitAndClick(e.descreaseFontSize);
await this.waitAndClick(e.modalConfirmButton);

await this.fontSizeCheck(e.chatButton, '12px');
await this.fontSizeCheck(e.chatWelcomeMessageText, '12px');
await this.fontSizeCheck(e.chatMessages, '12px')
await this.fontSizeCheck(e.sharedNotes, '10.5px');
await this.fontSizeCheck(e.userslist, '12px');
await this.fontSizeCheck(e.currentUser, '12px');
await this.fontSizeCheck(e.actionsBarBackground, '12px');
await this.fontSizeCheck(e.navbarBackground, '18px');
}
}

exports.Options = Options;
6 changes: 6 additions & 0 deletions bigbluebutton-tests/playwright/options/options.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@ test.describe.parallel('Settings', () => {
await darkModeTest.init(true, true);
await darkModeTest.darkMode();
});

test('Font size', async ({ browser, page }) => {
const fontSize = new Options(browser, page);
await fontSize.init(true, true);
await fontSize.fontSizeTest();
});
});

0 comments on commit 2749336

Please sign in to comment.