Merge pull request #15525 from gabriellpr/about-modal

test: About Modal Test
This commit is contained in:
Anton Georgiev 2022-08-22 13:05:11 -04:00 committed by GitHub
commit 2be6909e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 16 deletions

View File

@ -55,6 +55,7 @@ const AboutComponent = ({ intl, settings }) => {
return (
<Modal
data-test="aboutModalTitleLabel"
title={intl.formatMessage(intlMessages.title)}
dismiss={{
label: intl.formatMessage(intlMessages.dismissLabel),

View File

@ -224,6 +224,7 @@ class SettingsDropdown extends PureComponent {
{
key: 'list-item-about',
icon: 'about',
dataTest: 'aboutModal',
label: intl.formatMessage(intlMessages.aboutLabel),
// description: intl.formatMessage(intlMessages.aboutDesc),
onClick: () => mountModal(<AboutContainer />),

View File

@ -307,3 +307,7 @@ exports.pencil = 'button[data-test="pencilTool"]';
exports.showMoreSharedNotesButton = 'span[class="show-more-icon-btn"]'
exports.exportSharedNotesButton = 'button[aria-label="Import/Export from/to different file formats"]';
exports.exportPlainButton = 'span[id="exportplain"]';
// About modal
exports.showAboutModalButton = 'li[data-test="aboutModal"]';
exports.aboutModal = 'div[data-test="aboutModalTitleLabel"]';

View File

@ -1,13 +1,19 @@
const Page = require('../core/page');
const { openSettings, getLocaleValues } = require('./util');
const { openAboutModal, openSettings, getLocaleValues } = require('./util');
const e = require('../core/elements');
class Language extends Page {
class Options extends Page {
constructor(browser, page) {
super(browser, page);
}
async test() {
async openedAboutModal() {
await openAboutModal(this);
await this.hasElement(e.closeModal);
}
async localesTest() {
const selectedKeysBySelector = {
[e.messageTitle]: 'app.userList.messagesTitle',
[e.notesTitle]: 'app.userList.notesTitle',
@ -42,4 +48,4 @@ class Language extends Page {
}
}
exports.Language = Language;
exports.Options = Options;

View File

@ -0,0 +1,20 @@
const { test } = require('@playwright/test');
const { Options } = require('./options');
test.describe.parallel('Options', () => {
test('Open about modal', async ({ browser, page }) => {
const about = new Options(browser, page);
await about.init(true, true);
await about.openedAboutModal();
});
});
test.describe.parallel('Settings', () => {
// https://docs.bigbluebutton.org/2.6/release-tests.html#application-settings
test(`Locales`, async ({ browser, page }) => {
test.slow();
const language = new Options(browser, page);
await language.init(true, true);
await language.localesTest();
});
});

View File

@ -29,5 +29,11 @@ async function getLocaleValues(elements, locale) {
return currentValues;
}
async function openAboutModal(test) {
await test.waitAndClick(e.optionsButton);
await test.waitAndClick(e.showAboutModalButton);
}
exports.openAboutModal = openAboutModal;
exports.openSettings = openSettings;
exports.getLocaleValues = getLocaleValues;

View File

@ -1,12 +0,0 @@
const { test } = require('@playwright/test');
const { Language } = require('./language');
test.describe.parallel('Settings', () => {
// https://docs.bigbluebutton.org/2.6/release-tests.html#application-settings
test(`Locales`, async ({ browser, page }) => {
test.slow();
const language = new Language(browser, page);
await language.init(true, true);
await language.test();
});
});