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