Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/tatut/pharo-pows
- Owner: tatut
- License: mit
- Created: 2024-01-09T16:34:36.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-09T19:40:40.000Z (about 1 year ago)
- Last Synced: 2024-10-13T22:52:03.316Z (3 months ago)
- Language: Smalltalk
- Size: 19.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.