Coder Social home page Coder Social logo

Comments (13)

vlucas avatar vlucas commented on August 29, 2024

You can increase the timeout if you like via globalSetup:

frisby.globalSetup({
  timeout: 10000
});

from frisby.

moses-gangipogu avatar moses-gangipogu commented on August 29, 2024

var frisby = require('./lib/frisby');
// Global setup for all tests
frisby.globalSetup({
request: {
headers:{'Accept': 'application/json, application/x-httpd-php', 'Cookie': 'authenticationToken=5363; activationID=11123fgf'}
},
timeout: (30 * 1000)
});
/**
* Tests -> GET
*/
frisby.create(' ')
.get('http://xyz/auto?limit=0')
.expectStatus(200)
.expectHeaderContains('content-type', 'application/json')
.expectJSON('status',{
message: "DATABASE_ERROR",
code: 2
})
.toss();

TRY THIS

from frisby.

AlyonaGavrylei avatar AlyonaGavrylei commented on August 29, 2024

I'm already made earlier action in your first comment and it doesn't help me. Second - I did not check out yet. I'll try today. Thank you.

from frisby.

vlucas avatar vlucas commented on August 29, 2024

Try putting .timeout(10000) on the actual frisby test. Also, if the URL is unreachable, Firsby will sometimes timeout instead of throwing an error, so be sure to check that the URL is correct as well.

from frisby.

AlyonaGavrylei avatar AlyonaGavrylei commented on August 29, 2024

Thank you guys!!!
A second solution help to run my tests. Here is example of header in all test_spec.js files:

var frisby = require("frisby"),
base_url = "http://test.test.test/api/1.0/replies";

frisby.globalSetup({
request: {
headers: {
'content-type': 'application/json'
}, timeout: (30*1000)
}
});

In current time all tests run successfully)

from frisby.

dguerrier avatar dguerrier commented on August 29, 2024

If I run a group of tests in separate files as such
jasmine-node spec/apitest/
I get random 5000 timeouts even though I'm setting a global timeout in every file to 30000

If I run each file in it's own session like so, all is well
for i in spec/apitest/; do jasmine-node $i; done

from frisby.

vlucas avatar vlucas commented on August 29, 2024

Yes unfortunately I have run into this as well. I am not sure the solution to this off hand - it's something I will have to look into (unless someone else can help!).

from frisby.

clmathuriya avatar clmathuriya commented on August 29, 2024

I am also getting random 5000 timeouts even though I'm setting a global timeout in every file to 30000

from frisby.

ravirkkm avatar ravirkkm commented on August 29, 2024

@vlucas
For me sometimes all the assertions are successful i.e., 0 failures, 0 skipped
and very next time a few assertions are failures.

    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

Finished in 8.695 seconds
3 tests, 10 assertions, 2 failure, 0 skipped

I've set the globalSetup timeout to 30000 and if you notice, frisby tests got finished in 8.695
Is this timeout issue ?

Earlier I did not have this issue in my other laptop (may be that was old version of frisby/nodejs)
After I installed latest version of nodejs / frisby , I face this issue.
Any one got the solution for this ?

from frisby.

Gerst20051 avatar Gerst20051 commented on August 29, 2024

👍

from frisby.

dguerrier avatar dguerrier commented on August 29, 2024

Any movement on this?

from frisby.

clmathuriya avatar clmathuriya commented on August 29, 2024

frisby.globalSetup({
timeout: 50000
});

worked for me.

from frisby.

Haisenberh avatar Haisenberh commented on August 29, 2024

Worked for me
frisby.create("Export statements valid test")
.post(base_url, {
token: token
})
.expectStatus(200)
.expectJSON({
fileUrl: String
})
.timeout(60000) //waits 60sec for response
.toss();
});

from frisby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.