当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript browser.setFileDetector方法代码示例

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

    }
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:26,代码来源:apps.actions.ts

示例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);
    }
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:8,代码来源:apps.actions.ts

示例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);
    }
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:8,代码来源:users.actions.ts

示例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;
    }
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:9,代码来源:apps.actions.ts

示例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);

            });
        });
    }
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:13,代码来源:drop.actions.ts

示例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;
    }
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:14,代码来源:apps.actions.ts

示例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()))
  }
开发者ID:jiang263,项目名称:PeerTube,代码行数:18,代码来源:video-upload.po.ts


注:本文中的protractor.browser.setFileDetector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。