Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tatut/pharo-pows

Pharo library for using Playwright over WebSocket
https://github.com/tatut/pharo-pows

Last synced: about 2 months ago
JSON representation

Pharo library for using Playwright over WebSocket

Awesome Lists containing this project

README

        

# Pharo library for Playwright-over-WebSocket

Pharo library for doing browser testing with Playwright using the [Playwright over WebSocket (pows)](https://github.com/tatut/pows) host.

## Installation

Via Metacello:
```smalltalk
Metacello new
repository: 'github://tatut/pharo-Pows/src';
baseline: 'Pows';
load.
```

Or dependency in baseline:
```smalltalk
spec package: 'Pows-Core' with: [ spec repository: 'github://tatut/pharo-Pows' ]
```

## Usage

You can use the `PowsConnection` directly but for testing you should subclass from `PowsTestCase` which automatically sets up a connection.

Example of a test method:
```smalltalk
testCounter
self
go: 'http://localhost:8080/examples/counter';
locate: 'div.counter' assert: [ :l | l hasText: '0' ];
locate: 'button.inc' do: #click;
locate: 'div.counter' assert: [ :l | l hasText: '1' ];
locate: 'button.dec' do: [ :b | b click; click ];
locate: 'div.counter' assert: [ :l | l hasText: '-1' ]
```

The PowsTestCase has methods to navigate, assert on locators or do actions on them.