Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Walter Hector Lijo
    @woolter
    @bharukaRupesh I think that here you have all the information that you need https://adamgruber.github.io/mochawesome/
    at the end
    Walter Hector Lijo
    @woolter
    describe("Lookback API", function () {
      var options = {
        headers: {
          'content-type': 'application/json',
          authorization: 'Basic <hash>',
          test:"tt"
        },
        body: {
          projects: [23112780161],
          release: 27036212139,
          features: [33016599886],
          includeUnparented: true
        },
        json: true
      };
      it("The aggregation point should return data", function () {
        var response = chakram.post('https://httpbin.org/post', "", options);
        expect(response).to.have.status(200);
        expect(response).to.have.json('headers.Authorization', 'Basic <hash>');
        expect(response).to.have.json(function(json) {
          console.log(json);
        });
        return chakram.wait();
      });
    });
    this is the code that dareid wrote in the post that I send to you
    Ghost
    @ghost~5b76b19bd73408ce4fa4e91d
    Thanks @woolter
    Given things have worked for me.
    Ghost
    @ghost~5b76b19bd73408ce4fa4e91d
    Hi All,
    As I am novice to chakram I want to know that "is chakram tool still maintained by the official committee?"
    OR
    is it good to go with the chakram tool for api automation?
    I am asking this because I could not find examples or reference material. As some of you are already aware of it, you can share your experience with the tool.
    Walter Hector Lijo
    @woolter
    @bharukaRupesh First at all you need to reed .... xD Chakram is no longer actively maintained, PRs are welcomed this is the second line in the repo https://github.com/dareid/chakram/
    If is good to go it's up to you, I was using chakram for a long time for me is an amazing tool. Anyway in the last project that I've started I didn't use it.
    Ghost
    @ghost~5b76b19bd73408ce4fa4e91d
    Thanks @woolter for your kind response.
    Ish Abbi
    @rookieInTraining
    Hi Everyone, need some info regarding chakram expectations
    I need to compare the responses of two different REST APIs and ensure that the responses do not have the same content
    In order to do that, I'm resolving the promises and then expecting that the two fields are not equal
    var eng = chakram.get(browser.baseUrl);
                expect(eng).to.have.status(200);
                var response = chakram.get(browser.baseUrl + locale);
                expect(response).to.have.status(200);
    
                var engRes = eng.then((res1) => {
                    return res1.body;
                }).then((json) => {
                    var res = response.then((res2) => {
                        expect(res2.body.shortDaysTranslation.wed).to.equal(json.shortDaysTranslation.wed);
                    });
                });
    This code should fail, but it is not failing.. any thoughts?
    Venkat413
    @Venkat413
    @bharukaRupesh u are not resolving the promise here. Do the below thing. might help var response = chakram.post('https://httpbin.org/post', "", options).then(function(data){ your code})
    Venkat413
    @Venkat413
    @rookieInTraining resolve the promise and save the responses RESP1 & RESP2. Then use the chai assertions to compare the objects.
    Ish Abbi
    @rookieInTraining
    Thanks @Venkat413
    Venkat413
    @Venkat413
    any idea of generating the bearer token and use for multiple requests
    jain-neeeraj
    @jain-neeeraj
    @Venkat413 generate it in before block and use it in the it blocks
    Venkat413
    @Venkat413
    @jain-neeeraj Thanks jain. i have tried the same way. Any possibilities u can share with code sample. Using the before/http Authentication. Thanks in advance
    Venkat413
    @Venkat413
    How to execute multiple test cases with a single function. Any ideas
    hitesh-jani
    @hitesh-jani
    Hey guys
    i am starting with api testing
    which library would be better chakram or frisby ?
    can anyone suggest me please?
    jain-neeeraj
    @jain-neeeraj
    @hitesh-jani chakram is a very easy to use library, though it is not actively maintained but should be able to solve most of your problems.
    ajsea
    @agaly
    hi guys can I use Chakram to test API's built with springboot and not nodejs
    jain-neeeraj
    @jain-neeeraj
    @agaly you can hit any REST API with chakram but chakram itself runs on nodejs
    philicia
    @tirzahtoh_twitter
    Hi I am new to this framework, can I have a simple example to get started? thanks
    how do I run the test?
    philicia
    @tirzahtoh_twitter
    Hi I got this error 1) API Testing for voice input
    "before all" hook: login for "should return 200 on success":
    Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/tohlaymui/Desktop/tl_stella-API_test/src/testapp/test/login.test.js)
    dmitriyKowWib
    @dmitriyKowWib
    Please advice
    Don't understand how to use body params with ckackram
    static async postRequest(header: object, url: string, queryParams: object = {}, queryData: object = {}) {
        const apiUrl = getBaseUrl() + url;
        const options: any = {
            headers: header,
            qs: {},
            body: queryData,
            json: true
        };
    
        for (let param in queryParams) {
            options["qs"][param] = queryParams[param];
        }
    
        console.log("I've sent POST to > " + apiUrl);
        return post(apiUrl, "", options);
    }
    returns an error
    hovever fetch works
    const formData = new FormData();
    for (let key in createClipData) {
        formData.append(key, createClipData[key]);
    }
    let response = await fetch(getBaseUrl() + createClipUrl, {method: "POST", headers: postHeader, body: formData});
    let responseBody = await response.json();
    Artur
    @aabdullin
    Hey guys
    does anyone using it for api tests?
    dmitriyKowWib
    @dmitriyKowWib
    I stopped using it. IT has too many bugs.
    Not recommend you too
    Artur
    @aabdullin
    @dmitriyKowWib thanks
    protesterr
    @protesterr
    Hi,

    I am new to Chakram, and we are trying to automate our RESTAPI using Chakram. I want to get the token value before proceeding for test case execution.
    But its not working as intended. Am I missing anything here.
    Appreciate your help.

    Scenario:

    var token;

    describe('Tests for data validation', function () {
    before('Obtain token using account creds', function () {
    var request = require('request');
    request({
    url: authurls.tokenurl,
    method: 'POST',
    headers: tokenheader,
    form: tokenform
    }, function (err, res) {
    var json = JSON.parse(res.body);
    token = json.access_token;
    })
    })

    Test cases are getting executed before obtaining the token
    @dareid pls help
    i3oges
    @i3oges
    @protesterr your callback function in the request is probably not being executed until after your before and the rest of your tests run. Consider using a promise based request api and use async/await to wait for the request to finish.
    Joseph Adams
    @adamsjoe

    Hey - just messing about with Chakram and a local API - I have some tests in Postman, so using these as my basis to try out Chakram. I'm failing at the start here, I call my API (localhost:8888)
    However, I can't seem to access the response object. I have tried console logging the response (object Promise) was the output, I have tried response.body - that didn't work.

     it("should have 3 categories post initial install", function () {
            var response = chakram.get("http://localhost:8888/api/blog/categories/");
            // console.log('>>>' + response);
            // return expect(response.body).length.to.equal(3);
            // expect(response).to.have.json("name", "Sci-Fi");
            console.log('>>>' + JSON.stringify(response.body));
            return chakram.wait();
        });

    Ideally I'd like to be able to check that 3 elements were returned.

    AnishVohra
    @AnishVohra
    I am facing the an issue while using the Chakram package :
    Getting ReferenceError: afterEach is not defined at Object.<anonymous> error
    Does any one has any idea how to resolve this issue, I tried uninstalling all npm packages and then installing Mocha and then installing res of packages but it's still giving the same error while trying to run the test from IntelliJ
    AnishVohra
    @AnishVohra
    I am using Chakram version 1.5.0 and Mocha version 8.2.1
    Yamenk Gribaudo
    @knemay_gitlab
    I want Chakram test to fail when status code is 2**. How should i do that?