Skip to content

Commit 95ebbf1

Browse files
committed
Fix: Playwright e2e helpers - response body parsing
1 parent dcea719 commit 95ebbf1

File tree

1 file changed

+3
-3
lines changed
  • lib/generators/cypress_on_rails/templates/spec/playwright/support

1 file changed

+3
-3
lines changed

lib/generators/cypress_on_rails/templates/spec/playwright/support/on-rails.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const appCommands = async (data) => {
88
const response = await context.post('/__e2e__/command', { data })
99

1010
expect(response.ok()).toBeTruthy()
11-
return response.body
11+
return response.json();
1212
}
1313

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

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

3232
const response = await context.post("/__e2e__/vcr/eject");
3333
expect(response.ok()).toBeTruthy();
34-
return response.body;
34+
return response.json();
3535
}
3636

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

0 commit comments

Comments
 (0)