Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core/components/parameter-row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,17 @@ export default class ParameterRow extends Component {
const Markdown = getComponent("Markdown")
const ParameterExt = getComponent("ParameterExt")

let paramWithMeta = specSelectors.parameterWithMeta(pathMethod, param.get("name"), param.get("in"))

let schema = param.get("schema")
let type = isOAS3 && isOAS3() ? param.getIn(["schema", "type"]) : param.get("type")
let isFormData = inType === "formData"
let isFormDataSupported = "FormData" in win
let required = param.get("required")
let itemType = param.getIn(isOAS3 && isOAS3() ? ["schema", "items", "type"] : ["items", "type"])
let value = param ? param.get("value") : ""
let value = paramWithMeta ? paramWithMeta.get("value") : ""
let extensions = getExtensions(param)


let paramItems // undefined
let paramItemsEnum // undefined
let isDisplayParamItemsEnum = false
Expand Down
53 changes: 53 additions & 0 deletions test/e2e/scenarios/oas3/pet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
describe("render pet api container", function () {
let mainPage
let apiWrapper
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.page.main()

client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.openapi.yaml")
.click("button.download-url-button")
.pause(1000)

apiWrapper = mainPage.section.apiWrapper

done()
})
afterEach(function (client, done) {
done()
})
describe("GET /pet/{petId}", () => {
it("should render Try-It-Out flow correctly", function (client) {
apiWrapper.waitForElementVisible("#operations-pet-updatePetWithForm", 10000)
.assert.containsText("#operations-pet-updatePetWithForm > div > span.opblock-summary-path > a > span", "/pet")
.click("#operations-pet-updatePetWithForm")
.waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div", 5000)
.click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.opblock-section > div.opblock-section-header > div.try-out > button")
.waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button", 1000)
.click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button")
.assert.cssClassNotPresent("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button", "cancel")

client.end()
})

it("should have stable input values", function (client) {
client.waitForElementVisible("#operations-pet-updatePetWithForm", 10000)
.assert.containsText("#operations-pet-updatePetWithForm > div > span.opblock-summary-path > a > span", "/pet")
.click("#operations-pet-updatePetWithForm")
.waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div", 5000)
.click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.opblock-section > div.opblock-section-header > div.try-out > button")
.waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button", 1000)
.setValue("#operations-pet-updatePetWithForm td.parameters-col_description > input", "12345")
.click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button")
.pause(800) // for swagger-api/swagger-ui#4269, which happens above 350ms
.assert.containsText("#operations-pet-updatePetWithForm div.responses-inner > div > div > div:nth-child(2) > div > pre", "http://localhost:3204/pet/12345")
.assert.value("#operations-pet-updatePetWithForm td.parameters-col_description > input", "12345")

client.end()
})
})
})
Loading