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.
 
 
 
 

48 regels
2.4 KiB

  1. describe("render informationContainer", function () {
  2. let mainPage
  3. let informationContainer
  4. beforeEach(function (client, done) {
  5. mainPage = client
  6. .url("localhost:3200")
  7. .page.main()
  8. client.waitForElementVisible(".download-url-input", 5000)
  9. .pause(5000)
  10. .clearValue(".download-url-input")
  11. .setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
  12. .click("button.download-url-button")
  13. .pause(1000)
  14. informationContainer = mainPage.section.informationContainer
  15. done()
  16. })
  17. it("renders section", function (client) {
  18. mainPage.expect.section("@informationContainer").to.be.visible.before(5000)
  19. client.end()
  20. })
  21. it("renders content", function (client) {
  22. informationContainer.waitForElementVisible("@title", 5000)
  23. .assert.containsText("@title", "Swagger Petstore")
  24. .assert.containsText("@version", "1.0.0")
  25. .assert.containsText("@baseUrl", "[ Base URL: localhost:3204/ ]")
  26. .assert.attributeEquals("@mainUrl", "href", "http://localhost:3200/test-specs/petstore.json")
  27. .assert.containsText("@mainUrlContent", "http://localhost:3200/test-specs/petstore.json")
  28. .assert.containsText("@description", "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.")
  29. .assert.attributeEquals("@swaggerUrl", "href", "http://swagger.io/")
  30. .assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/")
  31. .assert.attributeEquals("@termsLink", "href", "http://swagger.io/terms/")
  32. .assert.containsText("@termsLink", "Terms of service")
  33. .assert.attributeEquals("@contactDevLink", "href", "mailto:apiteam@swagger.io")
  34. .assert.containsText("@contactDevLink", "Contact the developer")
  35. .assert.attributeEquals("@contactDevLink", "href", "mailto:apiteam@swagger.io")
  36. .assert.containsText("@contactDevLink", "Contact the developer")
  37. .assert.attributeEquals("@aboutSwaggerLink", "href", "http://swagger.io/")
  38. .assert.containsText("@aboutSwaggerLink", "Find out more about Swagger")
  39. client.end()
  40. })
  41. })