meta: introduce Cypress end-to-end testing (via #4827)
* `test/e2e` -> `test/e2e-selenium` * add Cypress * ESLint fixes * MOAR cypress * `integration` -> `tests` * wire Cypress up to a hot e2e server * linter fixes * don't run in CI
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
openapi: "3.0.0"
|
||||
|
||||
paths:
|
||||
/regularParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
- name: str
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: num
|
||||
in: query
|
||||
schema:
|
||||
type: number
|
||||
- name: bool
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
- name: arr
|
||||
in: query
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
/emptyValueParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
allowEmptyValue: true
|
||||
- name: str
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
- name: num
|
||||
in: query
|
||||
schema:
|
||||
type: number
|
||||
allowEmptyValue: true
|
||||
- name: bool
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
allowEmptyValue: true
|
||||
- name: arr
|
||||
in: query
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
@@ -0,0 +1,57 @@
|
||||
swagger: "2.0"
|
||||
|
||||
consumes:
|
||||
- application/json
|
||||
- multipart/form-data
|
||||
paths:
|
||||
/regularParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
type: integer
|
||||
- name: str
|
||||
in: query
|
||||
type: string
|
||||
- name: num
|
||||
in: query
|
||||
type: number
|
||||
- name: bool
|
||||
in: query
|
||||
type: boolean
|
||||
- name: arr
|
||||
in: query
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
/emptyValueParams:
|
||||
get:
|
||||
parameters:
|
||||
- name: int
|
||||
in: query
|
||||
type: integer
|
||||
allowEmptyValue: true
|
||||
- name: str
|
||||
in: query
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
- name: num
|
||||
in: query
|
||||
type: number
|
||||
allowEmptyValue: true
|
||||
- name: bool
|
||||
in: query
|
||||
type: boolean
|
||||
allowEmptyValue: true
|
||||
- name: arr
|
||||
in: query
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
allowEmptyValue: true
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
156
test/e2e-selenium/specs/features/example.openapi.yaml
Normal file
156
test/e2e-selenium/specs/features/example.openapi.yaml
Normal file
@@ -0,0 +1,156 @@
|
||||
openapi: 3.0.0
|
||||
servers:
|
||||
- url: http://example.com/v1
|
||||
description: Production server version 1
|
||||
- url: http://staging-api.example.com
|
||||
description: Staging server
|
||||
info:
|
||||
description: |
|
||||
This is an API documentation of example.
|
||||
version: "0.1.0"
|
||||
title: Example
|
||||
termsOfService: 'http://www.example.com/terms/'
|
||||
contact:
|
||||
email: developer@example.com
|
||||
license:
|
||||
name: Proprietary license
|
||||
url: 'http://www.example.com/license/'
|
||||
tags:
|
||||
- name: agent
|
||||
description: Access to example
|
||||
paths:
|
||||
/agents/{agentId}:
|
||||
put:
|
||||
tags:
|
||||
- agent
|
||||
summary: Edit agent
|
||||
operationId: editAgent
|
||||
parameters:
|
||||
- in: path
|
||||
name: agentId
|
||||
schema:
|
||||
type: integer
|
||||
example: 12345
|
||||
required: true
|
||||
description: Numeric ID of the paper agent to edit
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json_media-type-level:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
example:
|
||||
code: AE1
|
||||
name: Andrew
|
||||
application/json_schema-level:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
example:
|
||||
code: AE1
|
||||
name: Andrew
|
||||
application/json_property-level:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
example: AE1
|
||||
name:
|
||||
type: string
|
||||
example: Andrew
|
||||
responses:
|
||||
'200':
|
||||
description: media type-level example
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int64
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
readOnly: true
|
||||
code:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
example:
|
||||
code: 200
|
||||
payload:
|
||||
- id: 1
|
||||
code: AE2
|
||||
name: Yono
|
||||
'201':
|
||||
description: schema-level example
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int64
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
readOnly: true
|
||||
code:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
example:
|
||||
code: 201
|
||||
payload:
|
||||
- id: 1
|
||||
code: AE2
|
||||
name: Yono
|
||||
'202':
|
||||
description: property-level example
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 202
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
readOnly: true
|
||||
example: 1
|
||||
code:
|
||||
type: string
|
||||
example: AE2
|
||||
name:
|
||||
type: string
|
||||
example: Yono
|
||||
127
test/e2e-selenium/specs/features/example.swagger.yaml
Normal file
127
test/e2e-selenium/specs/features/example.swagger.yaml
Normal file
@@ -0,0 +1,127 @@
|
||||
swagger: "2.0"
|
||||
info:
|
||||
description: |
|
||||
This is an API documentation of example.
|
||||
version: "0.1.0"
|
||||
title: Example
|
||||
termsOfService: 'http://www.example.com/terms/'
|
||||
contact:
|
||||
email: developer@example.com
|
||||
license:
|
||||
name: Proprietary license
|
||||
url: 'http://www.example.com/license/'
|
||||
paths:
|
||||
/one:
|
||||
put:
|
||||
parameters:
|
||||
- in: query
|
||||
name: NotValidParam
|
||||
type: integer
|
||||
example: 12345
|
||||
required: true
|
||||
description: This example **should not** have an effect
|
||||
- in: query
|
||||
name: ValidParam
|
||||
type: integer
|
||||
x-example: 12345
|
||||
description: This example **should** have an effect
|
||||
- in: body
|
||||
name: body
|
||||
description: property-level examples
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
one:
|
||||
type: string
|
||||
example: hello!
|
||||
two:
|
||||
type: object
|
||||
properties:
|
||||
uno:
|
||||
type: string
|
||||
example: wow!
|
||||
dos:
|
||||
type: string
|
||||
example: hey there!
|
||||
- in: body
|
||||
name: body2
|
||||
description: root schema-level example
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
foo:
|
||||
type: string
|
||||
bar:
|
||||
type: integer
|
||||
example:
|
||||
foo: hey
|
||||
bar: 123
|
||||
- in: body
|
||||
name: body3
|
||||
description: nested schema-level example
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
one:
|
||||
type: object
|
||||
properties:
|
||||
uno:
|
||||
type: string
|
||||
dos:
|
||||
type: string
|
||||
example:
|
||||
uno: woohoo!
|
||||
dos: amazing!
|
||||
responses:
|
||||
'201':
|
||||
description: schema-level example
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int64
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
readOnly: true
|
||||
code:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
example:
|
||||
code: 201
|
||||
payload:
|
||||
- id: 1
|
||||
code: AE2
|
||||
name: Yono
|
||||
'202':
|
||||
description: property-level example
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 202
|
||||
payload:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
readOnly: true
|
||||
example: 1
|
||||
code:
|
||||
type: string
|
||||
example: AE2
|
||||
name:
|
||||
type: string
|
||||
example: Yono
|
||||
@@ -0,0 +1,21 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: test
|
||||
version: 0.0.0
|
||||
paths:
|
||||
/report:
|
||||
get:
|
||||
parameters:
|
||||
- in: query
|
||||
name: rel_date
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
default: today
|
||||
enum:
|
||||
- today
|
||||
- yesterday
|
||||
- lastweek
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
@@ -0,0 +1,20 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
title: test
|
||||
version: 0.0.0
|
||||
paths:
|
||||
/report:
|
||||
get:
|
||||
parameters:
|
||||
- in: query
|
||||
name: rel_date
|
||||
required: true
|
||||
type: string
|
||||
default: today
|
||||
enum:
|
||||
- today
|
||||
- yesterday
|
||||
- lastweek
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
Reference in New Issue
Block a user