A package to set ModHeader values in TestCafe tests.
npm install testcafe-modheaderThis package allows you to set ModHeader values in your TestCafe test cases. It provides a convenient way to manipulate request headers using the ModHeader Chrome extension during your TestCafe tests.
You can install the package via npm:
``bash
npm install testcafe-modheader --save-dev
Usage
import testCafeModHeader from 'testcafe-modheader';
fixtureExample Page.pagehttp://www.example.com`;
test('Example Test', async (t) => {
// Define the request headers
const requestHeaders = {
'Authorization': 'Bearer your_token_here',
'Content-Type': 'application/json',
};
// Set the ModHeader values
await testCafeModHeader.setModHeaders(requestHeaders);
// Execute your TestCafe test steps here
await t
.typeText('#inputField', 'Test input')
.click('#submitButton')
.expect(Selector('#result').innerText).eql('Expected Result');
});