How to use the @serenity-js/assertions.contain function in @serenity-js/assertions

To help you get started, we’ve selected a few @serenity-js/assertions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jan-molak / serenity-js / packages / protractor / spec / screenplay / questions / Pick.spec.ts View on Github external
it('picks all the items', () => Peter.attemptsTo(
                Navigate.to(shoppingListPage),

                Ensure.that(Text.ofAll(picked.all()), contain('coconut milk x')),
            ));
github jan-molak / serenity-js / packages / protractor / spec / screenplay / questions / Pick.spec.ts View on Github external
it('picks all the items', () => Peter.attemptsTo(
                Navigate.to(shoppingListPage),

                Ensure.that(Text.ofAll(picked.all()), contain('coconut milk')),
            ));
github jan-molak / serenity-js / packages / protractor / spec / screenplay / questions / Target.spec.ts View on Github external
it('all web elements matching the selector', () => Bernie.attemptsTo(
            Navigate.to(shoppingListPage),

            Ensure.that(Text.ofAll(ShoppingList.Items), contain('oats')),
        ));
github jan-molak / serenity-js / examples / protractor-jasmine-todomvc / spec / manage_a_todo_list.spec.ts View on Github external
it('records new items', function (this: WithStage) {
                return this.stage.theActorCalled('Jasmine').attemptsTo(
                    Start.withAnEmptyList(),
                    RecordItem.called('Walk a dog'),
                    Ensure.that(RecordedItems(), contain('Walk a dog')),
                );
            });
github jan-molak / serenity-js / packages / protractor / spec / screenplay / questions / Pick.spec.ts View on Github external
it('makes it easy for an actor to pick the element of interest', () => Peter.attemptsTo(
            Navigate.to(shoppingListPage),

            Click.on(LinkTo(ItemCalled('coffee'))),

            Ensure.that(CSSClasses.of(ItemCalled('coffee')), contain('buy')),
        ));
github jan-molak / serenity-js / examples / protractor-jasmine-todomvc / spec / manage_a_todo_list.spec.ts View on Github external
it('edits an item', function (this: WithStage) {
                return this.stage.theActorCalled('Jasmine').attemptsTo(
                    Start.withAListContaining('Buy a cake'),
                    RenameItem.called('Buy a cake').to('Buy an apple'),
                    Ensure.that(RecordedItems(), contain('Buy an apple')),
                );
            });
        });
github jan-molak / serenity-js / packages / protractor / spec / screenplay / questions / Pick.spec.ts View on Github external
describe('(when a filter is applied)', () => {

        const picked = Pick.from(ShoppingList.Items).where(CSSClasses, contain('buy'));

        describe('lets the actor filter the list of matching elements so that it', () => {

            it('gets the number of items', () => Peter.attemptsTo(
                Navigate.to(shoppingListPage),

                Ensure.that(picked.count(), equals(2)),
            ));

            it('picks all the items', () => Peter.attemptsTo(
                Navigate.to(shoppingListPage),

                Ensure.that(Text.ofAll(picked.all()), contain('coconut milk x')),
            ));

            it('picks the first item', () => Peter.attemptsTo(
github jan-molak / serenity-js / packages / protractor / spec / screenplay / questions / CSSClasses.spec.ts View on Github external
it('allows for a question relative to another target to be asked', () => Bernie.attemptsTo(
            Navigate.to(testPage),

            Ensure.that(
                CSSClasses.of(
                    Target.the(`Element with single-class`).located(by.id('single-class')),
                ).of(Target.the(`list`).located(by.tagName('ul'))),
                contain('pretty'),
            ),
        ));
    });