本文整理汇总了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()))
}