Use non-normalized operationId for layout management, if it is available (#4410)

* test(e2e): modify e2e hot server to peacefully coexist with dev server

* tests: add failing e2e test case

* fix: use originalOperationId for layout targeting, if available
This commit is contained in:
kyle
2018-04-04 18:55:10 -07:00
committed by GitHub
parent 2c4327bfd8
commit 4480db0390
16 changed files with 81 additions and 26 deletions

View File

@@ -0,0 +1,29 @@
describe("bug #4409: operationId normalization and layout tracking", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4409.yaml")
.click("button.download-url-button")
.pause(1000)
done()
})
afterEach(function (client, done) {
done()
})
it("expands an operation that has a normalizable operationId", function (client) {
client.waitForElementVisible(".opblock-tag-section", 10000)
.assert.containsText(".opblock-summary-path span", "/myApi")
.click(".opblock")
.waitForElementVisible(".opblock-body", 5000)
.assert.cssClassPresent(".opblock", "is-open")
client.end()
})
})

View File

@@ -4,12 +4,12 @@ describe("render informationContainer", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)
@@ -29,8 +29,8 @@ describe("render informationContainer", function () {
.assert.containsText("@title", "Swagger Petstore")
.assert.containsText("@version", "1.0.0")
.assert.containsText("@baseUrl", "[ Base URL: localhost:3204/ ]")
.assert.attributeEquals("@mainUrl", "href", "http://localhost:3200/test-specs/petstore.json")
.assert.containsText("@mainUrlContent", "http://localhost:3200/test-specs/petstore.json")
.assert.attributeEquals("@mainUrl", "href", "http://localhost:3230/test-specs/petstore.json")
.assert.containsText("@mainUrlContent", "http://localhost:3230/test-specs/petstore.json")
.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.")
.assert.attributeEquals("@swaggerUrl", "href", "http://swagger.io/")
.assert.attributeEquals("@swaggerircUrl", "href", "http://swagger.io/irc/")

View File

@@ -3,12 +3,12 @@ describe("Render Model Wrapper", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)

View File

@@ -3,13 +3,13 @@ describe("render pet api container", function () {
let apiWrapper
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/callbacks.openapi.yaml")
.setValue(".download-url-input", "http://localhost:3230/test-specs/callbacks.openapi.yaml")
.click("button.download-url-button")
.pause(1000)

View File

@@ -3,13 +3,13 @@ describe("render pet api container", function () {
let apiWrapper
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.openapi.yaml")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.openapi.yaml")
.click("button.download-url-button")
.pause(1000)

View File

@@ -4,7 +4,7 @@ describe("onComplete option", function () {
let mainPage
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".opblock-tag-section", 5000)

View File

@@ -3,13 +3,13 @@ describe("render pet api container", function () {
let apiWrapper
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)

View File

@@ -3,13 +3,13 @@ describe("render store api container", function(){
let apiWrapper
beforeEach( function(client, done){
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(3000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)

View File

@@ -3,13 +3,13 @@ describe("render user api container", function(){
let apiWrapper
beforeEach( function(client, done){
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)

View File

@@ -4,13 +4,13 @@ describe("Remote $ref rendering", function () {
mainPage = client
// expand the models so we don't have to manually do it
.url("localhost:3200?defaultModelsExpandDepth=5")
.url("localhost:3230?defaultModelsExpandDepth=5")
.page.main()
client.waitForElementVisible(".download-url-input", 5000)
.pause(2000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/refs/api1.yaml")
.setValue(".download-url-input", "http://localhost:3230/test-specs/refs/api1.yaml")
.click("button.download-url-button")
.pause(1000)

View File

@@ -4,7 +4,7 @@ describe("Render scheme", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
schemeContainer = mainPage.section.schemeContainer
@@ -12,7 +12,7 @@ describe("Render scheme", function () {
client.waitForElementVisible(".download-url-input", 5000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)

View File

@@ -18,7 +18,7 @@ describe("initial render", function () {
beforeEach(function (client, done) {
mainPage = client
.url("localhost:3200")
.url("localhost:3230")
.page.main()
topbar = mainPage.section.topbar
@@ -26,7 +26,7 @@ describe("initial render", function () {
client.waitForElementVisible(".download-url-input", 10000)
.pause(5000)
.clearValue(".download-url-input")
.setValue(".download-url-input", "http://localhost:3200/test-specs/petstore.json")
.setValue(".download-url-input", "http://localhost:3230/test-specs/petstore.json")
.click("button.download-url-button")
.pause(1000)

View File

@@ -0,0 +1,24 @@
openapi: 3.0.0
servers:
- url: 'https://__host__/'
info:
description: Test API
version: '1.0'
title: Test API
contact:
name: Sample Person
email: Sample.Person@adp.com
tags:
- name: Test API with Schema
description: Test API with Schema
paths:
/myApi:
get:
operationId: some guid
responses:
'200':
description: Returns documents
description: Returns documents
tags:
- Test API with Schema
summary: Test API with Schema