Skip to content

Commit

Permalink
Fix: Playwright e2e helpers - response body parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
helio3197 committed Nov 3, 2024
1 parent dcea719 commit 95ebbf1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const appCommands = async (data) => {
const response = await context.post('/__e2e__/command', { data })

expect(response.ok()).toBeTruthy()
return response.body
return response.json();
}

const app = (name, options = {}) => appCommands({ name, options }).then((body) => body[0])
Expand All @@ -23,15 +23,15 @@ const appVcrInsertCassette = async (cassette_name, options) => {
Object.keys(options).forEach(key => options[key] === undefined ? delete options[key] : {});
const response = await context.post("/__e2e__/vcr/insert", {data: [cassette_name,options]});
expect(response.ok()).toBeTruthy();
return response.body;
return response.json();
}

const appVcrEjectCassette = async () => {
const context = await contextPromise;

const response = await context.post("/__e2e__/vcr/eject");
expect(response.ok()).toBeTruthy();
return response.body;
return response.json();
}

export { appCommands, app, appScenario, appEval, appFactories, appVcrInsertCassette, appVcrEjectCassette }

0 comments on commit 95ebbf1

Please sign in to comment.