You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

65 line
2.3 KiB

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