|
| 1 | +describe("parameter example rendering", function () { |
| 2 | + describe("swagger 2.0", () => { |
| 3 | + beforeEach(function (client, done) { |
| 4 | + client |
| 5 | + .url("localhost:3230") |
| 6 | + .page.main() |
| 7 | + |
| 8 | + client.waitForElementVisible(".download-url-input:not([disabled])", 5000) |
| 9 | + .clearValue(".download-url-input") |
| 10 | + .setValue(".download-url-input", "/test-specs/features/example.swagger.yaml") |
| 11 | + .click("button.download-url-button") |
| 12 | + .waitForElementVisible(".opblock", 10000) |
| 13 | + .click("#operations-default-put_one") |
| 14 | + .waitForElementVisible("#operations-default-put_one.is-open", 5000) |
| 15 | + |
| 16 | + done() |
| 17 | + }) |
| 18 | + afterEach(function (client, done) { |
| 19 | + done() |
| 20 | + }) |
| 21 | + it("reveals a string parameter's example when viewing that parameter", function (client) { |
| 22 | + client.waitForElementVisible(".opblock-tag-section", 10000) |
| 23 | + .assert.containsText(".opblock-summary-path span", "/one") |
| 24 | + .click(".opblock") |
| 25 | + .waitForElementVisible(".opblock.is-open", 5000) |
| 26 | + .pause(500) |
| 27 | + .assert.containsText(`tr[data-param-name="ValidParam"]`, `12345`) |
| 28 | + |
| 29 | + client.end() |
| 30 | + }) |
| 31 | + |
| 32 | + }) |
| 33 | + describe("openapi 3.0", () => { |
| 34 | + beforeEach(function (client, done) { |
| 35 | + client |
| 36 | + .url("localhost:3230") |
| 37 | + .page.main() |
| 38 | + |
| 39 | + client.waitForElementVisible(".download-url-input:not([disabled])", 5000) |
| 40 | + .clearValue(".download-url-input") |
| 41 | + .setValue(".download-url-input", "/test-specs/features/example.openapi.yaml") |
| 42 | + .click("button.download-url-button") |
| 43 | + .waitForElementVisible(".opblock-summary-description", 10000) |
| 44 | + .click("#operations-agent-editAgent") |
| 45 | + .waitForElementVisible("#operations-agent-editAgent.is-open", 5000) |
| 46 | + |
| 47 | + done() |
| 48 | + }) |
| 49 | + afterEach(function (client, done) { |
| 50 | + done() |
| 51 | + }) |
| 52 | + it("reveals a string parameter's example when viewing that parameter", function (client) { |
| 53 | + it("should respect a primitive example value", function(client) { |
| 54 | + client |
| 55 | + .assert.value( |
| 56 | + `div.parameters-container > div > table > tbody > tr > td.col.parameters-col_description > input[type="text"]`, |
| 57 | + `12345` |
| 58 | + ) |
| 59 | + |
| 60 | + client.end() |
| 61 | + }) |
| 62 | + }) |
| 63 | + }) |
| 64 | +}) |
0 commit comments