postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

Text Truncation Issue When Copying Long Test Scripts in Postman After AI Postbot Intervention

Open jorismathijssen opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

In Postman, after using the AI Postbot's 'Fix tests' feature on long test scripts, the text gets truncated when attempting to copy it. Parts of the script are replaced with ellipses (...), as seen in the provided example. This issue complicates the use, sharing, or documentation of detailed test scripts.

Steps To Reproduce

  1. Write a series of detailed Postman tests with multiple assertions within a single script.
  2. Use the AI Postbot's 'Fix tests' feature on the script.
  3. Try to copy the entire modified script text.
  4. Observe that parts of the script are truncated and replaced with '...'.
  5. Restart Postman and dont use AI Postbot
  6. Try to copy the entire modified script text.
  7. Observe that now the full script is now available

Screenshots or Videos

// Original Script
pm.test("Response status code is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Each element in the disturbances array has required properties", function () {
    pm.response.json().disturbances.forEach(function(item) {
        pm.expect(item).to.have.property('type');
        pm.expect(item).to.have.property('disturbanceType');
        pm.expect(item).to.have.property('title');
        pm.expect(item).to.have.property('description');
        pm.expect(item).to.have.property('subjects');
        pm.expect(item).to.have.property('startDate');
        pm.expect(item).to.have.property('id');
    });
});

pm.test("Response has a total count property", function () {
    pm.expect(pm.response.json()).to.have.property('totalDisturbances');
});

pm.test("All items have a specific type defined", function () {
    pm.response.json().disturbances.forEach(function(item) {
        pm.expect(item.disturbanceType).to.equal('Unplanned');
    });
});
// Copy script after Postbot has done something
pm.test("Response status code is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Each element in the disturbances array has required properties", function () {
    pm.response.json().disturbances.forEach(function(item) {
        pm.expect(item).to.have.property('type');
        pm.expect(item).to.have.property('disturbanceType');
        pm.expect(item).to.have.property('title');
…
pm.test("All items have a specific type defined", function () {
    pm.response.json().disturbances.forEach(function(item) {
        pm.expect(item.disturbanceType).to.equal('Unplanned');
    });
});

Operating System

Windows

Postman Version

10.22.13

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response

jorismathijssen avatar Feb 07 '24 12:02 jorismathijssen

@jorismathijssen Thanks for the feedback!

The Postbot team is working diligently on adding new capabilities and addressing any bugs.

I am personally looking into this and will post an update as soon as we have released a fix.

Please continue to use Postbot and provide any/all feedback!

kylerRenneker avatar Mar 01 '24 02:03 kylerRenneker

@jorismathijssen We have pushed a fix internally and are testing it. It will included in our upcoming release.

This release is slated for June 19th.

I will post an update once it is available.

kylerRenneker avatar Jun 10 '24 13:06 kylerRenneker

This issue is addressed now. Feel free to comment if this is seen again.

abhijitkane avatar Sep 06 '24 11:09 abhijitkane