本文整理汇总了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));
});
};
示例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(),
);
});
});
示例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);
});
});
});
示例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(),
);
});
});
示例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'},
]),
));
});
});
示例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),
));
});