This commit is contained in:
2024-05-24 15:27:07 +03:00
parent 17df2ce6a9
commit fc1da2c238
643 changed files with 110185 additions and 231 deletions

View File

@ -0,0 +1,42 @@
describe("bug #4196: HTTP basic auth credential retention", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4196.yaml")
.click("button.download-url-button")
done()
})
afterEach(function (client, done) {
done()
})
it("should display the most recent auth data across modal close/opens", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.click("button.btn.authorize") // Open modal
.waitForElementVisible("section>input", 5000)
.setValue("section>input", "aaa") // Set user
.waitForElementVisible(`section>input[type="password"]`, 5000)
.setValue(`section>input[type="password"]`, "aaa") // Set password
.click(".auth-btn-wrapper button:nth-child(1)") // Click Authorize
.assert.containsText("div.wrapper:nth-child(4)>code", "aaa")
.click(".auth-btn-wrapper button:nth-child(2)") // Close modal
.pause(50)
.click("button.btn.authorize") // Open modal
.pause(50)
.click(".auth-btn-wrapper button:nth-child(1)") // Logout
.waitForElementVisible("section>input", 5000)
.setValue("section>input", "bbb") // Set user
.waitForElementVisible(`section>input[type="password"]`, 5000)
.setValue(`section>input[type="password"]`, "bbb") // Set password
.click(".auth-btn-wrapper button:nth-child(1)") // Click Authorize
.pause(1000)
.assert.containsText("div.wrapper:nth-child(4)>code", "bbb")
client.end()
})
})

View File

@ -0,0 +1,31 @@
describe("bug #4374: OAS3 parameters should be visibly validated in Try-It-Out", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 10000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "/test-specs/bugs/4374.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("indicates an error when a required parameter is not selected", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.assert.containsText(".opblock-summary-path span", "/pet/findByStatus")
.click(".opblock")
.waitForElementVisible(".opblock.is-open", 5000)
.click(".try-out__btn")
.click(".btn.execute")
.pause(100)
.assert.cssClassPresent(".parameters-col_description select", "invalid")
client.end()
})
})

View File

@ -0,0 +1,28 @@
describe("bug #4409: operationId normalization and layout tracking", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4409.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("expands an operation that has a normalizable operationId", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.assert.containsText(".opblock-summary-path span", "/myApi")
.click(".opblock")
.waitForElementVisible(".opblock-body", 5000)
.assert.cssClassPresent(".opblock", "is-open")
client.end()
})
})

View File

@ -0,0 +1,28 @@
describe("bug #4409: operationId normalization and layout tracking", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4409.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("expands an operation that has a normalizable operationId", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.assert.containsText(".opblock-summary-path span", "/myApi")
.click(".opblock")
.waitForElementVisible(".opblock-body", 5000)
.assert.cssClassPresent(".opblock", "is-open")
client.end()
})
})

View File

@ -0,0 +1,28 @@
describe("bug #4409: operationId normalization and layout tracking", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4409.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("expands an operation that has a normalizable operationId", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.assert.containsText(".opblock-summary-path span", "/myApi")
.click(".opblock")
.waitForElementVisible(".opblock-body", 5000)
.assert.cssClassPresent(".opblock", "is-open")
client.end()
})
})

View File

@ -0,0 +1,28 @@
describe("bug #4536: model name consistency", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4536.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("consistently displays a model's name regardless of expansion state", function (client) {
client.waitForElementVisible("span.model.model-title", 10000)
.assert.containsText("span.model.model-title", "TitleName")
.click("span.model.model-title")
.pause(500)
.assert.containsText("span.model-title__text", "TitleName")
client.end()
})
})

View File

@ -0,0 +1,35 @@
describe("bug #4587: clearing header param values", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4587.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("sets a required initial value based the first enum value", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.click("#operations-sql-execSql")
.waitForElementVisible(".opblock.is-open", 5000)
.click("button.btn.try-out__btn")
.setValue(`tr[data-param-name="x-irest-conn"] input`, "hi")
.click("button.btn.execute")
.waitForElementVisible(".request-url", 2000)
.setValue(`tr[data-param-name="x-irest-conn"] input`, `\u0008\u0008\u0008`) // backspaces
.pause(900)
.click("button.btn.execute")
.expect.element("textarea.curl").text
.to.not.contain(`x-irest-conn`)
})
})

View File

@ -0,0 +1,42 @@
describe("bug #4756: enum initial values", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4756.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("sets a required initial value based the first enum value", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.click("#operations-default-post_zero")
.waitForElementVisible(".opblock.is-open", 5000)
.click("button.btn.try-out__btn")
.click("button.btn.execute")
.waitForElementVisible(".request-url", 2000)
.assert.containsText(".request-url > pre", "http://www.example.com/test/API/zero?one=0")
client.end()
})
it("sets a required initial value based on a default value", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.click("#operations-default-post_one")
.waitForElementVisible(".opblock.is-open", 5000)
.click("button.btn.try-out__btn")
.click("button.btn.execute")
.waitForElementVisible(".request-url", 2000)
.assert.containsText(".request-url > pre", "http://www.example.com/test/API/one?one=1")
client.end()
})
})

View File

@ -0,0 +1,44 @@
describe("bug: unable to change array input", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "/test-specs/bugs/frozen-array-input.yaml")
.click("button.download-url-button")
done()
})
afterEach(function (client, done) {
done()
})
it("consistently displays a model's name regardless of expansion state", function (client) {
client.waitForElementVisible(".opblock-summary-description", 10000)
.assert.containsText("span.opblock-summary-path > a > span", "/test")
.click("#operations-default-get_test")
.pause(500)
.click("button.btn.try-out__btn")
.elements("css selector", ".json-schema-form-item", function (result) {
this.assert.equal(result.value.length, 2, "initial number of array item inputs")
})
.click(".json-schema-form-item-add")
.elements("css selector", ".json-schema-form-item", function (result) {
this.assert.equal(result.value.length, 3, "number of array item inputs after clicking add")
})
.click(".json-schema-form-item-remove")
.click(".json-schema-form-item-remove")
.click(".json-schema-form-item-remove")
.elements("css selector", ".json-schema-form-item", function (result) {
this.assert.equal(result.value.length, 0, "number of array item inputs after removing all items")
})
.click(".json-schema-form-item-add")
.setValue(".json-schema-form-item input", "myValue123")
.click("button.execute")
.pause(100)
.assert.containsText(".request-url pre", "http://localhost:3230/test?fields=myValue123")
client.end()
})
})