Controls basics about where the endpoint lives (e.g. server, port).
These settings apply to all specs in an entire suite file.
1linkmeta:
2link name: Make sure Google loads
3link locate_files_relative: true
4linkconfiguration:
5link host: api.mycompany.com
6link scheme: http
7link port: 1337
8link base_path: /api/v3
9linkspecs:
10link - name: Fetch users
11link request:
12link method: get
13link path: /users
14link response:
15link status_code: 200
16link# http://api.mycompany.com:1337/api/v3/users
https
http
, https
What protocol (scheme) to use. Generally, http or https
localhost
What server to use.
8080
A custom port to use. Note that it must be a number.
/api
An optional base path to prepend to each URL.
Dynamically set any of the configuration using either an inline or external JS function.
See also:
1linkconfiguration:
2link scheme: https
3link port: 443
4link base_path: /api
5link custom_configuration:
6link run_type: inline
7link inline:
8link function: !!js/function >
9link function() {
10link if (process.env.NODE_ENV === 'dev') {
11link this.scheme = 'http';
12link this.port = 1337;
13link this.host = 'localhost;
14link return;
15link }
16link this.host = `${process.env.NODE_ENV || 'www'}.yourcompany.com`;
17link }
18link# NODE_ENV=dev --> http://localhost:1337/api
19link# NODE_ENV=qa --> https://qa.yourcompany.com/api
20link# NODE_ENV="" --> https://www.yourcompany.com/api
See also:
1linkconfiguration:
2link host: yourcompany.com
3link scheme: https
4link port: 443
5link base_path: /api
6link custom_configuration:
7link run_type: inline
8link inline:
9link function: !js/asyncFunction >
10link async function() {
11link this.scheme = 'http';
12link this.port = 3027;
13link }
14link# https//yourcompany.com:3027/api
See also:
1linkconfiguration:
2link host: yourcompany.com
3link scheme: https
4link port: 443
5link base_path: /api
6link custom_configuration:
7link run_type: module
8link module:
9link module_path: config/test.js
10link function_name: configureForEnv # --> 'this'bound to suite object, e.g. this.host, this.port, etc.