import{ Ensure, equals }from'@serenity-js/assertions' import{ describe, it }from'@serenity-js/playwright-test' describe(`Todo List App`,()=>{ it(`should allow me to add a todo item`,async({ actor })=>{ await actor.attemptsTo( startWithAnEmptyList(), recordItem('Buy some milk'), Ensure.that(itemNames(),equals([ 'Buy some milk', ])), ) }) it('supports multiple actors using separate browsers',async({ actorCalled })=>{ awaitactorCalled('Alice').attemptsTo( startWithAListContaining( 'Feed the cat' ), ) awaitactorCalled('Bob').attemptsTo( startWithAListContaining( 'Walk the dog' ), ) awaitactorCalled('Alice').attemptsTo( Ensure.that(itemNames(),equals([ 'Feed the cat' ])), ) awaitactorCalled('Bob').attemptsTo( Ensure.that(itemNames(),equals([ 'Walk the dog' ])), ) }) })
Declares a single test scenario.
Example
Learn more
test
function