Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Compatibility with nightwatch-cucumber #20

Open
IvanNaumenko opened this issue Feb 8, 2018 · 5 comments
Open

Compatibility with nightwatch-cucumber #20

IvanNaumenko opened this issue Feb 8, 2018 · 5 comments
Assignees
Labels

Comments

@IvanNaumenko
Copy link

IvanNaumenko commented Feb 8, 2018

Hey guys! I downloaded your package and discovered it doesn't work with nigthwatch-cucumber....((

When I run them I got

Error while running waitForFirstXHR command: trigger should be a function

It would be great if you adept it with that framework

@JalilArfaoui
Copy link
Collaborator

JalilArfaoui commented Feb 9, 2018

Hello @IvanNaumenko

As a user of nightwatch-cucumber myself, I can say that both work together.

But you cannot use a trigger with BDD steps, since you have to write separate steps to start listenning for XHR, and then another step to get what has been listened.

I use :

Given some stuff
And browser listens for XHR
When some action that should trigger XHR
Then something that checks listened XHRs

where :

Given(/browser listens for XHR/, () =>
    client.listenXHR()
);

Then(/something that checks ("something") listened XHRs/, (something) =>
    client.getXHR(someUrlPattern, 2000, (xhrs => {
        assertSomethingWith(xhrs, something);
    }))
);

@IvanNaumenko
Copy link
Author

Thanks! Works!

@DmytroShtanko1
Copy link

Can you create some try project to demonstrate how it works correctly and share it on github?

@DmytroShtanko1
Copy link

xhr
It doesn't show any response code each time. wait 3sec

@Pieras2
Copy link

Pieras2 commented Oct 28, 2019

xhr
It doesn't show any response code each time. wait 3sec

Please look at #42
I had similar case and had to modify client.js in es5 folder.
This might be due to the fact that there are multiple requests in background and last one finishes with 404.

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

No branches or pull requests

4 participants