hoprnet / hopr-core

Main repository of HOPR - this is all you need to run a node on the HOPR network!
https://hoprnet.org
GNU General Public License v3.0
14 stars 5 forks source link

Setup e2e tests for web server on datacenter for Stage 0-1 resources #121

Closed 0xjjpa closed 4 years ago

0xjjpa commented 4 years ago

Pretty much we'll need to verify all our stage 0 actions, so it would look something like this (not including everything, e.g. connected_nodes):

# Status
return request(hoprServer.getHttpServer())
      .get('/status')
      .expect(200)
      .expect({ status: 'ok' });

# Version
return request(hoprServer.getHttpServer())
      .get('/status')
      .expect(200)
      .expect({ core: '0.6.16' });

# Shutdown
return request(hoprServer.getHttpServer())
      .post('/shutdown')
      .expect(201)
      .expect({ message: $TIMESTAMP });

# Ping
return request(hoprServer.getHttpServer())
      .post('/ping', { address: hoprServer2.getAddress() })
      .expect(201)
      .expect({ latency: $LATENCY });
nionis commented 4 years ago

the e2e test suite initializes a bootstrap node and a simple node, then those two are used alongside with a client instance to carry out tests