
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@marc1706/web-push-testing-service
Advanced tools
A service that can be run locally or on a CLI to manage testing of web push in a language agnostic way
Testing web push is hard and with difference between browsers being an issue as standards are created and implemented, the best approach to ensure a library is up to date is to have integration tests. Sadly this involves knowledge and implementation of selenium web driver and implementing the logic to manage those browsers for push testing.
This library handles the selenium and browser orchestrating and makes them available via a JSON API, simplifying the whole process.
npm install @marc1706/web-push-testing-service -g
To start the push testing service run:
web-push-testing-service start <Service Name>
This will start the service and run it in the background on port 8090. If you need to run it on a different port, you can use the port flag:
web-push-testing-service start <Service Name> -p 9000
Once you've finished using the service you just need run the stop
command.
web-push-testing-service start <Service Name>
With the service started you can make POST requests in the following flow to write integration tests for your push library.
Regardless of the API you call, you'll receive JSON and the top level parameter will be either 'data' or 'error'. Data will change depending on the API called and error with have an 'id' and 'message' parameter.
Start Test Suite This assigns a test suite ID to the current run that all future tests are tied to.
http://localhost:8090/api/start-test-suite/
Input: Nothing
Output
{
data: {
testSuiteId: <New ID>
}
}
Get a Subscription This method expected a testSuiteId, a browser name and the release version and it will return a subscription.
http://localhost:8090/api/get-subscription/
Input
{
testSuiteId: <Test Suite ID Number>,
browserName: <'chrome' | 'firefox'>,
browserVersion: <'stable' | 'beta' | 'unstable' >,
vapidPublicKey: <Base64 URL Encode Vapid Public Key>
}
Output
{
data: {
testId: <ID for this test instance>,
subscription: <A Subscription Object, will have endpoint and keys>
}
}
Wait for notification to arrive Once your library has sent a message you can retrieve what details the browser received.
http://localhost:8090/api/get-notification-status/
Input
{
testSuiteId: <Test Suite ID Number>
testId: <Test ID Number>
}
Output
{
data: {
messages: [
<Payload String>,
...
]
}
}
End the Test Suite This will end and close any currently open tests.
http://localhost:8090/api/end-test-suite/
Input
{
testSuiteId: <Your Test Suite ID>
}
Output
{
data: {
success: true
}
}
FAQs
A service that can be run locally or on a CLI to manage testing of web push in a language agnostic way
We found that @marc1706/web-push-testing-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.