Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,13 @@ module.exports = {
apiUrl: 'http://localhost:8080/haalcentraal/api',
api: 'autorisatie-en-protocollering',
logger: {
level: 'warn'
level: 'info'
},
oAuth: {
enable: true
},
addAcceptGezagVersionHeader: false,
logFileToAssert: './test-data/logs/brp-autorisatie-protocollering.json'
addAcceptGezagVersionHeader: true
},
tags: 'not @skip-verify and not @stap-documentatie and not @deprecated and not @gezag-api and not @data-api'
tags: 'not @skip-verify and not @deprecated and not @gezag-api and not @data-api'
}
}
14 changes: 1 addition & 13 deletions features/step_definitions/als-stepdefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,32 +248,20 @@ function createDataTableForRequest(parameterNames, fields) {
return undefined;
}
}

function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}


async function handleRequestWithParameters(context, endpoint, parametersDataTable) {
initializeAfnemerIdAndGemeenteCode(context);

let mustSleep = false;
if(context.gezag !== undefined) {
fs.writeFileSync(context.gezagDataPath, JSON.stringify(context.gezag, null, '\t'));
mustSleep = true;
}
if(context.downstreamApiResponseHeaders !== undefined) {
fs.writeFileSync(context.downstreamApiDataPath + '/response-headers.json',
JSON.stringify(context.downstreamApiResponseHeaders[0], null, '\t'));
mustSleep = true;
}
if(context.downstreamApiResponseBody !== undefined) {
fs.writeFileSync(context.downstreamApiDataPath + '/response-body.json',
context.downstreamApiResponseBody);
mustSleep = true;
}
if(mustSleep) {
// wait 15 ms to ensure the files are written before the request is made
await sleep(15);
}

addDefaultAutorisatieSettings(context, context.afnemerID);
Expand Down
1 change: 0 additions & 1 deletion features/step_definitions/dan-stepdefs-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Then('bevat de request naar de gezag API de header {string} met waarde {string}'

const header = headers[headerNaam];
should.exist(header);
header.should.equal(headerWaarde);
});

Then('bevat de request naar de gezag API geen {string} header', function (headerNaam) {
Expand Down