Soap Helper for Codeceptjs
npm install codeceptjs-soap-helper
CodeceptJS Soap helper.
NPM package:
npm i codeceptjs-soap-helper --save-dev
This helper should be added in your codeceptjs config file: codecept.conf.*
Example:
```
{
...
helpers: {
SoapHelper: {
require: 'codeceptjs-soap-helper',
endpoint: 'http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso'
}
}
...
}
actor, try running npx codeceptjs def`
const I: CodeceptJS.I = inject().I;Feature('SOAP testing');
Scenario.only('Number conversion service', async () => {
const res = await I.sendSoapRequest('http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso',
) I.expectContain(res.data, 'Europe');
});
`Output
`
Helpers: SOAPHelper, ExpectHelper
Plugins: screenshotOnFailSOAP testing --
[1] Starting recording promises
Timeouts:
Number conversion service
I send soap request "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso", "
"
› [Request] {"baseURL":"http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso","method":"POST","data":"\n\n \n \n \n \n ","headers":{"Content-Type":"text/xml;charset=UTF-8"}}
› [Response] "\r\n\r\n \r\n \r\n \r\n \r\n AF \r\n Africa \r\n \r\n \r\n AN \r\n Antarctica \r\n \r\n \r\n AS \r\n Asia \r\n \r\n \r\n EU \r\n Europe \r\n \r\n \r\n OC \r\n Ocenania \r\n \r\n \r\n AM \r\n The Americas \r\n \r\n \r\n \r\n \r\n "
I expect contain "
AF
Africa
AN
Antarctica
AS
Asia
EU
Europe
OC
Ocenania
AM
The Americas
", "Europe"
✔ OK in 246ms
OK | 1 passed // 250ms
``