Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static async checkVideoLocaExist(context){
console.log('==========check video location==========');
const page = context.page;
// close the native dialogs
page.on('dialog',async dialog => {
dialog.dismiss()
});
await sleep(3000);
const text = await page.evaluate(()=>{
var a = document.getElementById('MeetingCompose.LocationInputLabel');
return a && a.parentElement.innerHTML;
});
const brand = context.options.tag.brands;
const result = video_zoom_reg[brand].test(text);
return result;
}
async function testContacts(contactsNames) {
for (let contactName of contactsNames) {
console.log(`Seaching ${contactName} in CTI...`);
const searchBar = await page.$(searchBarSelector);
expect(searchBar).toBeTruthy();
await searchBar.click();
await searchBar.focus();
// click three times to select all
await searchBar.click({
clickCount: 3
});
await searchBar.press('Backspace');
await searchBar.type(contactName);
await sleep(800);
const contactItemSelector = `div[title="${contactName}"]`;
const resultLength = await page.evaluate((contactName, contactItemSelector) => (
Array.prototype.slice.call(document.querySelectorAll(contactItemSelector)).length
), contactName, contactItemSelector);
expect(resultLength).toBeGreaterThanOrEqual(0);
await $(page).click(contactItemSelector, {
selector: 'css'
});
await sleep(800);
const contactTitleSelector = `span[title="${contactName}"]`;
const contactTitle = await page.evaluate((contactName, contactTitleSelector) => (
document.querySelector(contactTitleSelector).innerText
), contactName, contactTitleSelector);
expect(contactTitle).toEqual(contactName);
await $(page).click(backBtnSelector, {
// HACK: get the expand icon selector, seems to be /^_ariaId_\d{3}$/
const contactFolderExpandIconSelector = `button[aria-labelledby="_ariaId_${+contactFolderId.replace('_ariaId_','') + 1}"]`;
if (!expanded) {
console.log('Clicking to expand the contacts section tree.')
await $(outlookPage).click(contactFolderExpandIconSelector, {
selector: 'css'
});
}
console.log('Clicking contact entry and waiting for 15s for entry page to laod.')
await $(outlookPage).click(contactsEntry, {
selector: 'css'
});
await sleep(15000); // wait for loading
console.log('Get contacts names');
// get contact names of the first page.
const officeContactsNames = await outlookPage.evaluate(
(contactListSelector, ariaLableAttr) => (
Array.prototype.slice.call(document.querySelectorAll(contactListSelector))
.map(dom => dom.getAttribute(ariaLableAttr).replace('. Press enter to view more details.', ''))
),
contactListSelector,
ariaLableAttr,
);
console.log(`Close outlook page, got ${officeContactsNames.length} countacts from first page: ${officeContactsNames.join(', ')}.`);
outlookPage.close();
// const officeContactsNames = ["AB 100", "AB 1000", "AB 1001", "AB 1002", "AB 1003", "AB 1004", "AB 1005", "AB 1006", "AB 1007", "AB 1008", "AB 1009", "AB 101", "AB 1010", "AB 1011", "AB 1012", "AB 1013", "AB 1014", "AB 1015", "AB 1016", "AB 1017", "AB 1018", "AB 1019", "AB 102", "AB 1020", "AB 1021", "AB 1022", "AB 1023", "AB 1024", "AB 1025", "AB 1026", "AB 1027", "AB 1028", "AB 1029", "AB 103", "AB 1030", "AB 1031", "AB 1032", "AB 1033", "AB 1034", "AB 1035", "AB 1036", "AB 1037", "AB 1038", "AB 1039", "AB 104", "AB 1040", "AB 1041", "AB 1042", "AB 1043", "AB 1044"];
// const process = createProcess(
// Entry,
// Login,
// AuthorizeOffice
// )(context);
// Authroize Office365
// await process.exec();
await detectAuthPanel(true, options);
/** Click logout and relogin, user still Authorized **/
await $(page).waitFor('[class*="loginNumber"]', {
selector: 'css'
});
await $(page).click('[class*="loginNumber"]', {
selector: 'css'
});
sleep(2000);
await Login.login({
noSkipUserGuide: true
});
await detectAuthPanel(true, options);
/** Click the Unauthorise button **/
await $(page).click('button[class*="AuthorizeSettingsPanel"]', {
selector: 'css'
});
await detectAuthPanel(false, options);
}
} catch (error) {
console.error('oauth error: ', error);
let message;
// Error handling standard in callback uri
// https://openid.net/specs/openid-connect-core-1_0.html#AuthError
// Error handling standard in api response
// https://tools.ietf.org/html/rfc6749#section-4.1.2
switch (error.message) {
case 'invalid_request':
case 'unauthorized_client':
case 'access_denied':
case 'unsupported_response_type':
case 'invalid_scope':
case 'interaction_required':
case 'login_required':
message = authMessages.accessDenied;
break;
case 'server_error':
case 'temporarily_unavailable':
default:
message = authMessages.internalError;
break;
}
this._alert.danger({
message,
payload: error,
});
}
}
import messageTypes from 'ringcentral-integration/enums/messageTypes';
export default {
addLog: "Journal",
editLog: "Modifier le journal",
viewDetails: "Afficher les détails",
addEntity: "Créer nouveau",
call: "Appeler",
text: "SMS",
conversation: "Conversation",
groupConversation: "Conversation de groupe",
voiceMessage: "Message vocal",
[messageTypes.voiceMail]: "Message vocal",
[messageTypes.fax]: "Fax",
mark: "Marquer comme non lu",
unmark: "Marquer comme lu",
delete: "Supprimer",
faxSent: "Fax envoyé",
faxReceived: "Fax reçu",
pages: "pages",
preview: "Afficher",
download: "Télécharger",
imageAttachment: "Pièce jointe : 1 image"
};
// @key: @#@"addLog"@#@ @source: @#@"Log"@#@
// @key: @#@"editLog"@#@ @source: @#@"Edit Log"@#@
// @key: @#@"viewDetails"@#@ @source: @#@"View Details"@#@
// @key: @#@"addEntity"@#@ @source: @#@"Create New"@#@
import messageTypes from 'ringcentral-integration/enums/messageTypes';
export default {
title: 'Messages',
search: 'Recherche...',
noMessages: 'Aucun message',
noSearchResults: 'Aucun enregistrement correspondant trouvé',
composeText: 'Rédiger texto',
[messageTypes.all]: 'Tous',
[messageTypes.voiceMail]: 'Appel',
[messageTypes.text]: 'Texto',
[messageTypes.fax]: 'Fax',
};
// @key: @#@"title"@#@ @source: @#@"Messages"@#@
// @key: @#@"search"@#@ @source: @#@"Search..."@#@
// @key: @#@"composeText"@#@ @source: @#@"Compose Text"@#@
// @key: @#@"noMessages"@#@ @source: @#@"No Messages"@#@
// @key: @#@"noSearchResults"@#@ @source: @#@"No matching records found"@#@
// @key: @#@"[messageTypes.all]"@#@ @source: @#@"All"@#@
// @key: @#@"[messageTypes.voiceMail]"@#@ @source: @#@"Voice"@#@
// @key: @#@"[messageTypes.text]"@#@ @source: @#@"Text"@#@
// @key: @#@"[messageTypes.fax]"@#@ @source: @#@"Fax"@#@
import messageTypes from 'ringcentral-integration/enums/messageTypes';
export default {
search: 'Pesquisar...',
noMessages: 'Nenhuma mensagem',
noSearchResults: 'Nenhum registro correspondente encontrado',
title: 'Mensagens',
composeText: 'Criar texto',
[messageTypes.all]: 'Tudo',
[messageTypes.voiceMail]: 'Voz',
[messageTypes.text]: 'Texto',
[messageTypes.fax]: 'Fax',
};
// @key: @#@"title"@#@ @source: @#@"Messages"@#@
// @key: @#@"search"@#@ @source: @#@"Search..."@#@
// @key: @#@"composeText"@#@ @source: @#@"Compose Text"@#@
// @key: @#@"noMessages"@#@ @source: @#@"No Messages"@#@
// @key: @#@"noSearchResults"@#@ @source: @#@"No matching records found"@#@
// @key: @#@"[messageTypes.all]"@#@ @source: @#@"All"@#@
// @key: @#@"[messageTypes.voiceMail]"@#@ @source: @#@"Voice"@#@
// @key: @#@"[messageTypes.text]"@#@ @source: @#@"Text"@#@
// @key: @#@"[messageTypes.fax]"@#@ @source: @#@"Fax"@#@
import messageTypes from 'ringcentral-integration/enums/messageTypes';
export default {
title: 'Messages',
search: 'Search...',
noMessages: 'No Messages',
noSearchResults: 'No matching records found',
composeText: 'Compose Text',
[messageTypes.all]: 'All',
[messageTypes.voiceMail]: 'Voice',
[messageTypes.text]: 'Text',
[messageTypes.fax]: 'Fax',
};
// @key: @#@"title"@#@ @source: @#@"Messages"@#@
// @key: @#@"search"@#@ @source: @#@"Search..."@#@
// @key: @#@"composeText"@#@ @source: @#@"Compose Text"@#@
// @key: @#@"noMessages"@#@ @source: @#@"No Messages"@#@
// @key: @#@"noSearchResults"@#@ @source: @#@"No matching records found"@#@
// @key: @#@"[messageTypes.all]"@#@ @source: @#@"All"@#@
// @key: @#@"[messageTypes.voiceMail]"@#@ @source: @#@"Voice"@#@
// @key: @#@"[messageTypes.text]"@#@ @source: @#@"Text"@#@
// @key: @#@"[messageTypes.fax]"@#@ @source: @#@"Fax"@#@
import messageTypes from 'ringcentral-integration/enums/messageTypes';
export default {
addLog: "Log",
editLog: "Editar log",
viewDetails: "Exibir detalhes",
addEntity: "Criar novo",
call: "Chamada",
text: "Texto",
conversation: "Conversa",
groupConversation: "Conversa em grupo",
voiceMessage: "Mensagens de voz",
[messageTypes.voiceMail]: "Correio de voz",
[messageTypes.fax]: "Fax",
mark: "Marcar como não lido",
unmark: "Marcar como lido",
delete: "Excluir",
faxSent: "Fax enviado",
faxReceived: "Fax recebido",
pages: "páginas",
preview: "Exibir",
download: "Baixar",
imageAttachment: "Anexo: 1 imagem"
};
// @key: @#@"addLog"@#@ @source: @#@"Log"@#@
// @key: @#@"editLog"@#@ @source: @#@"Edit Log"@#@
// @key: @#@"viewDetails"@#@ @source: @#@"View Details"@#@
// @key: @#@"addEntity"@#@ @source: @#@"Create New"@#@