No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

54 líneas
2.8 KiB

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