本文整理匯總了TypeScript中protractor.browser.setFileDetector方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.setFileDetector方法的具體用法?TypeScript browser.setFileDetector怎麽用?TypeScript browser.setFileDetector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類protractor.browser
的用法示例。
在下文中一共展示了browser.setFileDetector方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: startProcess
async startProcess(alfrescoJsApi, app, processName?: string) {
browser.setFileDetector(new remote.FileDetector());
let appDefinitionsList = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
let appDefinition = appDefinitionsList.data.filter((currentApp) => {
return currentApp.name === app.name;
});
let processDefinitionList = await alfrescoJsApi.activiti.processApi.getProcessDefinitions({ deploymentId: appDefinition.deploymentId });
let chosenProcess = processDefinitionList.data.find( (processDefinition) => {
return processDefinition.name === processName;
});
let processDefinitionIdToStart = chosenProcess ? chosenProcess.id : processDefinitionList.data[0].id;
let startProcessOptions: any = { processDefinitionId: processDefinitionIdToStart };
if (typeof processName !== 'undefined') {
startProcessOptions.name = processName;
}
return await alfrescoJsApi.activiti.processApi.startNewProcessInstance(startProcessOptions);
}
示例2: importApp
async importApp(alfrescoJsApi, appFileLocation) {
browser.setFileDetector(new remote.FileDetector());
let pathFile = path.join(TestConfig.main.rootPath + appFileLocation);
let file = fs.createReadStream(pathFile);
return await alfrescoJsApi.activiti.appsApi.importAppDefinition(file);
}
示例3: changeProfilePictureAps
async changeProfilePictureAps(alfrescoJsApi, fileLocation) {
browser.setFileDetector(new remote.FileDetector());
let pathFile = path.join(TestConfig.main.rootPath + fileLocation);
let file = fs.createReadStream(pathFile);
return alfrescoJsApi.activiti.profileApi.uploadProfilePicture(file);
}
示例4: publishDeployApp
async publishDeployApp(alfrescoJsApi, appId) {
browser.setFileDetector(new remote.FileDetector());
let publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appId, new AppPublish());
await alfrescoJsApi.activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] });
return publishApp;
}
示例5: dropFolder
dropFolder(dropArea, folderPath) {
browser.setFileDetector(new remote.FileDetector());
let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, folderPath));
fs.accessSync(absolutePath, fs.constants.F_OK);
return dropArea.getWebElement().then((element) => {
browser.executeScript(JS_BIND_INPUT_FOLDER, element).then((input: any) => {
input.sendKeys(absolutePath);
});
});
}
示例6: importNewVersionAppDefinitionPublishDeployApp
async importNewVersionAppDefinitionPublishDeployApp(alfrescoJsApi, appFileLocation, modelId) {
browser.setFileDetector(new remote.FileDetector());
let pathFile = path.join(TestConfig.main.rootPath + appFileLocation);
let file = fs.createReadStream(pathFile);
let appCreated = await alfrescoJsApi.activiti.appsApi.importNewAppDefinition(modelId, file);
let publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appCreated.id, new AppPublish());
await alfrescoJsApi.activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] });
return appCreated;
}
示例7: uploadVideo
async uploadVideo () {
browser.setFileDetector(new FileDetector())
const fileToUpload = join(__dirname, '../../fixtures/video.mp4')
const fileInputSelector = '.upload-video-container input[type=file]'
const parentFileInput = '.upload-video .button-file'
// Avoid sending keys on non visible element
await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`)
// await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`)
await browser.executeScript(`document.querySelector('${parentFileInput}').style.overflow = 'initial'`)
const elem = element(by.css(fileInputSelector))
await elem.sendKeys(fileToUpload)
// Wait for the upload to finish
await browser.wait(browser.ExpectedConditions.elementToBeClickable(this.getSecondStepSubmitButton()))
}