
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Pompeteer is a library for creating simple and (most importantly) nestable POMs in Puppeteer.
At the moment of it's conception any attempt to find a guideline or tool for writing POMs in Puppeteer only resulted in simplistic solutions, such as storing selectors in the fields of an object and calling it a POM. This approach is lacking in both utility and functionality, since it does not allow us to create reusable elements with extended functionality and nesting them within each-other.
npm install pompeteer
Extend the PompPage and PompElement classes to define the layout of your application.
import { PompElement, PompPage } from "pompeteer";
export class MainPage extends PompPage {
async open(url = "http://localhost:3000") {
await this.page.goto(url, { waitUntil: "domcontentloaded" });
return this;
}
users = this.$$(".user", UserBox);
}
export class UserBox extends PompElement {
name = this.$x(".name");
job = this.$x(".job");
email = this.$x(".email");
age = this.$x(".age");
getUser = async (): Promise<User> => {
const name = await this.name.text;
const job = await this.job.text;
const email = await this.email.text;
const age = +(await this.age.text);
return {
firstName,
lastName,
job,
email,
age,
};
};
}
const main = await new MainPage(page).open();
const userData = await (await main.users.locator())[0].getUser();
You can also specify sub-elements within elements the same way you can within pages in order to easily create a nested structure of any complexity. As well as create elements with additional arguments.
export class CustomElement extends PompElement {
constructor(
page: Page,
locator: LocatorFunction,
private color: string,
private value: number,
) {
super(page, locator);
}
}
export class CustomPage extends PompPage {
element = this.$$("#element", CustomElement, 'red', 45);
}
FAQs
POM library for puppeteer
The npm package pompeteer receives a total of 4 weekly downloads. As such, pompeteer popularity was classified as not popular.
We found that pompeteer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.