|
| 1 | +describe("render pet api container", function () { |
| 2 | + let mainPage |
| 3 | + let apiWrapper |
| 4 | + beforeEach(function (client, done) { |
| 5 | + mainPage = client |
| 6 | + .url("localhost:3200") |
| 7 | + .page.main() |
| 8 | + |
| 9 | + client.waitForElementVisible(".download-url-input", 5000) |
| 10 | + .pause(5000) |
| 11 | + .clearValue(".download-url-input") |
| 12 | + .setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.openapi.yaml") |
| 13 | + .click("button.download-url-button") |
| 14 | + .pause(1000) |
| 15 | + |
| 16 | + apiWrapper = mainPage.section.apiWrapper |
| 17 | + |
| 18 | + done() |
| 19 | + }) |
| 20 | + afterEach(function (client, done) { |
| 21 | + done() |
| 22 | + }) |
| 23 | + describe("GET /pet/{petId}", () => { |
| 24 | + it("should render Try-It-Out flow correctly", function (client) { |
| 25 | + apiWrapper.waitForElementVisible("#operations-pet-updatePetWithForm", 10000) |
| 26 | + .assert.containsText("#operations-pet-updatePetWithForm > div > span.opblock-summary-path > a > span", "/pet") |
| 27 | + .click("#operations-pet-updatePetWithForm") |
| 28 | + .waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div", 5000) |
| 29 | + .click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.opblock-section > div.opblock-section-header > div.try-out > button") |
| 30 | + .waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button", 1000) |
| 31 | + .click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button") |
| 32 | + .assert.cssClassNotPresent("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button", "cancel") |
| 33 | + |
| 34 | + client.end() |
| 35 | + }) |
| 36 | + |
| 37 | + it("should have stable input values", function (client) { |
| 38 | + client.waitForElementVisible("#operations-pet-updatePetWithForm", 10000) |
| 39 | + .assert.containsText("#operations-pet-updatePetWithForm > div > span.opblock-summary-path > a > span", "/pet") |
| 40 | + .click("#operations-pet-updatePetWithForm") |
| 41 | + .waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div", 5000) |
| 42 | + .click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.opblock-section > div.opblock-section-header > div.try-out > button") |
| 43 | + .waitForElementVisible("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button", 1000) |
| 44 | + .setValue("#operations-pet-updatePetWithForm td.parameters-col_description > input", "12345") |
| 45 | + .click("#operations-pet-updatePetWithForm > div:nth-child(2) > div > div.execute-wrapper > button") |
| 46 | + .pause(800) // for swagger-api/swagger-ui#4269, which happens above 350ms |
| 47 | + .assert.containsText("#operations-pet-updatePetWithForm div.responses-inner > div > div > div:nth-child(2) > div > pre", "http://localhost:3204/pet/12345") |
| 48 | + .assert.value("#operations-pet-updatePetWithForm td.parameters-col_description > input", "12345") |
| 49 | + |
| 50 | + client.end() |
| 51 | + }) |
| 52 | + }) |
| 53 | +}) |
0 commit comments