Merge pull request #15525 from gabriellpr/about-modal
test: About Modal Test
This commit is contained in:
commit
2be6909e26
@ -55,6 +55,7 @@ const AboutComponent = ({ intl, settings }) => {
|
||||
|
||||
return (
|
||||
<Modal
|
||||
data-test="aboutModalTitleLabel"
|
||||
title={intl.formatMessage(intlMessages.title)}
|
||||
dismiss={{
|
||||
label: intl.formatMessage(intlMessages.dismissLabel),
|
||||
|
@ -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 />),
|
||||
|
@ -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"]';
|
@ -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;
|
20
bigbluebutton-tests/playwright/options/options.spec.js
Normal file
20
bigbluebutton-tests/playwright/options/options.spec.js
Normal 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();
|
||||
});
|
||||
});
|
@ -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;
|
@ -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();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user