feat: add quotas (#4779)

adds possibilities to cap authenticated requests and execution seconds of actions on a defined intervall
This commit is contained in:
Elio Bischof
2023-02-15 02:52:11 +01:00
committed by GitHub
parent 45f6a4436e
commit 681541f41b
117 changed files with 4652 additions and 510 deletions

View File

@@ -0,0 +1,31 @@
import { SystemAPI } from './types';
export function instanceUnderTest(api: SystemAPI): Cypress.Chainable<string> {
return cy
.request({
method: 'POST',
url: `${api.baseURL}/instances/_search`,
auth: {
bearer: api.token,
},
})
.then((res) => {
const instances = <Array<any>>res.body.result;
expect(instances.length).to.equal(
1,
'instanceUnderTest just supports running against an API with exactly one instance, yet',
);
return instances[0].id;
});
}
export function getInstance(api: SystemAPI, instanceId: string, failOnStatusCode = true) {
return cy.request({
method: 'GET',
url: `${api.baseURL}/instances/${instanceId}`,
auth: {
bearer: api.token,
},
failOnStatusCode: failOnStatusCode,
});
}