當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript browser.controlFlow方法代碼示例

本文整理匯總了TypeScript中protractor.browser.controlFlow方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.controlFlow方法的具體用法?TypeScript browser.controlFlow怎麽用?TypeScript browser.controlFlow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在protractor.browser的用法示例。


在下文中一共展示了browser.controlFlow方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

    it('[C286709] Should display task details for completed task - Task App', async() => {
        let taskName = 'TaskAppCompleted';
        let taskId = await browser.controlFlow().execute(async () => {
            return this.alfrescoJsApi.activiti.taskApi.createNewTask({'name': taskName});
        });

        processServices.goToTaskApp().clickTasksButton();
        taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
        taskPage.tasksListPage().checkContentIsDisplayed(taskName).selectRow('Name', taskName);

        taskPage.completeTaskNoForm();
        taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
        taskPage.tasksListPage().selectRow(taskName);

        let getTaskResponse = await browser.controlFlow().execute(async () => {
            return this.alfrescoJsApi.activiti.taskApi.getTask(taskId.id);
        });

        let taskModel = new TaskModel(getTaskResponse);
        taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
        expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT));
        expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
        expect(taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
        expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
        expect(taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
        expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
        expect(taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
        expect(taskPage.taskDetails().getDuration()).toEqual(taskPage.taskDetails().getDuration());
        expect(taskPage.taskDetails().getEndDate()).toEqual(taskPage.taskDetails().getEndDate());
        expect(taskPage.taskDetails().getParentTaskId()).toEqual('');
        expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.COMPLETED);
    });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:32,代碼來源:task-details.e2e.ts

示例2: it

    it('[C260466] Should be able to display comments from Task on the related Process', () => {
        browser.controlFlow().execute(async() => {
            let taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId});

            let taskId = taskQuery.data[0].id;

            taskComment = {message: 'Task Comment'};

            await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, taskId);
        });

        navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();

        processFiltersPage.clickRunningFilterButton();
        processFiltersPage.selectFromProcessList('Comment APS');

        browser.controlFlow().execute(async() => {
            let addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, {'latestFirst': true});

            commentsPage.checkUserIconIsDisplayed(0);

            expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
            expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
            expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
            expect(commentsPage.getTime(0)).toContain('ago');
        });
    });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:27,代碼來源:comment-component-processes.e2e.ts

示例3: it

    it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', () => {
        browser.controlFlow().execute(async () => {
            await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
                'appId': null,
 'name': processFilter.running_old_first,
 'icon': 'glyphicon-random',
                'filter': {'sort': 'created-asc', 'name': '', 'state': 'running'}
            });
            await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
            await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
            await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
        });

        loginPage.loginToProcessServicesUsingUserModel(user);

        navigationBarPage
            .navigateToProcessServicesPage()
            .goToTaskApp()
            .clickProcessButton();

        processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);

        filtersPage.goToFilter(processFilter.running_old_first);

        browser.controlFlow().execute(async () => {
            processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
                'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
            });
            expect(processesQuery.data[0].name).toEqual('Process 1');
            expect(processesQuery.data[1].name).toEqual('Process 2');
            expect(processesQuery.data[2].name).toEqual('Process 3');
        });

    });

    it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', () => {
        browser.controlFlow().execute(async () => {
            await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
                'appId': null,
 'name': processFilter.completed_old_first,
 'icon': 'glyphicon-random',
                'filter': {'sort': 'created-asc', 'name': '', 'state': 'completed'}
            });

            let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
            let secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
            let thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');

            await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
            await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:34,代碼來源:custom-process-filters-sorting.e2e.ts

示例4: it

    it('[C260234] Should be able to attache a file on a task on APS and check on ADF', () => {
        browser.controlFlow().execute(async() => {
            let newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: 'SHARE KNOWLEDGE'});

            let newTaskId = newTask.id;

            let filePath = path.join(TestConfig.main.rootPath + pngFile.location);

            let file = fs.createReadStream(filePath);

            relatedContent = await this.alfrescoJsApi.activiti.contentApi.createRelatedContentOnTask(newTaskId, file, {'isRelatedContent': true});
            relatedContentId = relatedContent.id;
        });

        navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();

        taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
        taskPage.tasksListPage().selectRow('SHARE KNOWLEDGE');

        attachmentListPage.checkFileIsAttached(pngFile.name);

        browser.controlFlow().execute(async() => {
            await this.alfrescoJsApi.activiti.contentApi.deleteContent(relatedContentId);
        });

        navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();

        taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
        taskPage.tasksListPage().selectRow('SHARE KNOWLEDGE');

        attachmentListPage.checkEmptyAttachmentList();
    });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:32,代碼來源:task-attachmentList-actionMenu.e2e.ts

示例5: it

    it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async () => {
        navigationBarPage.navigateToProcessServicesPage();

        processServicesPage.checkApsContainer();

        processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
        expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);

        browser.controlFlow().execute(() => {
            return apps.importNewVersionAppDefinitionPublishDeployApp(this.alfrescoJsApi, replacingApp.file_location, appVersionToBeDeleted.id);
        });

        browser.refresh();

        processServicesPage.getBackgroundColor(appToBeDeleted.title);

        expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);

        browser.controlFlow().execute(async () => {
            await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
            await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
            await apps.publishDeployApp(this.alfrescoJsApi, appVersionToBeDeleted.id);
        });

        browser.refresh();

        processServicesPage.checkApsContainer();
        processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
        expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
    });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:30,代碼來源:apps-section.e2e.ts

示例6: it

    it('[C286450] Should display the process filter icon when a custom filter is added', () => {
        browser.controlFlow().execute(async () => {
            customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
                'appId': null,
                'name': processFilter.new_icon,
                'icon': 'glyphicon-cloud',
                'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
            });

            filterId = customProcessFilter.id;

            return customProcessFilter;
        });

        loginPage.loginToProcessServicesUsingUserModel(user);
        navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();

        processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);

        appNavigationBarPage.clickSettingsButton();
        appSettingsToggles.enableProcessFiltersIcon();
        appNavigationBarPage.clickProcessButton();

        processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
        expect(processFiltersPage.getFilterIcon(processFilter.new_icon)).toEqual('cloud');
    });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:26,代碼來源:custom-process-filters.e2e.ts

示例7: it

    it('[C260306] Items per page set to 15 and adding of tasks', () => {
        new NavigationBarPage().navigateToProcessServicesPage().goToTaskApp();
        taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
        paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
        expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
        expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
        expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
        expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + (nrOfTasks - 5));
        expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);

        browser.controlFlow().execute(async () => {
            for (i; i < nrOfTasks; i++) {
                await apps.startProcess(this.alfrescoJsApi, resultApp);
            }
        });

        currentPage++;
        paginationPage.clickOnNextPage();
        expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
        expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
        expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
        expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
        expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
        paginationPage.checkNextPageButtonIsDisabled();
        paginationPage.checkPreviousPageButtonIsEnabled();
    });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:26,代碼來源:pagination-tasklist-addingTasks.e2e.ts

示例8: it

    it(`should upload a new image successfully`, () => {
        element(by.className('upload_link')).click();

        expect<any>(element(by.className('upload_button')).getText()).toEqual('Upload');

        // Set properties of file to upload
        element(by.className('form-control')).sendKeys(tag);
        // Change focus
        // https://github.com/SeleniumHQ/selenium/wiki/Frequently-Asked-Questions#q-the-onchange-event-doesnt-fire-after-a-call-sendkeys
        element(by.xpath('//*[@path="title"]')).click();

        // Upload file
        element(by.id('fileupload')).sendKeys(path.resolve(process.cwd(), 'e2e', 'cloudinary_logo.png'));

        // Wait for upload to complete
        expect(element(by.className('status-code')).getText()).toMatch(/Completed with status code 200/i);

        browser.controlFlow().execute(function () {
            // Add this command to the test's control flow so the value changes only after the previous command completes successfully
            deleteByTag = true;
        });

        // Verify the new image exists in the photo list
        element(by.className('back_link')).click();
        expect(element(by.xpath(`//h2[text()="${tag}"]`)).isDisplayed()).toBeTruthy();
    });
開發者ID:RTLcoil,項目名稱:cloudinary_angular,代碼行數:26,代碼來源:app.e2e-spec.ts

示例9: it

        it('[C260181] Should be possible edit all the metadata aspect', () => {
            viewerPage.clickInfoButton();
            viewerPage.checkInfoSideBarIsDisplayed();
            metadataViewPage.clickOnPropertiesTab();
            metadataViewPage.editIconIsDisplayed();

            expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);

            metadataViewPage.clickOnInformationButton();

            metadataViewPage.clickMetadataGroup('EXIF');

            browser.controlFlow().execute(async () => {
                await metadataViewPage.editIconClick();
                metadataViewPage.clickEditPropertyIcons('properties.exif:software');
                metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
                await metadataViewPage.clickUpdatePropertyIcon('properties.exif:software');
                expect(metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');

                metadataViewPage.clickEditPropertyIcons('properties.exif:isoSpeedRatings');
                metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings');
                await metadataViewPage.clickUpdatePropertyIcon('properties.exif:isoSpeedRatings');
                expect(metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');

                metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber');
                metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
                await metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber');
                expect(metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
            });
        });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:30,代碼來源:metadata-smoke-tests.e2e.ts

示例10: it

    it('[C299161] Should redirect user to requested URL after reloading login page', () => {
        settingsPage.setProviderEcm();
        loginPage.login(user.id, user.password);

        browser.controlFlow().execute(async () => {

            navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);

            browser.getCurrentUrl().then((actualUrl) => {
                expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
            });

            contentServicesPage.waitForTableBody();

            navigationBarPage.clickLogoutButton();

            logoutPage.checkLogoutSectionIsDisplayed();

            navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
            loginPage.waitForElements();
            browser.refresh();
            loginPage.waitForElements();

            loginPage.enterUsername(user.id);
            loginPage.enterPassword(user.password);
            loginPage.clickSignInButton();

            navigationBarPage.checkMenuButtonIsDisplayed();

            browser.getCurrentUrl().then((actualUrl) => {
                expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
            });
        });

    });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:35,代碼來源:redirection.e2e.ts


注:本文中的protractor.browser.controlFlow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。