pageom
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

PageOM

Page Object Model framework for Playwright.dev.

Still very much work in progress and isn't ready for general use yet.

Page Class Example

// login.page.ts
import { findBy, PageOMPage, PageOMElement } from 'pageom';

class LoginPage extends PageOMPage {
  slug = '/login';

  @findBy('.login-btn') submitButton: PageOMElement;

  @findBy('.username') usernameField: PageOMElement;

  @findBy('.password') passwordField: PageOMElement;

  /*
   * Attempt to log in to a users account using the provided credentials.
   */
  public login = async ({ username, password }: LoginCredentials) => {
    await this.usernameField.type(username);
    await this.passwordField.type(password);
    await this.submitButton.click();
  };
}

Readme

Keywords

none

Package Sidebar

Install

npm i pageom

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

16.4 kB

Total Files

28

Last publish

Collaborators

  • davidambler