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


TypeScript MockTestRunner.ran方法代码示例

本文整理汇总了TypeScript中vsts-task-lib/mock-test.MockTestRunner.ran方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MockTestRunner.ran方法的具体用法?TypeScript MockTestRunner.ran怎么用?TypeScript MockTestRunner.ran使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vsts-task-lib/mock-test.MockTestRunner的用法示例。


在下文中一共展示了MockTestRunner.ran方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('Positive path: upload UITest with username and password', (done: MochaDone) => {
        this.timeout(2000);

        let tp = path.join(__dirname, 'L0UITestPass.js');
        let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        tr.run();
        assert(tr.succeeded, 'task should have succeeded');
        assert(tr.invokedToolCount === 4, 'Should have run login, logout, test prepare and test run');
        assert(tr.ran("/path/to/mobile-center login -u MyUsername -p MyPassword --quiet"),
            "Should have run login");

        assert(tr.ran("/path/to/mobile-center logout --quiet"),
            "Should have run logout");

        assert(tr.ran("/path/to/mobile-center test prepare uitest --artifacts-dir " + 
            "/path/to/artifactsDir --app-path /test/path/to/my.ipa --build-dir /path/to/uitest_build_dir --myopts --quiet"), 
            "Should have run prepare");

        assert(tr.ran("/path/to/mobile-center test run manifest " + 
            "--manifest-path /path/to/artifactsDir/manifest.json --app-path " + 
            "/test/path/to/my.ipa --app testuser/testapp --devices 1234abcd " +
            "--test-series master --dsym-dir /path/to/dsym --locale nc_US --quiet"), 
            "Should have run test run");

        done();
    });
开发者ID:colindembovsky,项目名称:vsts-tasks,代码行数:27,代码来源:L0.ts

示例2: it

    it('Xcode 8 create IPA with bad exportOptionsPlist path', (done:MochaDone) => {
        this.timeout(1000);

        let tp = path.join(__dirname, 'L0ExportOptionsPlistBadPath.js');
        let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        tr.run();
        //version
        assert(tr.ran('/home/bin/xcodebuild -version'), 'xcodebuild for version should have been run.');
        //build
        assert(tr.ran('/home/bin/xcodebuild -sdk $(SDK) -configuration $(Configuration) ' +
                '-workspace /user/build/fun.xcodeproj/project.xcworkspace -scheme testScheme build ' +
                'DSTROOT=/user/build/output/$(SDK)/$(Configuration)/build.dst ' +
                'OBJROOT=/user/build/output/$(SDK)/$(Configuration)/build.obj ' +
                'SYMROOT=/user/build/output/$(SDK)/$(Configuration)/build.sym ' +
                'SHARED_PRECOMPS_DIR=/user/build/output/$(SDK)/$(Configuration)/build.pch'),
            'xcodebuild for building the ios project/workspace should have been run.');
        //archive
        assert(tr.ran('/home/bin/xcodebuild -workspace /user/build/fun.xcodeproj/project.xcworkspace -scheme testScheme ' +
                'archive -sdk $(SDK) -configuration $(Configuration) -archivePath /user/build/testScheme'),
            'xcodebuild archive should have been run to create the .xcarchive.');

        assert(tr.invokedToolCount == 3, 'should have run xcodebuild for version, build, and archive.');
        assert(tr.failed, 'task should have failed');
        assert(tr.stdout.indexOf('vso[task.issue type=error;]loc_mock_ExportOptionsPlistInvalidFilePath') >=0,
            'Build should show error indicating invalid Plist file path.');

        done();
    });
开发者ID:ReneSchumacher,项目名称:VSTS-Tasks,代码行数:29,代码来源:L0.ts

示例3: it

    it('macOS provisionless auto export', function (done: MochaDone) {
        this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000);

        const tp = path.join(__dirname, 'L0macOSProvisionlessAutoExport.js');
        const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        tr.run();
        //version
        assert(tr.ran('/home/bin/xcodebuild -version'), 'xcodebuild for version should have been run.');

        //export prep
        assert(tr.ran("/usr/libexec/PlistBuddy -c Clear _XcodeTaskExportOptions.plist"),
            'PlistBuddy Clear should have run. An empty exportOptions plist should be used when there\'s not an embedded provisioning profile.');

        //export
        assert(tr.ran('/home/bin/xcodebuild -exportArchive -archivePath /user/build/testScheme.xcarchive'
            +' -exportPath /user/build -exportOptionsPlist _XcodeTaskExportOptions.plist'),
            'xcodebuild exportArchive should have been run to export the IPA from the .xcarchive');

        assert(tr.stderr.length === 0, 'should not have written to stderr');
        assert(tr.succeeded, 'task should have succeeded');
        assert(tr.invokedToolCount === 6, 'Should have ran 6 command lines.');

        done();
    });
开发者ID:bleissem,项目名称:vsts-tasks,代码行数:25,代码来源:L0.ts

示例4: it

    it('No Code Coverage results fail', function (done) {
        let tp: string = path.join(__dirname, 'L0NoCodeCoverageFail.js');
        let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        try {
            createTemporaryFolders();

            let testStgDir: string = path.join(__dirname, '_temp');

            tr.run();

            assert(tr.failed, 'task should have failed');
            assert(tr.invokedToolCount === 2, 'should have only run gradle 2 times');
            assert(tr.stderr.length === 0, 'should not have written to stderr');
            assert(tr.stdout.indexOf('loc_mock_NoCodeCoverage') > -1, 'should have given an error message');
            assert(tr.ran(gradleWrapper + ` properties`), 'should have run Gradle with properties');
            assert(tr.ran(gradleWrapper + ` clean build jacocoTestReport`), 'should have run Gradle with code coverage');
            cleanTemporaryFolders();

            done();
        } catch (err) {
            console.log(tr.stdout);
            console.log(tr.stderr);
            console.log(err);
            done(err);
        }
    });
开发者ID:grawcho,项目名称:vso-agent-tasks,代码行数:27,代码来源:L0.ts

示例5: it

    it('Xplat MSBuild: Multiple solutions', (done: MochaDone) => {
        this.timeout(1000);

        let tp: string = path.join(__dirname, 'L0MSBuildMultipleSolutions.js');
        let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        tr.run();

        //clean
        assert(tr.ran('/home/bin/xbuild /user/build/fun.sln /t:Clean /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
            '/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild clean should have been run on the solution.');

        assert(tr.ran('/home/bin/xbuild /user/build/test/fun.sln /t:Clean /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
            '/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild clean should have been run on the solution.');

        //build
        assert(tr.ran('/home/bin/xbuild /user/build/fun.sln /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
            '/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild should have been run for building the solution.');

        assert(tr.ran('/home/bin/xbuild /user/build/test/fun.sln /p:Platform=$(Platform) /p:Configuration=$(Configuration) ' +
            '/p:TestProp=TestValue /p:TestProp1=TestValue'), 'xbuild should have been run for building the solution.');

        assert(tr.invokedToolCount === 4, 'should have run xbuild for solution.');
        assert(tr.stderr.length === 0, 'should not have written to stderr');
        assert(tr.succeeded, 'task should have succeeded');

        done();
    });
开发者ID:colindembovsky,项目名称:vsts-tasks,代码行数:28,代码来源:L0.ts


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