Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot rewrite chain steps with descriptions to Promise approach #26

Open
arcady-zherdev opened this issue Jun 16, 2022 · 1 comment
Open
Labels

Comments

@arcady-zherdev
Copy link

It would be nice to be able to rewrite chain-steps w/ desc config to Promise approach.

Like the following step for example:

{ click : '.b-button[data-ref="addTaskButton"]', desc : 'Clicked Add task button' },

to something like:

await t.click('.b-button[data-ref="addTaskButton"]');

Using the above approach we cannot achieve the same result ..writing the code like this:

await t.click('.b-button[data-ref="addTaskButton"]');
t.pass('Clicked Add task button');

doesn't help in case click() fails since then it does not use the assertion text.

@arcady-zherdev
Copy link
Author

arcady-zherdev commented Jun 16, 2022

I might've put that badly. I didn't mean changing just click functionality.

Generally speaking we can provide desc to any chain step which allows to write tests like this:

    t.it('Undo/Redo should be clear clear after load', (t) => {
        t.chain(
            { waitForPropagate : gantt },
            { click : '.b-button[data-ref="addTaskButton"]', desc : 'Clicked Add task button' },
            { waitForSelector : '.b-badge[data-ref="undoBtn"][data-badge="1"]', desc : 'Undo badge is 1' },
            { click : tools.addTaskButton.element },
            { waitForSelector : '.b-badge[data-ref="undoBtn"][data-badge="2"]', desc : 'Undo badge is 2' },
            { click : tools.undoBtn.element },
            { waitForSelector : '.b-badge[data-ref="undoBtn"][data-badge="1"]', desc : 'Undo badge is 1' },
            { waitForSelector : '.b-badge[data-ref="redoBtn"][data-badge="1"]', desc : 'Redo badge is 1' },
            clickLoadButton,
            { waitForSelectorNotFound : '.b-badge[data-ref="undoBtn"]', desc : 'Undo  badge is hidden' },
            { waitForSelectorNotFound : '.b-badge[data-ref="redoBtn"]', desc : 'Redo badge is hidden' }
        );
    });

which is impossible to rewrite to Promise-approach at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants