Merge pull request #16432 from gabriellpr/cc-type-test
test: closed captions typing
This commit is contained in:
commit
93175cc4a7
@ -33,6 +33,7 @@ const CaptionsButton = ({ intl, isActive, handleOnClick }) => (
|
||||
size="lg"
|
||||
onClick={handleOnClick}
|
||||
id={isActive ? 'stop-captions-button' : 'start-captions-button'}
|
||||
data-test="startViewingClosedCaptionsBtn"
|
||||
/>
|
||||
);
|
||||
|
||||
|
@ -71,7 +71,7 @@ class LiveCaptions extends PureComponent {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={captionStyles}>
|
||||
<div data-test="liveCaptions" style={captionStyles}>
|
||||
{clear ? '' : data}
|
||||
</div>
|
||||
<div style={visuallyHidden}>
|
||||
|
@ -395,6 +395,7 @@ class ReaderMenu extends PureComponent {
|
||||
label={intl.formatMessage(intlMessages.start)}
|
||||
onClick={() => this.handleStart()}
|
||||
disabled={locale == null}
|
||||
data-test="startViewingClosedCaptions"
|
||||
/>
|
||||
</Styled.Actions>
|
||||
</Styled.Footer>
|
||||
|
@ -140,6 +140,7 @@ class WriterMenu extends PureComponent {
|
||||
aria-describedby="descriptionStart"
|
||||
onClick={this.handleStart}
|
||||
disabled={locale == null}
|
||||
data-test="startWritingClosedCaptions"
|
||||
/>
|
||||
<div id="descriptionStart" hidden>{intl.formatMessage(intlMessages.ariaStartDesc)}</div>
|
||||
</Styled.Content>
|
||||
|
@ -308,6 +308,7 @@ class UserOptions extends PureComponent {
|
||||
description: intl.formatMessage(intlMessages.captionsDesc),
|
||||
key: this.captionsId,
|
||||
onClick: this.handleCaptionsClick,
|
||||
dataTest: 'writeClosedCaptions',
|
||||
});
|
||||
}
|
||||
if (amIModerator) {
|
||||
|
@ -345,6 +345,13 @@ exports.lockPrivateChat = 'input[data-test="lockPrivateChat"]';
|
||||
exports.lockEditSharedNotes = 'input[data-test="lockEditSharedNotes"]';
|
||||
exports.lockUserList = 'input[data-test="lockUserList"]';
|
||||
|
||||
// Closed Captions
|
||||
exports.writeClosedCaptions = 'li[data-test="writeClosedCaptions"]';
|
||||
exports.startWritingClosedCaptions = 'button[data-test="startWritingClosedCaptions"]';
|
||||
exports.startViewingClosedCaptionsBtn = 'button[data-test="startViewingClosedCaptionsBtn"]';
|
||||
exports.startViewingClosedCaptions = 'button[data-test="startViewingClosedCaptions"]';
|
||||
exports.liveCaptions = 'div[data-test="liveCaptions"]';
|
||||
|
||||
// Locales
|
||||
exports.locales = ['af', 'ar', 'az', 'bg-BG', 'bn', 'ca', 'cs-CZ', 'da', 'de',
|
||||
'dv', 'el-GR', 'en', 'eo', 'es', 'es-419', 'es-ES', 'es-MX', 'et', 'eu',
|
||||
|
@ -5,6 +5,7 @@ const e = require('../core/elements');
|
||||
const { waitAndClearDefaultPresentationNotification } = require('../notifications/util');
|
||||
const { sleep } = require('../core/helpers');
|
||||
const { checkAvatarIcon, checkIsPresenter, checkMutedUsers } = require('./util');
|
||||
const { getNotesLocator } = require('../sharednotes/util');
|
||||
const { checkTextContent } = require('../core/util');
|
||||
const { getSettings } = require('../core/settings');
|
||||
const { ELEMENT_WAIT_LONGER_TIME } = require('../core/constants');
|
||||
@ -265,6 +266,27 @@ class MultiUsers {
|
||||
|
||||
await this.modPage.hasElement(e.multiUsersWhiteboardOn);
|
||||
}
|
||||
|
||||
async writeClosedCaptions() {
|
||||
await this.modPage.waitForSelector(e.whiteboard);
|
||||
await this.modPage2.waitForSelector(e.whiteboard);
|
||||
|
||||
await this.modPage.waitAndClick(e.manageUsers);
|
||||
await this.modPage.waitAndClick(e.writeClosedCaptions);
|
||||
await this.modPage.waitAndClick(e.startWritingClosedCaptions);
|
||||
|
||||
await this.modPage.waitAndClick(e.startViewingClosedCaptionsBtn);
|
||||
await this.modPage2.waitAndClick(e.startViewingClosedCaptionsBtn);
|
||||
|
||||
await this.modPage.waitAndClick(e.startViewingClosedCaptions);
|
||||
await this.modPage2.waitAndClick(e.startViewingClosedCaptions);
|
||||
|
||||
const notesLocator = getNotesLocator(this.modPage);
|
||||
await notesLocator.type(e.message);
|
||||
|
||||
await this.modPage.hasText(e.liveCaptions, e.message);
|
||||
await this.modPage2.hasText(e.liveCaptions, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
exports.MultiUsers = MultiUsers;
|
||||
|
@ -226,6 +226,13 @@ test.describe.parallel('User', () => {
|
||||
await multiusers.initUserPage(false);
|
||||
await multiusers.muteAllUsersExceptPresenter();
|
||||
});
|
||||
|
||||
test('Write closed captions', async ({ browser, context, page }) => {
|
||||
const multiusers = new MultiUsers(browser, context);
|
||||
await multiusers.initModPage(page, true);
|
||||
await multiusers.initModPage2(true);
|
||||
await multiusers.writeClosedCaptions();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe.parallel('Mobile devices', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user