Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Increase/Decrease font-size #16506

Merged
merged 2 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -420,3 +420,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"]';
5 changes: 4 additions & 1 deletion bigbluebutton-tests/playwright/core/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,17 @@ class Page {
await expect(locator).toHaveValue(value);
}


async backgroundColorTest(selector, color) {
await expect(await this.page.$eval(selector, e => getComputedStyle(e).backgroundColor)).toBe(color);
}

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();
});
});