Skip to content

Commit

Permalink
test(e2e): add plugin for using got
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 19, 2021
1 parent 755ac60 commit 8fafc40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/e2e/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="cypress" />

const got = require('got')
const CRI = require('chrome-remote-interface')
let criPort = 0,
criClient = null
Expand All @@ -16,6 +17,9 @@ module.exports = (on) => {
})

on('task', {
httpRequest(params) {
return got(params).then(({body})=>body)
},
// Reset chrome remote interface for clean state
async resetCRI() {
if (criClient) {
Expand Down

0 comments on commit 8fafc40

Please sign in to comment.