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


TypeScript serenity-js.serenity类代码示例

本文整理汇总了TypeScript中serenity-js.serenity的典型用法代码示例。如果您正苦于以下问题:TypeScript serenity类的具体用法?TypeScript serenity怎么用?TypeScript serenity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: todoUserSteps

export = function todoUserSteps() {

    // let actor : Actor;
    let stage = serenity.callToStageFor({
        actor: (name) => Actor.named(name).whoCan(BrowseTheWeb.using(protractor.browser))
    });

    this.setDefaultTimeout(30 * 1000);  // The todomvc.com website can sometimes be a bit slow to load, so we tell
                                        // Cucumber to give it up to 30 seconds to get ready.

    this.Given(/^.*that (.*) has a todo list containing (.*)$/, function (actorName: string, items: string) {
        // actor = Actor.named(actorName).whoCan(BrowseTheWeb.using(protractor.browser));

        return stage.theActorCalled(actorName).attemptsTo(
            Start.withATodoListContaining(listOf(items))
        );
    });

    this.When(/^s?he adds (.*?) to (?:his|her) list$/, function (itemName: string) {
        return stage.theActorInTheSpotlight().attemptsTo(
            AddATodoItem.called(itemName)
        );
    });

    this.Then(/^.* todo list should contain (.*?)$/, function (items: string){
        return expect(stage.theActorInTheSpotlight().toSee(TodoList.Items_Displayed)).eventually.deep.equal(listOf(items));
    });
};
开发者ID:ayyappasiri,项目名称:serenityjs-screenplay,代码行数:28,代码来源:todo_user.steps.ts

示例2: describe

describe('Walks and Events Manager', function () {
    this.timeout(150 * 1000);
    const stage = serenity.callToStageFor(new Public());
    const actor = stage.theActorCalled('nick');

    it('process command parameters', () => {
        return actor.attemptsTo(
            RequestParameterExtractor.extractTask(),
            UseAngular.disableSynchronisation(),
            Start.onWalksAndEventsManager(),
        );
    });

});
开发者ID:nbarrett,项目名称:ekwg,代码行数:14,代码来源:process-command-args.ts

示例3: describe

describe('Navigating to Walks Page', () => {

    const stage = serenity.callToStageFor(new Public());
    const actor = stage.theActorCalled('nonLoggedIn');

    describe('Walks Page', () => {
        describe('Walks filter select', () => {
            it('displays walks from today onwards by default', () => actor.attemptsTo(
                Start.onWalksProgramme(),
                See.if(WalksProgrammeQuestions.FilterCriteria, equals('Walks Today Onwards')),
            )).timeout(10000);
            it('displays walks in ascending order by default', () => actor.attemptsTo(
                Start.onWalksProgramme(),
                See.if(WalksProgrammeQuestions.SortAscendingCriteria, equals('Sort (date ascending)')),
                See.if(WalkSummaries.displayed(), showWalksOnAllOf(['Sun 11-Jun-2017',
                    'Sun 18-Jun-2017',
                    'Sun 25-Jun-2017',
                    'Sun 02-Jul-2017',
                    'Sun 09-Jul-2017',
                    'Sun 16-Jul-2017',
                    'Sun 23-Jul-2017',
                    'Sun 30-Jul-2017',
                    'Sun 06-Aug-2017',
                    'Sun 13-Aug-2017',
                    'Sun 20-Aug-2017',
                    'Sun 27-Aug-2017',
                    'Sun 03-Sep-2017',
                    'Sun 10-Sep-2017',
                    'Sun 17-Sep-2017',
                    'Sun 24-Sep-2017',
                    'Sun 01-Oct-2017',
                ])),
            )).timeout(30000);
            it('displays all walks');
            it('displays walks with no leader');
            it('displays walks with no details');
        });

        describe('Walks filter quick search', () => {
            it('allows filtering by matching word', () => actor.attemptsTo(
                Start.onWalksProgramme(),
                FilterWalks.toShowOnly('nick'),
            )).timeout(5000);
        });
    });

});
开发者ID:nbarrett,项目名称:ekwg,代码行数:47,代码来源:walksProgramme.ts

示例4: describe

describe('Walks and Events Manager', function () {
    this.timeout(250 * 1000);
    const stage = serenity.callToStageFor(new Public());
    const actor = stage.theActorCalled(process.env['RAMBLERS_USER'] || 'Stuart');

    it('walk upload', () => {
        return actor.attemptsTo(
            UseAngular.disableSynchronisation(),
            Start.onWalksAndEventsManager(),
            Login.toRamblers(),
            FilterWalks.toShowAll(),
            DeleteWalks.requested(),
            UploadWalks.requested(),
            Publish.walksAwaitingApproval(),
        );
    });

});
开发者ID:nbarrett,项目名称:ekwg,代码行数:18,代码来源:walks-upload.ts

示例5: describe

describe('Ramblers contacts', function () {
    this.timeout(900 * 1000);
    const stage = serenity.callToStageFor(new Public());
    const actor = stage.theActorCalled('nick');

    beforeEach(() =>
        actor.attemptsTo(
            UseAngular.disableSynchronisation(),
            Start.onContacts(),
            Login.toRamblers()));

    describe('Contacts listing', () => {
        const allContacts = [];
        it('allows scraping of all content', () => actor.attemptsTo(
            ListContacts.andAppendTo(allContacts),
            Click.on(ContactsTargets.page2),
            WaitFor.ramblersToFinishProcessing(),
            ListContacts.andAppendTo(allContacts),
            Click.on(ContactsTargets.page3),
            WaitFor.ramblersToFinishProcessing(),
            ListContacts.andAppendTo(allContacts),
            SummariseContacts.toFile(allContacts),
        ));

    });

    describe('Contacts individual creation', () => {
        it('allows creation of a single contact', () => actor.attemptsTo(
            CreateContact.usingData(new Contact('Caroline', 'Courtney', 'Caroline C', 'courtneycaroline@hotmail.com', '07425 140196')),
        ));

    });

    describe('Contacts bulk creation', () => {
        it('allows creation of a single contact', () => actor.attemptsTo(
            Click.on(ContactsTargets.addContact),
            CreateContacts.usingData([
                {firstName: 'Desiree', lastName: 'Nel', displayName: 'Des N', email: 'desireenel@hotmail.com', contactNumber: '07741485170'},
            ]),
        ));

    });
});
开发者ID:nbarrett,项目名称:ekwg,代码行数:43,代码来源:contacts.ts

示例6: describe

describe('Walks and Events Manager', function () {
    this.timeout(150 * 1000);
    const stage = serenity.callToStageFor(new Public());
    const actor = stage.theActorCalled('nick');
    const fileName = '/Users/nick/dev/git-personal/ekwg/non-vcs/walk-exports/walks-export-07-February-2018-08-39.csv';
    const expectedWalks = 4;
    it('allows a file to be uploaded and published that replaces all existing walks', () => actor.attemptsTo(
        UseAngular.disableSynchronisation(),
        Start.onWalksAndEventsManager(),
        Login.toRamblers(),
        FilterWalks.toShowAll(),
        DeleteWalks.all(),
        UploadWalks.fileWithNameAndCount(fileName, expectedWalks),
        Publish.walksAwaitingApproval(),
    ));

    it('allows a file to be uploaded, replacing supplied walk ids', () => actor.attemptsTo(
        UseAngular.disableSynchronisation(),
        Start.onWalksAndEventsManager(),
        Login.toRamblers(),
        FilterWalks.toShowAll(),
        DeleteWalks.withIds(3953611, 3953609),
        UploadWalks.fileWithNameAndCount(fileName, expectedWalks),
        Publish.walksAwaitingApproval(),
    ));

    it('test question', () => actor.attemptsTo(
        UseAngular.disableSynchronisation(),
        Start.onWalksAndEventsManager(),
        Login.toRamblers(),
        SelectWalks.withStatus('Published'),
        SelectWalks.withIds(3955387),
        DeleteWalks.withIds(3955389),
    ));

});
开发者ID:nbarrett,项目名称:ekwg,代码行数:36,代码来源:walksAndEventsManager.ts


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