當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。