Files
hoppscotch/tests/e2e/integration/proxy.spec.js
Liyas Thomas 7d5c246a1f Updating tests
2020-03-12 22:28:25 +05:30

26 lines
914 B
JavaScript

describe("Proxy disabled - local request", () => {
it("Change default url with query and make a request to local cat api", () => {
cy.seedAndVisit("catapi", "/?url=https://api.thecatapi.com&path=")
.get("#url")
.then(el => expect(el.val() === "https://api.thecatapi.com").to.equal(true))
.get("#response-details-wrapper", { timeout: 24000 })
.should("be.visible")
.should($wrapper => {
expect($wrapper).to.contain("FAKE Cat API")
})
})
})
describe("Proxy enabled - external request", () => {
it("Enable the proxy and make a request to the real cat api", () => {
cy.enableProxy("/?url=https://postwoman.io&path=/.netlify/functions/api")
.get("#send")
.click()
.get("#response-details-wrapper", { timeout: 24000 })
.should("be.visible")
.should($wrapper => {
expect($wrapper).to.contain("Hello World")
})
})
})