Download the PHP package thelemon2020/pest-plugin-pom without Composer

On this page you can find all versions of the php package thelemon2020/pest-plugin-pom. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pest-plugin-pom

Pest Plugin POM

A Pest plugin for writing browser tests using the Page Object Model pattern. Integrates with pest-plugin-browser.

Early Release: Pre-v1, bugs are expected. Please open an issue if you find one.

Requirements

Installation

Config

Creates config/pest-plugin-pom.php:


Page Objects

Extend Page, define a url(), and add interaction methods:

Navigate to a page with page() or ::open():

Parameterized URLs

Navigating Between Pages

navigateTo() sends the browser to a page's URL. nowOn() re-wraps the current session as a different page type without reloading — useful after a server-side redirect. nowOn() also verifies the current URL matches the destination.

navigateTo() nowOn()
Navigates the browser Yes No
Verifies current URL No Yes
Accepts {param} values Yes Pattern-matched

Tests

Tests using Page Objects live in tests/Browser/ — Pest's browser plugin handles the rest.


Components

Components encapsulate a reusable piece of UI. They work like pages but have no URL and are always obtained through a page instance.

Selectors passed to interaction methods are scoped to the component's root element automatically.

Selector types

selector() supports all Pest selector forms:

Form Example Matches
CSS 'nav', '.card', '#main', 'my-element' CSS selector
@ data-test '@search-panel' data-test or data-testid attribute
Text content 'Featured Items' Element with that visible text

Tip: If a text content selector isn't behaving as expected, use Playwright's explicit text= prefix — e.g. 'text=submit'.

Typed Accessors

Multiple Instances

Use components()->item(n) (1-based) to target a specific occurrence:

Sub-Components

Call component() on a component to create a child scoped within the parent:

Scoped Assertions

Method Description
assertSee(string $text) Text appears within the component
assertDontSee(string $text) Text does not appear within the component
assertVisible() Root element is visible
assertPresent() Root element is in the DOM
assertMissing() Root element is absent from the DOM
assertCount(string $selector, int $expected) Count of child elements matching selector
assertSeeIn(string $selector, string $text) Text appears within a child element
assertDontSeeIn(string $selector, string $text) Text does not appear within a child element
assertTotal(int $expected) Number of elements matching this component's selector

Scoped Interactions

Method Description
click(string $selector) Click an element
rightClick(string $selector) Right-click an element
type(string $field, string $value) Type into a field
typeSlowly(string $field, string $value, int $delay = 100) Type slowly into a field
fill(string $field, string $value) Fill a field
append(string $field, string $value) Append text to a field
clear(string $field) Clear a field
hover(string $selector) Hover over an element
select(string $field, array\|string\|int $option) Select a dropdown option
radio(string $field, string $value) Select a radio button
check(string $field, ?string $value = null) Check a checkbox
uncheck(string $field, ?string $value = null) Uncheck a checkbox
attach(string $field, string $path) Attach a file
keys(string $selector, array\|string $keys) Send keyboard input
drag(string $from, string $to) Drag one element to another
text(string $selector): ?string Return element text content
attribute(string $selector, string $attribute): ?string Return element attribute value

press(), pressAndWaitFor(), and withKeyDown() are not scoped — they pass through via __call.


Generators

Available concerns: forms, alerts, modals, navigation.

The Page/Component suffix is optional and won't be doubled.


Concerns

InteractsWithForms

Method Description
fillForm(array $fields) Fill multiple fields, keyed by label
submitForm(string $button = 'Submit') Click a submit button by label
checkBox(string $label) Check a checkbox by label
choose(string $field, array\|string\|int $option) Select a dropdown option by label

InteractsWithAlerts

Method Description
assertSuccessMessage(string $message) Assert a success alert is visible
assertErrorMessage(string $message) Assert an error alert is visible
assertFieldError(string $field, string $message) Assert a validation error for a field

InteractsWithModals

Method Description
openModal(string $trigger) Click the element that opens the modal
confirmModal(string $button = 'Confirm') Click the confirm button
dismissModal(string $button = 'Cancel') Click the cancel button
closeModal(string $button = 'Close') Close without confirming

InteractsWithNavigation

Method Description
clickLink(string $label) Click a link by visible text
goBack() Navigate back
goForward() Navigate forward
refresh() Reload the page

Expectations


License

MIT


All versions of pest-plugin-pom with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
pestphp/pest Version ^4.0
pestphp/pest-plugin-browser Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thelemon2020/pest-plugin-pom contains the following files

Loading the files please wait ...